From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 0/4] Kernel memory accounting container (v3) Date: Tue, 18 Sep 2007 10:56:21 +0400 Message-ID: <46EF7695.7010804@openvz.org> References: <46EE70B4.6060902@openvz.org> <46EEE8B7.2070805@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Christoph Lameter Cc: Linux Containers , Balbir Singh List-Id: containers.vger.kernel.org Christoph Lameter wrote: > On Tue, 18 Sep 2007, Balbir Singh wrote: > >> I've wondered the same thing and asked the question. Pavel wrote >> back to me saying >> >> "The pages that are full of objects are not linked in any list >> in kmem_cache so we just cannot find them." > > That is true for any types of slab cache and not restricted to kmalloc > slabs. SLUB can be switched into a mode where it provides these lists > (again at a performance penalty). > > But I thought we generate the counters at alloc and free time? So why do > we need to traverse the object lists? When we make echo 0 > /sys/slab/xxx/cache_notify we want all the objects to be unaccounted back immediately. Even __free_slab() won't catch this because the SLAB_NOTIFY flag will be turned off for this cache. So we have to walk all the objects and unaccount them.