Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1211043ybb; Wed, 1 Apr 2020 18:23:37 -0700 (PDT) X-Google-Smtp-Source: APiQypLo0FHnuXQQvSFcnNWtYGSoe6NijTeCpXUOEdNlRYIDHDcJyW6O2BWEVq+NIodhxYm8ZX65 X-Received: by 2002:a9d:837:: with SMTP id 52mr532994oty.354.1585790617771; Wed, 01 Apr 2020 18:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585790617; cv=none; d=google.com; s=arc-20160816; b=BbGr+TLB+/mWSiErkN1dlyO26nzEhAEIQFy9Xk2RO38B7ALvaYeOQsSt1ymVBVvHO7 U/2/NMs9g2sanQ3bjw3QrzJwA5/SyqS+WT+QEtbe4oiAnLJ1jyliXVOnTY1A+ypILP1D jNdnVnsPE3Se98rV42k5i6AZyn2ROkph2k+SeAdIRTbeOSuoz+b0Jk1pVqo9d+4ft4wv P6toTH34Z3ygKQie3xskZ2bmOokrQW7+RLrxfqMN+40OXN2lygiuDfnQjHWF1NxOH4B6 4+5LkQqRvmlZlQLIyYq25GSLrYfV8Bhf6LPGyNrvOGzRAxQz/Uz2Z5St5NqzZumlb/4v cDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=09pCsKKVAiCrwp30tkoGeROPApRrYyfp/DKFoOYEhw0=; b=VcG7VeOl9hGRnyH3v+yHhaCkpDQw4o03ZrnKWg5rKocKILjU3CgzDGVkf6HqiOWxEp Vvn9mgKMyby2QY9/SCUd5izJww4x4OJOYwufaUxt1aZ3QHwCQ7gUiPOs6V8vk0goJCZv aOoO5qx5gAc4Y2ltNXZOKiOAiztTW/cfbauAboUkngpkLe5RVRHF5NSmgw2izajuT+h6 qKMYNNPXVryIrhwBfsHmYVVM5S0S8rGjmsB4zxYWSaFPhXjwUcbNG1Dol8W/ashbo6bO fOMP+57fCH316OOTKALAJm/il/VAr5qHmHmcW6kas4b8IZYGDZrndrpxdO1K+0+5Eay6 cJkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M+kfbZ9U; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si1615448oig.34.2020.04.01.18.23.24; Wed, 01 Apr 2020 18:23:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=M+kfbZ9U; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732682AbgDBBXI (ORCPT + 99 others); Wed, 1 Apr 2020 21:23:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:49050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732462AbgDBBXI (ORCPT ); Wed, 1 Apr 2020 21:23:08 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BA5A20675; Thu, 2 Apr 2020 01:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585790587; bh=/XWfr8B2+Gdq9aBiaTze7oFSffBCOQXALgeP7OSUoQQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=M+kfbZ9UrQu3G+ELPmQ1UpQH6jzItlc6P2SWjstji9UaUSHoI42uhLz0GCrHwnyx/ ZwI8RIGgcPMexnOXuBDWj4+S+SxyZPVlNjjQ0mkCAeQ4t7v7YUjvLhrUdv5sSQOl4I vy4yB6xaC3seVhG8xKwbIV0+jkhCZBTUuL4EW8tc= Date: Wed, 1 Apr 2020 18:23:06 -0700 From: Andrew Morton To: Chris Down Cc: Johannes Weiner , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Michal Hocko Subject: Re: [PATCH] mm, memcg: Bypass high reclaim iteration for cgroup hierarchy root Message-Id: <20200401182306.724698b74692b5d31f66ad10@linux-foundation.org> In-Reply-To: <20200312164137.GA1753625@chrisdown.name> References: <20200312164137.GA1753625@chrisdown.name> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Mar 2020 16:41:37 +0000 Chris Down wrote: > The root of the hierarchy cannot have high set, so we will never reclaim > based on it. This makes that clearer and avoids another entry. > > ... > > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2232,7 +2232,8 @@ static void reclaim_high(struct mem_cgroup *memcg, > continue; > memcg_memory_event(memcg, MEMCG_HIGH); > try_to_free_mem_cgroup_pages(memcg, nr_pages, gfp_mask, true); > - } while ((memcg = parent_mem_cgroup(memcg))); > + } while ((memcg = parent_mem_cgroup(memcg)) && > + !mem_cgroup_is_root(memcg)); > } > > static void high_work_func(struct work_struct *work) Does someone have time to review this one? Thanks.