Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1677835pxj; Fri, 18 Jun 2021 12:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiKBfw6/o9ylEvDGNCGeE0fMUkkOENd7RblaINwwClttdLNouKo9jjRMBPaJ4SMJTZfM8i X-Received: by 2002:a05:6402:31a9:: with SMTP id dj9mr7119475edb.164.1624044284780; Fri, 18 Jun 2021 12:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624044284; cv=none; d=google.com; s=arc-20160816; b=fOxl3scxHQ7N2fFUnqbTkVuXs14aUnAaN34MqOZn5SHHpj2aC+fzo+EFXbib3U1CAm +owzJ4gFiWiDycs/ZGEGUdkyJ31AqLZUL4r67bRnSbOIAAw2cGrxCemY1oooO6EijRe6 hrswJoY/m08UQKmSjNCVMB0POryqdfk7Jnv733K1v6V7khMemORgfC9DufgugHfrQnJl d1eE+54bCwVTq9/E1gZGNBFdS2dEHmz7yGPO9y0y2QnuxjGtZB+JIRIPYPqg4QWVgHGc LGq5DvyLKKHWnurSMi0nbOB+bLkmXMf9bKxMSGisCX3oBMRh7t2MIOHpIDv5JXCfjEBI 0QcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LHiaEznjsNUF4rAZuGixsJoeW9b4ApvWTouIw4rKRH4=; b=bfYKZdj62cfdjw71HIRefYRtVDt0zX7KME8J+lgp1oUxsWQsUetlCi51iQNukPKRx3 Zzgbqn7WgGiaKW1utDauA6NVvL93Hd9lhugIkKUO0E4r/fgu7R798mWvHDli8XbjjL3T ONFOQvOUfMQCEGIBat1hFYLL2//cLoDegiXHUEqip+xmMN+rB9VKXYotANkn1pQasOZf 9ZO9H9s8atXZMGDme1xI7oBn/DyB/QLNYP6dvzywQfsg3GIv3JLm+0TzJvKjvgE7pvSd S5aF+v3ykFU37wg0GOqfO16kCnRgTM5E6BUQJj6Fr/9wJYWR65uzuZPCWW0BuiZDhNpT ai2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tgHGhNEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si9317193edq.570.2021.06.18.12.24.21; Fri, 18 Jun 2021 12:24:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tgHGhNEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233996AbhFRRGM (ORCPT + 99 others); Fri, 18 Jun 2021 13:06:12 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:34876 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233581AbhFRRGL (ORCPT ); Fri, 18 Jun 2021 13:06:11 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8F91D21B30; Fri, 18 Jun 2021 17:04:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1624035840; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LHiaEznjsNUF4rAZuGixsJoeW9b4ApvWTouIw4rKRH4=; b=tgHGhNEKrHZIfPRywKhTgPlChh7xLffPyPR5uJQIyb2HBLC33ASKcSFidv7iUXQuxGLrdO QdOiHPnVfrHBtcaU5QDujIs7RYUaN384TX7ibRbgCaNtSFWkCsF/3uDa9b3b5Fcwl+Y/mS XOpL0ncJouDsLGkucN3EQci1LHh56bs= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 4EB9CA3BCE; Fri, 18 Jun 2021 17:04:00 +0000 (UTC) Date: Fri, 18 Jun 2021 19:03:59 +0200 From: Michal Hocko To: "Eric W. Biederman" Cc: Shakeel Butt , Alexey Gladkov , Christian Brauner , LKML , Linux Containers , Linux Containers , Linux FS Devel , Linux MM , Andrew Morton , Johannes Weiner , Chris Down , Cgroups Subject: Re: [PATCH v1] proc: Implement /proc/self/meminfo Message-ID: References: <20210615113222.edzkaqfvrris4nth@wittgenstein> <20210615124715.nzd5we5tl7xc2n2p@example.org> <87zgvpg4wt.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zgvpg4wt.fsf@disp2133> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 16-06-21 11:17:38, Eric W. Biederman wrote: [...] > MemAvailable seems to have a good definition. Roughly the amount of > memory that can be allocated without triggering swapping. Updated > to include not trigger memory cgroup based swapping and I sounds good. yes this definition is at least understandable but how do you want to define it in the memcg scope? There are two different source of memory pressure when dealing with memcgs. Internal one when a limit is hit and and external when the source of the reclaim comes from higher the hierarchy (including the global memory pressure). The former one would be quite easy to mimic with the global semantic but the later will get much more complex very quickly - a) you would need a snapshot of the whole cgroup tree and evaluate it against the global memory state b) you would have to consider memory reclaim protection c) the external memory pressure is distributed proportionaly to the size most of the time which is yet another complication. And more other challenges that have been already discussed. That being said, this might be possible to implement but I am not really sure this is viable and I strongly suspect that it will get unreliable in many situations in context of "how much you can allocate without swapping". -- Michal Hocko SUSE Labs