Re: kmem_cache_destroy: Can't free all objects (2.6)

Philippe Elie
2003-08-15T12:04:27Z

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

Jozsef Kadlecsik wrote:
> On Thu, 14 Aug 2003, Philippe Elie wrote:
>
>
>>>This happens both with 2.5.74 and 2.6.0-test1.
>>
>>I fixed a bug with exactly this symptom, all object freed but
>>the cache was retaining some object internally. I look 2.6.0-test1
>>and the fix is in, apologies if you already did it correctly
>>but can you double check the bug is really in 2.6.0-test1.
>
>
> Yes. Before I posted my mail I googled a lot and found your fix. I
> checked the source of 2.6.0-test1 and your fix is there of course.

Thanks, I wanted to be sure before digging in the source. Try
the attached patch please.

regards,
Philippe Elie

[-- Attachment #2: slab.diff --]
[-- Type: text/plain, Size: 321 bytes --]

--- mm/slab.c~ 2003-07-14 03:36:48.000000000 +0000
+++ mm/slab.c 2003-08-15 13:59:34.000000000 +0000
@@ -2349,7 +2349,7 @@
int tofree;

check_spinlock_acquired(cachep);
- if (ac->touched) {
+ if (ac->touched && !force) {
ac->touched = 0;
} else if (ac->avail) {
tofree = force ? ac->avail : (ac->limit+4)/5;