Merge pull request #1498 from robertbaldyga/fix-kmemleak

rpool: Mark an entry for kmemleak outside of atomic context
This commit is contained in:
Robert Baldyga 2024-09-02 13:53:56 +02:00 committed by GitHub
commit dd040386c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -218,12 +218,15 @@ void *cas_rpool_try_get(struct cas_reserve_pool *rpool_master, int *cpu)
entry = RPOOL_ITEM_TO_ENTRY(rpool_master, item); entry = RPOOL_ITEM_TO_ENTRY(rpool_master, item);
list_del(item); list_del(item);
atomic_dec(&current_rpool->count); atomic_dec(&current_rpool->count);
/* The actuall allocation - kmemleak should start tracking page */
kmemleak_alloc(entry, rpool_master->entry_size, 1, GFP_NOIO);
} }
spin_unlock_irqrestore(&current_rpool->lock, flags); spin_unlock_irqrestore(&current_rpool->lock, flags);
if (entry) {
/* The actual allocation - kmemleak should start tracking page */
kmemleak_alloc(entry, rpool_master->entry_size, 1, GFP_NOIO);
}
CAS_DEBUG_PARAM("[%s]Removed item from reserve pool [%s] for cpu [%d], " CAS_DEBUG_PARAM("[%s]Removed item from reserve pool [%s] for cpu [%d], "
"items in pool %d", rpool_master->name, "items in pool %d", rpool_master->name,
item == NULL ? "SKIPPED" : "OK", *cpu, item == NULL ? "SKIPPED" : "OK", *cpu,