From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: Re: Linux SLAB allocator issue Date: Wed, 7 Jun 2006 10:41:55 -0700 (PDT) Message-ID: References: <4ae3c140606061358j140eec9fl45e22f8a9e673215@mail.gmail.com> <84144f020606070516m4bccdecdr998941ee74744a83@mail.gmail.com> <4ae3c140606070837t23182496s42edb3a754169d43@mail.gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Pekka Enberg , linux-kernel , linux-fsdevel@vger.kernel.org Return-path: Received: from omx1-ext.sgi.com ([192.48.179.11]:51350 "EHLO omx1.americas.sgi.com") by vger.kernel.org with ESMTP id S932090AbWFGRmC (ORCPT ); Wed, 7 Jun 2006 13:42:02 -0400 To: Xin Zhao In-Reply-To: <4ae3c140606070837t23182496s42edb3a754169d43@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 7 Jun 2006, Xin Zhao wrote: > Then, I used kmem_cache_alloc() to allocate 128 objects. So it should > occupy 12 full slabs and 1 partial slab. Right? There may be additional objects in the various caches. If this is a UP system then some will certainly be in the per cpu cache. You can push these back into the free lists by draining the array cache. If you allocate objects on a slab that is fresh (no objects in it) then only full slabs will be used. The remaining objects will end up on the per cpu lists where they can be consumed without more work on the full/partial arrays.