Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp371873imm; Thu, 31 May 2018 01:52:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2js40R9MOyMYrjp2kUbsHaFNN5kNrdIAa6xff/mXjoa3C7wQABvJkxH+WUqLMT5uS03Og X-Received: by 2002:a63:b147:: with SMTP id g7-v6mr4763239pgp.379.1527756736398; Thu, 31 May 2018 01:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527756736; cv=none; d=google.com; s=arc-20160816; b=PanHVqXOF6aIz6nSPE931DYYj46rDL99Id0fLK4WDQ3J5jPgn/tGxIHuJ9Vj1bIFBo 6rzXnIBDhiv/Y+zg391yn6UOygHmEkF8iv1iNhNFg9UsP9sS10oFzRbZZ99OExBuDaah rWEcQnzpMYR3rPMl7W8+1GP0Ls9FpCRenO3mmp1fMy2PuIi2x249yHXZl+XHnvlpIxca mPYKQDSfQzjZFO4zdvuUgmV8OTfhcn0vf72NFCL9Yi+FbeaTIfZF1KB3qgzvWfMMl8k9 TzpN4vXT0c8bgLU1qn4x/d84ESOmPXxKLS+TSwIflladN/5xSU0aVvB3Lq4WoC9OPGwv G2Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=d/EwW/ON3Yt4jnE26h0atWF/M7pphNE4ulNPjYBfPBk=; b=O+fz0oWbKKERDv1aNyJYsg8GGLAJ7t0G6wU0DgQn0DI6gJJp/NhXviJAJATKyc4zpT UX5Td+1sHl44fa2w1D1S/TUa1mjSrQZOKCW7RRcvIXgcenTcspSAAwWu+eF1z9iURtVb vL2rsJW1y+sl9C+b5vm+2HrcFyWfQk6Ri5FBwmnjX4iLQ2HnXTdG7XIF/T0ZIwb60C+Z 3o/GLbVD6T7yj3hrF3Fj+mvL2ksYbn55Zh8DUpDkWb4zDbxp5p+QMZen+YsoDszEIG6R jo0aLbRElSfS8YVUDzTdfFGrUSB+AiDGzftPoQ2cN1gSMTlXXFH7I6stFrKNVoqO2qck jl1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21-v6si12531319pls.237.2018.05.31.01.52.02; Thu, 31 May 2018 01:52:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754115AbeEaIvR (ORCPT + 99 others); Thu, 31 May 2018 04:51:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:59386 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754040AbeEaIvN (ORCPT ); Thu, 31 May 2018 04:51:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 28C51AC95; Thu, 31 May 2018 08:51:12 +0000 (UTC) Date: Thu, 31 May 2018 10:51:09 +0200 From: Michal Hocko To: Minchan Kim Cc: Shakeel Butt , Vladimir Davydov , Andrew Morton , Greg Thelen , Johannes Weiner , Linux MM , Cgroups , LKML Subject: Re: [PATCH] memcg: force charge kmem counter too Message-ID: <20180531085109.GJ15278@dhcp22.suse.cz> References: <20180525185501.82098-1-shakeelb@google.com> <20180526185144.xvh7ejlyelzvqwdb@esperanza> <20180528091110.GG1517@dhcp22.suse.cz> <20180529083153.GR27180@dhcp22.suse.cz> <20180531060133.GA31477@rodete-desktop-imager.corp.google.com> <20180531065642.GI15278@dhcp22.suse.cz> <20180531082317.GA52285@rodete-desktop-imager.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180531082317.GA52285@rodete-desktop-imager.corp.google.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 31-05-18 17:23:17, Minchan Kim wrote: > On Thu, May 31, 2018 at 08:56:42AM +0200, Michal Hocko wrote: > > On Thu 31-05-18 15:01:33, Minchan Kim wrote: > > > On Wed, May 30, 2018 at 11:14:33AM -0700, Shakeel Butt wrote: > > > > On Tue, May 29, 2018 at 1:31 AM, Michal Hocko wrote: > > > > > On Mon 28-05-18 10:23:07, Shakeel Butt wrote: > > > > >> On Mon, May 28, 2018 at 2:11 AM, Michal Hocko wrote: > > > > >> Though is there a precedence where the broken feature is not fixed > > > > >> because an alternative is available? > > > > > > > > > > Well, I can see how breaking GFP_NOFAIL semantic is problematic, on the > > > > > other hand we keep saying that kmem accounting in v1 is hard usable and > > > > > strongly discourage people from using it. Sure we can add the code which > > > > > handles _this_ particular case but that wouldn't make the whole thing > > > > > more usable I strongly suspect. Maybe I am wrong and you can provide > > > > > some specific examples. Is GFP_NOFAIL that common to matter? > > > > > > > > > > In any case we should balance between the code maintainability here. > > > > > Adding more cruft into the allocator path is not free. > > > > > > > > > > > > > We do not use kmem limits internally and this is something I found > > > > through code inspection. If this patch is increasing the cost of code > > > > maintainability I am fine with dropping it but at least there should a > > > > comment saying that kmem limits are broken and no need fix. > > > > > > I agree. > > > > > > Even, I didn't know kmem is strongly discouraged until now. Then, > > > why is it enabled by default on cgroup v1? > > > > You have to set a non-zero limit to make it active IIRC. The code is > > Maybe, no. I didn't set anything. IOW, it was a default without any setting > and I hit this as you can remember. > http://lkml.kernel.org/r/<20180418022912.248417-1-minchan@kernel.org> > We don't need to allocate memory for stuff even maintainers discourage. Well, you can disable the whole kmem accounting by cgroup.memory=nokmem kernel parameter. I wasn't very happy when we removed the config option which would have put all the tracking aside even when no limit is set but the argument was that the ifdefery was growing into an unmaintainable mess and I have to agree with that. So here we are... -- Michal Hocko SUSE Labs