Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755354Ab2HOPiZ (ORCPT ); Wed, 15 Aug 2012 11:38:25 -0400 Received: from mx2.parallels.com ([64.131.90.16]:33130 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754621Ab2HOPiX (ORCPT ); Wed, 15 Aug 2012 11:38:23 -0400 Message-ID: <502BC1B1.3010807@parallels.com> Date: Wed, 15 Aug 2012 19:35:13 +0400 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: Michal Hocko , , , , , Johannes Weiner , Andrew Morton , , David Rientjes , Pekka Enberg Subject: Re: [PATCH v2 04/11] kmem accounting basic infrastructure References: <1344517279-30646-1-git-send-email-glommer@parallels.com> <1344517279-30646-5-git-send-email-glommer@parallels.com> <20120814162144.GC6905@dhcp22.suse.cz> <502B6D03.1080804@parallels.com> <20120815123931.GF23985@dhcp22.suse.cz> <000001392ac15404-43a3fd2c-a6d3-4985-b173-74bb586ad47c-000000@email.amazonses.com> <502BBC35.809@parallels.com> <000001392aec1926-72b3a631-1fb1-460c-803d-38c4405151e1-000000@email.amazonses.com> In-Reply-To: <000001392aec1926-72b3a631-1fb1-460c-803d-38c4405151e1-000000@email.amazonses.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [109.173.1.99] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 38 On 08/15/2012 07:34 PM, Christoph Lameter wrote: > On Wed, 15 Aug 2012, Glauber Costa wrote: > >> On 08/15/2012 06:47 PM, Christoph Lameter wrote: >>> On Wed, 15 Aug 2012, Michal Hocko wrote: >>> >>>>> That is not what the kernel does, in general. We assume that if he wants >>>>> that memory and we can serve it, we should. Also, not all kernel memory >>>>> is unreclaimable. We can shrink the slabs, for instance. Ying Han >>>>> claims she has patches for that already... >>>> >>>> Are those patches somewhere around? >>> >>> You can already shrink the reclaimable slabs (dentries / inodes) via >>> calls to the subsystem specific shrinkers. Did Ying Han do anything to >>> go beyond that? >>> >> That is not enough for us. >> We would like to make sure that the objects being discarded belong to >> the memcg which is under pressure. We don't need to be perfect here, and >> an occasional slip is totally fine. But if in general, shrinking from >> memcg A will mostly wipe out objects from memcg B, we harmed the system >> in return for nothing good. > > How can you figure out which objects belong to which memcg? The ownerships > of dentries and inodes is a dubious concept already. > Remember we copy over the metadata and create copies of the caches per-memcg. Therefore, a dentry belongs to a memcg if it was allocated from the slab pertaining to that memcg. It is not 100 % accurate, but it is good enough. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/