public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Andrew Morton <akpm@digeo.com>
Cc: John Levon <movement@marcelothewonderpenguin.com>,
	Ed Tomlinson <tomlins@cam.org>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.5.39 kmem_cache bug
Date: Sat, 28 Sep 2002 23:12:54 +0200	[thread overview]
Message-ID: <3D961B56.2010403@colorfullife.com> (raw)
In-Reply-To: 3D961797.B4094994@digeo.com

Andrew Morton wrote:
> John Levon wrote:
> 
>>kmem_cache_destroy() is falsely reporting
>>"kmem_cache_destroy: Can't free all objects" in 2.5.39. I have
>>verified my code was freeing all allocated items correctly.
>>
>>Reverting this chunk :
>>
>>-                       list_add(&slabp->list, &cachep->slabs_free);
>>+/*                     list_add(&slabp->list, &cachep->slabs_free);            */
>>+                       if (unlikely(list_empty(&cachep->slabs_partial)))
>>+                               list_add(&slabp->list, &cachep->slabs_partial);
>>+                       else
>>+                               kmem_slab_destroy(cachep, slabp);
>>
>>and the problem goes away. I haven't investigated why.
>>
> 
> 
> Thanks.  That's the code which leaves one empty page available
> for new allocations rather than freeing it immediately.
> 
> It's temporary.  Ed, I think we can just do
> 
> 	if (list_empty(&cachep->slabs_free))
> 		list_add(&slabp->list, &cachep->slabs_free);
> 	else
> 		kmem_slab_destroy(cachep, slabp);
> 
> there?

Look correct.
If you apply it, then reenable the BUG check in s_show() if a slab with 
0 allocations is found on the partial list, too.

--
	Manfred


  reply	other threads:[~2002-09-28 21:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28 20:13 2.5.39 kmem_cache bug John Levon
2002-09-28 20:56 ` Andrew Morton
2002-09-28 21:12   ` Manfred Spraul [this message]
2002-09-28 21:23   ` John Levon
2002-09-28 21:35     ` Andrew Morton
2002-09-29 11:45   ` Ed Tomlinson
2002-09-29 12:13     ` Manfred Spraul
2002-09-29 13:15   ` Ed Tomlinson
2002-09-29 13:52     ` Manfred Spraul
2002-09-29 13:53     ` John Levon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D961B56.2010403@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=movement@marcelothewonderpenguin.com \
    --cc=tomlins@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox