From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f198.google.com (mail-wr0-f198.google.com [209.85.128.198]) by kanga.kvack.org (Postfix) with ESMTP id 4B1766B0038 for ; Mon, 20 Nov 2017 07:04:25 -0500 (EST) Received: by mail-wr0-f198.google.com with SMTP id d14so5911973wrg.15 for ; Mon, 20 Nov 2017 04:04:25 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id h20si1173653eda.203.2017.11.20.04.04.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 04:04:23 -0800 (PST) Date: Mon, 20 Nov 2017 13:04:22 +0100 From: Michal Hocko Subject: Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit Message-ID: <20171120120422.a6r4govoyxjbgp7w@dhcp22.suse.cz> References: <1510888199-5886-1-git-send-email-laoar.shao@gmail.com> <20171117155509.GA920@castle> <20171117164531.GA23745@castle> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Shakeel Butt Cc: Yafang Shao , Roman Gushchin , Andrew Morton , Johannes Weiner , Vladimir Davydov , Tejun Heo , khlebnikov@yandex-team.ru, mka@chromium.org, Hugh Dickins , Cgroups , Linux MM , LKML On Fri 17-11-17 09:49:54, Shakeel Butt wrote: > On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao wrote: [...] > > Of couse that is the best way. > > But we can not ensue all applications will do it. > > That's why I introduce a proper defalut value for them. > > > > I think we disagree on the how to get proper default value. Unless you > can restrict that all the memory allocated for a tmpfs mount will be > charged to a specific memcg, you should not just pick limit of the > memcg of the process mounting the tmpfs to set the default of tmpfs > mount. If you can restrict tmpfs charging to a specific memcg then the > limit of that memcg should be used to set the default of the tmpfs > mount. However this feature is not present in the upstream kernel at > the moment (We have this feature in our local kernel and I am planning > to upstream that). I think the whole problem is that containers pretend to be independent while they share a non-reclaimable resource. Fix this and you will not have a problem. I am afraid that the only real fix is to make tmpfs private per container instance and that is something you can easily achieve in the userspace. -- Michal Hocko SUSE Labs -- 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