Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1441519ybk; Thu, 21 May 2020 07:01:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq0Kgpz92M1PXTA3afAbuZSmlDAe3ofdgrrDeyZRkBRaD2g9O5cIXgzwe6FvZBo7mfOZfv X-Received: by 2002:a17:906:1b0c:: with SMTP id o12mr3585428ejg.27.1590069701453; Thu, 21 May 2020 07:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590069701; cv=none; d=google.com; s=arc-20160816; b=zhYvyPxbA43MuuwJ+YyT9j7T4EtBX8ZdX2zEnpBNdnvzm+F5eecSMhjo8gHxh0KPAE KHu2ILZzeawwIkptnnk3NdIPIDUfaWNpqRyRgQ3iCebp13Dv7HMR1yN8xQV5SaXPtVnL 4Y4PQ16agxUitUQ+N4fFMOgk1IlyxDWVuebGEEyCXR15dlGMCHYsdndHhLRrv7jzauHm WcXpIgw8TLu2VCfQFmeR9qW8fz4WfLotw3T96bHU3+flp1HQva5iwIlmFdwcbu8ChSzs KWOe1OJT3r5p6JpwGvqBlx2svsuwrUmgKd/UWNQmdFUuFHNi9sYRI5AaHyPCdJK5Q5SB VIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ddLwWOZufRU83kRzWZ3D0JojQ9PBPAMnKhIGdw1eqxU=; b=saPeF1RXsM5CmFfTF1B2N7ydhkQG1Q0xg/aW0QPi8eRvjqLQYEbK6yvS50fuXwZEMs kLoVx/16ulT2N29caAgtyoCCCDPkhln/csjTrW4mezia3IDkdMiaSvrgu+aWZY+F80yn +al5SoMnP70zePeDNOxCwAUaXKVce6ttBu4M5AZpNaj2csNJR7xwDj/Z/ecHBVczd6Tn 75xlhnPHb/TBphCVRzB+MyQr9QyuuZ2scM+J0zTR8hFYVJXNQGXMhI/iVY15zqIKvFTQ Z8w5Re6zhWqiRLr8y3+J/cp8kczDT6UUbTF7z6KHvizZrjkyEZT3ENUFx8c71G/4AlfE Fkhg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq16si3602788ejb.322.2020.05.21.07.01.15; Thu, 21 May 2020 07:01:41 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729648AbgEUN6n (ORCPT + 99 others); Thu, 21 May 2020 09:58:43 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:46745 "EHLO mail-ej1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbgEUN6n (ORCPT ); Thu, 21 May 2020 09:58:43 -0400 Received: by mail-ej1-f67.google.com with SMTP id e2so8868439eje.13; Thu, 21 May 2020 06:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ddLwWOZufRU83kRzWZ3D0JojQ9PBPAMnKhIGdw1eqxU=; b=WbOXbFCSWjft7Ng2ADu2WKBfjERG2CTA2/jRwV6A9zNf1awDiMrYI/S1Oug27a7/bj /7J0Q+mFp3zjpZzoESJDZDY6MJTAqNI/fjlLl8fwHsb+izk42rGysQBqskhlF83KQPbd khDp9Tnei59SJxQ+qE93pupcWqdgCQWcSHVbSs0Ao8GnTyGE6evGa77V2WuxzWa1GN0Z CIGybn05+6aRQhXGRdIhJB04AF6x0kGpIDqbLsKsxMBv1uHL8b2lnvDEd/RqGDLNVnsw juYYzo7W1u8GQjYnDiorrIGRLB7TpEsKsaojW8B9+QtcT8oKyjxRNlnYU9vucelbgK/l tmWw== X-Gm-Message-State: AOAM533YmapjcbEp0GRJj5h5/Hu56Kmuma8P2EWqWgm1VEj9+ZOVNODa Fg01e8ZcGktHl1cr/jrWTkdSDyHh X-Received: by 2002:a17:906:6951:: with SMTP id c17mr3607034ejs.112.1590069521064; Thu, 21 May 2020 06:58:41 -0700 (PDT) Received: from localhost (ip-37-188-180-112.eurotel.cz. [37.188.180.112]) by smtp.gmail.com with ESMTPSA id c7sm4755917edj.54.2020.05.21.06.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 06:58:40 -0700 (PDT) Date: Thu, 21 May 2020 15:58:38 +0200 From: Michal Hocko To: Chris Down Cc: Andrew Morton , Johannes Weiner , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling Message-ID: <20200521135838.GT6462@dhcp22.suse.cz> References: <20200520160756.GE6462@dhcp22.suse.cz> <20200520202650.GB558281@chrisdown.name> <20200521071929.GH6462@dhcp22.suse.cz> <20200521112711.GA990580@chrisdown.name> <20200521120455.GM6462@dhcp22.suse.cz> <20200521122327.GB990580@chrisdown.name> <20200521123742.GO6462@dhcp22.suse.cz> <20200521125759.GD990580@chrisdown.name> <20200521132120.GR6462@dhcp22.suse.cz> <20200521133324.GF990580@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521133324.GF990580@chrisdown.name> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 21-05-20 14:41:47, Chris Down wrote: > Michal Hocko writes: > > On Thu 21-05-20 13:57:59, Chris Down wrote: [...] > > > If you're talking about reclaim, trying to reason about whether the overage > > > is the result of some other task in this cgroup or the task that's > > > allocating right now is something that we already know doesn't work well > > > (eg. global OOM). > > > > I am not sure I follow you here. > > Let me rephrase: your statement is that it's not desirable "that some task > would be throttled unexpectedly too long because of [the activity of another > task also within that cgroup]" (let me know if that's not what you meant). > But trying to avoid that requires knowing which activity abstractly > instigates this entire mess in the first place, which we have nowhere near > enough context to determine. Yeah, if we want to be really precise then you are right, nothing like that is really feasible for the reclaim. Reclaiming 1 page might be much more expensive than 100 pages because LRU order doesn't reflect the cost of the reclaim at all. What, I believe, we want is a best effort, really. If the reclaim target is somehow bound to the requested amount of memory then we can at least say that more memory hungry consumers are reclaiming more. Which is something people can wrap their head around much easier than a free competition on the reclaim with some hard to predict losers who do all the work and some lucky ones which just happen to avoid throttling by a better timing. Really think of the direct reclaim and how the unfairness suck there. -- Michal Hocko SUSE Labs