am 27660999: am 653f9581: Merge "logd: per UID less aggressive 12.5% threshold"
* commit '2766099959799434b114f6272107df04f55493d8': logd: per UID less aggressive 12.5% threshold
This commit is contained in:
commit
ef9a093fdd
|
@ -365,9 +365,16 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
|
|||
|
||||
if (sorted.get()) {
|
||||
if (sorted[0] && sorted[1]) {
|
||||
worst = sorted[0]->getKey();
|
||||
worst_sizes = sorted[0]->getSizes();
|
||||
second_worst_sizes = sorted[1]->getSizes();
|
||||
// Calculate threshold as 12.5% of available storage
|
||||
size_t threshold = log_buffer_size(id) / 8;
|
||||
if (worst_sizes > threshold) {
|
||||
worst = sorted[0]->getKey();
|
||||
second_worst_sizes = sorted[1]->getSizes();
|
||||
if (second_worst_sizes < threshold) {
|
||||
second_worst_sizes = threshold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue