mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
common/PriorityCache: fix over-aggressive assert when mem limited
Fixes: https://tracker.ceph.com/issues/39437 Signed-off-by: Mark Nelson <mnelson@redhat.com>
This commit is contained in:
parent
0d0e87241a
commit
75f60f3776
@ -262,7 +262,13 @@ namespace PriorityCache
|
||||
// Each cache is going to get a little extra from get_chunk, so shrink the
|
||||
// available memory here to compensate.
|
||||
mem_avail -= get_chunk(1, tuned_mem) * caches.size();
|
||||
ceph_assert(mem_avail >= 0);
|
||||
|
||||
if (mem_avail < 0) {
|
||||
// There's so little memory available that just assigning a chunk per
|
||||
// cache pushes us over the limit. Set mem_avail to 0 and continue to
|
||||
// ensure each priority's byte counts are zeroed in balance_priority.
|
||||
mem_avail = 0;
|
||||
}
|
||||
|
||||
// Assign memory for each priority level
|
||||
for (int i = 0; i < Priority::LAST+1; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user