Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1005786pxa; Wed, 19 Aug 2020 23:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRb915GA/b+gz+F646/26kLZ5bQeGFC8OqAGC+liL70CMQt4syFVj01HXQgrguOGBix200 X-Received: by 2002:a17:906:84e1:: with SMTP id zp1mr1628954ejb.499.1597904082062; Wed, 19 Aug 2020 23:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597904082; cv=none; d=google.com; s=arc-20160816; b=PInexq0GA9kGWg/ssgofMcl/XvYYQZZsYDWuvvoYQb/ycFCVzBPT1BW9bIOD6FyX2G oLW6UlY83G+hlcatotxqnpUtK2MnwkGtMjk429K/P3Biy2k1JLrnF+A4m6QRURk0XkX8 5dxKZDGqCI/s4OS737Y+QOmEDSVOmi2ivW5mwovtccILqavr2dAX9KEb5+ah4XVletkL nHzRyAjYZsfDSxzgnxqzUiDBkCVnlbeI7MxfxgF+1Tr09g3Vt+4FyyA5liUX+qPIrtnm hzzh3n4ZGHCP6H+ikftLkV3vZlJMHNP8N0G5nHFJ7OCFK1lL1ckUhxMsWK8Q5yZW5eu6 4Utw== 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=eltdH1huXadPrL/3u4jWBVOdxSgwTtW24831jUmLou0=; b=CxTjOoOCJE2gW3b4vhFeSzAjAn1engrVSAapwoGvgoZNnIGiLSSeMbElnz0x8AK6/y 9t4e1xPxA4BssTXwQ21nQJJ70piGDj52H6VUzHL3ioGilh+XUPH70R34L+l70LeUFkD0 DlelXAbhJ+yf6UY34FTCCzZj9JV6uW6azN7Zvf1kTYA95Smfj0lBAhrIsn55NUg9CYyI rEaSR5eoSJFlpIIdIE3V8WhuohA5TJH//gQX9nf5tJf+3BAHawtHKkUYhLk6Mlhn8gy6 msIKXRInJPosgmuHhuIMiRxOlDEwTrdiEuGTXyBlPzr03rs/fy2VXpvYpEwh0xb0mPyk 1uXA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si634573ejj.649.2020.08.19.23.14.17; Wed, 19 Aug 2020 23:14:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725823AbgHTGLh (ORCPT + 99 others); Thu, 20 Aug 2020 02:11:37 -0400 Received: from mail108.syd.optusnet.com.au ([211.29.132.59]:56276 "EHLO mail108.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbgHTGLh (ORCPT ); Thu, 20 Aug 2020 02:11:37 -0400 Received: from dread.disaster.area (pa49-181-146-199.pa.nsw.optusnet.com.au [49.181.146.199]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 47EDE1AACAD; Thu, 20 Aug 2020 16:11:13 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1k8dn6-00054g-GM; Thu, 20 Aug 2020 16:11:12 +1000 Date: Thu, 20 Aug 2020 16:11:12 +1000 From: Dave Chinner To: Matthew Wilcox Cc: peterz@infradead.org, Chris Down , Waiman Long , Andrew Morton , Johannes Weiner , Michal Hocko , Vladimir Davydov , Jonathan Corbet , Alexey Dobriyan , Ingo Molnar , Juri Lelli , Vincent Guittot , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH 0/8] memcg: Enable fine-grained per process memory control Message-ID: <20200820061112.GA7728@dread.disaster.area> References: <20200817140831.30260-1-longman@redhat.com> <20200818091453.GL2674@hirez.programming.kicks-ass.net> <20200818092737.GA148695@chrisdown.name> <20200818100444.GN2674@hirez.programming.kicks-ass.net> <20200818125559.GP17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200818125559.GP17456@casper.infradead.org> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=LPwYv6e9 c=1 sm=1 tr=0 cx=a_idp_d a=GorAHYkI+xOargNMzM6qxQ==:117 a=GorAHYkI+xOargNMzM6qxQ==:17 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=JfrnYn6hAAAA:8 a=VwQbUJbxAAAA:8 a=7-415B0cAAAA:8 a=cUD-o-zCZHVta4NZjWEA:9 a=CjuIK1q_8ugA:10 a=1CNFftbPRP8L7MoqJWF3:22 a=AjGcO6oz07-iQ99wixmX:22 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 01:55:59PM +0100, Matthew Wilcox wrote: > On Tue, Aug 18, 2020 at 12:04:44PM +0200, peterz@infradead.org wrote: > > On Tue, Aug 18, 2020 at 10:27:37AM +0100, Chris Down wrote: > > > peterz@infradead.org writes: > > > > On Mon, Aug 17, 2020 at 10:08:23AM -0400, Waiman Long wrote: > > > > > Memory controller can be used to control and limit the amount of > > > > > physical memory used by a task. When a limit is set in "memory.high" in > > > > > a v2 non-root memory cgroup, the memory controller will try to reclaim > > > > > memory if the limit has been exceeded. Normally, that will be enough > > > > > to keep the physical memory consumption of tasks in the memory cgroup > > > > > to be around or below the "memory.high" limit. > > > > > > > > > > Sometimes, memory reclaim may not be able to recover memory in a rate > > > > > that can catch up to the physical memory allocation rate. In this case, > > > > > the physical memory consumption will keep on increasing. > > > > > > > > Then slow down the allocator? That's what we do for dirty pages too, we > > > > slow down the dirtier when we run against the limits. > > > > > > We already do that since v5.4. I'm wondering whether Waiman's customer is > > > just running with a too-old kernel without 0e4b01df865 ("mm, memcg: throttle > > > allocators when failing reclaim over memory.high") backported. > > > > That commit is fundamentally broken, it doesn't guarantee anything. > > > > Please go read how the dirty throttling works (unless people wrecked > > that since..). > > Of course they did. > > https://lore.kernel.org/linux-mm/ce7975cd-6353-3f29-b52c-7a81b1d07caa@kernel.dk/ Different thing. That's memory reclaim throttling, not dirty page throttling. balance_dirty_pages() still works just fine as it does not look at device congestion. page cleaning rate is accounted in test_clear_page_writeback(), page dirtying rate is accounted directly in balance_dirty_pages(). That feedback loop has not been broken... And I compeltely agree with Peter here - the control theory we applied to the dirty throttling problem is still 100% valid and so the algorithm still just works all these years later. I've only been saying that allocation should use the same feedback model for reclaim throttling since ~2011... Cheers, Dave. -- Dave Chinner david@fromorbit.com