From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751766Ab2JVHho (ORCPT ); Mon, 22 Oct 2012 03:37:44 -0400 Received: from mx2.parallels.com ([64.131.90.16]:55175 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483Ab2JVHhn (ORCPT ); Mon, 22 Oct 2012 03:37:43 -0400 Message-ID: <5084F7B2.7000105@parallels.com> Date: Mon, 22 Oct 2012 11:37:22 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Christoph Lameter CC: , , , Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , , David Rientjes , Pekka Enberg , , Pekka Enberg , Suleiman Souhlal Subject: Re: [PATCH v5 14/18] memcg/sl[au]b: shrink dead caches References: <1350656442-1523-1-git-send-email-glommer@parallels.com> <1350656442-1523-15-git-send-email-glommer@parallels.com> <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000@email.amazonses.com> In-Reply-To: <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000@email.amazonses.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/19/2012 11:47 PM, Christoph Lameter wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >> An unlikely branch is used to make sure this case does not affect >> performance in the usual slab_free path. >> >> The slab allocator has a time based reaper that would eventually get rid >> of the objects, but we can also call it explicitly, since dead caches >> are not a likely event. > > This is also something that could be done from slab_common since all > allocators have kmem_cache_shrink and kmem_cache_shrink can be used to > drain the caches and free up empty slab pages. > The changelog needs to be updated. I updated the code, forgot the changelog =( I am actually now following Tejun's last suggestion, and no longer using my old verify_dead code. So I am basically calling shrink_slab every once in a while until the cache disappears. The only change I still need in the allocators is to count the amount of pages they have, so I can differentiate between need-to-shrink and need-to-destroy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx164.postini.com [74.125.245.164]) by kanga.kvack.org (Postfix) with SMTP id 16B306B0069 for ; Mon, 22 Oct 2012 03:37:44 -0400 (EDT) Message-ID: <5084F7B2.7000105@parallels.com> Date: Mon, 22 Oct 2012 11:37:22 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v5 14/18] memcg/sl[au]b: shrink dead caches References: <1350656442-1523-1-git-send-email-glommer@parallels.com> <1350656442-1523-15-git-send-email-glommer@parallels.com> <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000@email.amazonses.com> In-Reply-To: <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000@email.amazonses.com> 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, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , kamezawa.hiroyu@jp.fujitsu.com, David Rientjes , Pekka Enberg , devel@openvz.org, Pekka Enberg , Suleiman Souhlal On 10/19/2012 11:47 PM, Christoph Lameter wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >> An unlikely branch is used to make sure this case does not affect >> performance in the usual slab_free path. >> >> The slab allocator has a time based reaper that would eventually get rid >> of the objects, but we can also call it explicitly, since dead caches >> are not a likely event. > > This is also something that could be done from slab_common since all > allocators have kmem_cache_shrink and kmem_cache_shrink can be used to > drain the caches and free up empty slab pages. > The changelog needs to be updated. I updated the code, forgot the changelog =( I am actually now following Tejun's last suggestion, and no longer using my old verify_dead code. So I am basically calling shrink_slab every once in a while until the cache disappears. The only change I still need in the allocators is to count the amount of pages they have, so I can differentiate between need-to-shrink and need-to-destroy -- 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 From: Glauber Costa Subject: Re: [PATCH v5 14/18] memcg/sl[au]b: shrink dead caches Date: Mon, 22 Oct 2012 11:37:22 +0400 Message-ID: <5084F7B2.7000105@parallels.com> References: <1350656442-1523-1-git-send-email-glommer@parallels.com> <1350656442-1523-15-git-send-email-glommer@parallels.com> <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000@email.amazonses.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0000013a7a9144d1-de184c46-2a7d-4e6c-8606-927cc1f48969-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org> 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, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mel Gorman , Tejun Heo , Andrew Morton , Michal Hocko , Johannes Weiner , kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, David Rientjes , Pekka Enberg , devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, Pekka Enberg , Suleiman Souhlal On 10/19/2012 11:47 PM, Christoph Lameter wrote: > On Fri, 19 Oct 2012, Glauber Costa wrote: > >> An unlikely branch is used to make sure this case does not affect >> performance in the usual slab_free path. >> >> The slab allocator has a time based reaper that would eventually get rid >> of the objects, but we can also call it explicitly, since dead caches >> are not a likely event. > > This is also something that could be done from slab_common since all > allocators have kmem_cache_shrink and kmem_cache_shrink can be used to > drain the caches and free up empty slab pages. > The changelog needs to be updated. I updated the code, forgot the changelog =( I am actually now following Tejun's last suggestion, and no longer using my old verify_dead code. So I am basically calling shrink_slab every once in a while until the cache disappears. The only change I still need in the allocators is to count the amount of pages they have, so I can differentiate between need-to-shrink and need-to-destroy