From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v4 24/25] memcg/slub: shrink dead caches Date: Fri, 20 Jul 2012 19:16:56 -0300 Message-ID: <5009D8D8.6040509@parallels.com> References: <1340015298-14133-1-git-send-email-glommer@parallels.com> <1340015298-14133-25-git-send-email-glommer@parallels.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Christoph Lameter Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Pekka Enberg , David Rientjes , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frederic Weisbecker , Suleiman Souhlal , Pekka Enberg , Michal Hocko , Johannes Weiner On 07/06/2012 12:16 PM, Christoph Lameter wrote: > On Mon, 18 Jun 2012, Glauber Costa wrote: > >> In the slub allocator, when the last object of a page goes away, we >> don't necessarily free it - there is not necessarily a test for empty >> page in any slab_free path. > > This is the same btw in SLAB which keeps objects in per cpu caches and > keeps empty slab pages on special queues. > >> This patch marks all memcg caches as dead. kmem_cache_shrink is called >> for the ones who are not yet dead - this will force internal cache >> reorganization, and then all references to empty pages will be removed. > > You need to call this also for slab to drain the caches and free the pages > on the empty list. > Doesn't the SLAB have a time-based reaper for that? That's why I was less concerned with the SLAB, but I can certainly call it for both. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx143.postini.com [74.125.245.143]) by kanga.kvack.org (Postfix) with SMTP id 04F6A6B0044 for ; Fri, 20 Jul 2012 18:19:52 -0400 (EDT) Message-ID: <5009D8D8.6040509@parallels.com> Date: Fri, 20 Jul 2012 19:16:56 -0300 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v4 24/25] memcg/slub: shrink dead caches References: <1340015298-14133-1-git-send-email-glommer@parallels.com> <1340015298-14133-25-git-send-email-glommer@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: linux-mm@kvack.org, Pekka Enberg , David Rientjes , cgroups@vger.kernel.org, devel@openvz.org, kamezawa.hiroyu@jp.fujitsu.com, linux-kernel@vger.kernel.org, Frederic Weisbecker , Suleiman Souhlal , Pekka Enberg , Michal Hocko , Johannes Weiner On 07/06/2012 12:16 PM, Christoph Lameter wrote: > On Mon, 18 Jun 2012, Glauber Costa wrote: > >> In the slub allocator, when the last object of a page goes away, we >> don't necessarily free it - there is not necessarily a test for empty >> page in any slab_free path. > > This is the same btw in SLAB which keeps objects in per cpu caches and > keeps empty slab pages on special queues. > >> This patch marks all memcg caches as dead. kmem_cache_shrink is called >> for the ones who are not yet dead - this will force internal cache >> reorganization, and then all references to empty pages will be removed. > > You need to call this also for slab to drain the caches and free the pages > on the empty list. > Doesn't the SLAB have a time-based reaper for that? That's why I was less concerned with the SLAB, but I can certainly call it for both. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752253Ab2GTWTq (ORCPT ); Fri, 20 Jul 2012 18:19:46 -0400 Received: from mx2.parallels.com ([64.131.90.16]:47098 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751520Ab2GTWTp (ORCPT ); Fri, 20 Jul 2012 18:19:45 -0400 Message-ID: <5009D8D8.6040509@parallels.com> Date: Fri, 20 Jul 2012 19:16:56 -0300 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Christoph Lameter CC: , Pekka Enberg , David Rientjes , , , , , Frederic Weisbecker , Suleiman Souhlal , Pekka Enberg , Michal Hocko , Johannes Weiner Subject: Re: [PATCH v4 24/25] memcg/slub: shrink dead caches References: <1340015298-14133-1-git-send-email-glommer@parallels.com> <1340015298-14133-25-git-send-email-glommer@parallels.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [201.82.132.184] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/2012 12:16 PM, Christoph Lameter wrote: > On Mon, 18 Jun 2012, Glauber Costa wrote: > >> In the slub allocator, when the last object of a page goes away, we >> don't necessarily free it - there is not necessarily a test for empty >> page in any slab_free path. > > This is the same btw in SLAB which keeps objects in per cpu caches and > keeps empty slab pages on special queues. > >> This patch marks all memcg caches as dead. kmem_cache_shrink is called >> for the ones who are not yet dead - this will force internal cache >> reorganization, and then all references to empty pages will be removed. > > You need to call this also for slab to drain the caches and free the pages > on the empty list. > Doesn't the SLAB have a time-based reaper for that? That's why I was less concerned with the SLAB, but I can certainly call it for both.