From patchwork Thu Mar 12 16:41:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Down X-Patchwork-Id: 11434869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED01292A for ; Thu, 12 Mar 2020 16:41:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B92FC20716 for ; Thu, 12 Mar 2020 16:41:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="t7xkgWzL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B92FC20716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ECCF56B0007; Thu, 12 Mar 2020 12:41:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E7D466B0008; Thu, 12 Mar 2020 12:41:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6CD86B000A; Thu, 12 Mar 2020 12:41:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id B8D7E6B0007 for ; Thu, 12 Mar 2020 12:41:40 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 58CBE5DED for ; Thu, 12 Mar 2020 16:41:40 +0000 (UTC) X-FDA: 76587276360.17.apple35_2b9e5aa06bb13 X-Spam-Summary: 2,0,0,62296fe10235e813,d41d8cd98f00b204,chris@chrisdown.name,,RULES_HIT:41:355:379:800:960:966:973:988:989:1260:1277:1312:1313:1314:1345:1431:1437:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:2898:3138:3139:3140:3141:3142:3352:3865:3866:3868:3872:3874:4321:4385:5007:6261:6653:10004:10400:10450:10455:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:13069:13161:13229:13311:13357:13439:13846:13895:14096:14097:14181:14394:14721:19904:19999:21080:21444:21451:21627:21740:30054:30064:30070,0,RBL:209.85.128.65:@chrisdown.name:.lbl8.mailshell.net-66.100.201.201 62.2.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: apple35_2b9e5aa06bb13 X-Filterd-Recvd-Size: 3647 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 16:41:39 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id 25so6841600wmk.3 for ; Thu, 12 Mar 2020 09:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=N2Uu/Isy7NWEK22NJk3FeLyFIU8DnOEsZiiSW7A75uw=; b=t7xkgWzL7lP8/guUn9rLcXqc2L/I8M4mdPLj2rg4UyMUaDhBh7A5BFsyNeuUrfj5Sy sZUf9YD87y994A6gKWXRpHFpH80VKHCF7N3X/4Pv5qvlLvmKlvIqQmk2yNsoJjceEcwr RTAWrygWaUxgm6QfhsJnWIPCeHwo+bWOupSI0= 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:mime-version :content-disposition; bh=N2Uu/Isy7NWEK22NJk3FeLyFIU8DnOEsZiiSW7A75uw=; b=n1bfRFqQwR0HoEZfBJDRMJcvgyaiaQF9shDDZ/bjHMRN44UKLZwMEa++0qqvTJRvuB hPMPiOL4yGK5qYcymskWblKoVsqX9n/6o6a2IF50i2X9vKjHGO3AvlaUjYVmqXge1Cud vfyA7kcUVEra7LyQMktSRVF+d/kQgFq9EzaRr1JOHYOoD4aGOo6QMxoqE/Fh+/Rw6cAE WNe5vBHbS8xhPm9GWxP4v/ChqLrz6FNU4e5gb5a48vG2217uHFQxghtCoL7i+F1dWU2B JdV2GQnzYVRDfHggfcOHzb6XQwBPPemQgU1HXafqVjPWOU3GfAxIXk7IStJgONvBMvgE JblA== X-Gm-Message-State: ANhLgQ3rKw3bN8/Y8t33spR4T7+AAdrAnMWuZbppbzL/FvNM2JEGVSVC O/jP95bjbQ+pKsx1b8IBmNdlIA== X-Google-Smtp-Source: ADFU+vvlNP+sTGWtwglGQNPghD1uV2b6E7MyhcfHEsjAve9zJzNS72Sz6SK5JO+Zicct59iWDQt/KQ== X-Received: by 2002:a1c:5585:: with SMTP id j127mr5652787wmb.35.1584031298224; Thu, 12 Mar 2020 09:41:38 -0700 (PDT) Received: from localhost ([89.32.122.5]) by smtp.gmail.com with ESMTPSA id m19sm12906711wmc.34.2020.03.12.09.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 09:41:37 -0700 (PDT) Date: Thu, 12 Mar 2020 16:41:37 +0000 From: Chris Down To: Andrew Morton Cc: Johannes Weiner , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] mm, memcg: Bypass high reclaim iteration for cgroup hierarchy root Message-ID: <20200312164137.GA1753625@chrisdown.name> MIME-Version: 1.0 Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Signed-off-by: Chris Down Cc: Andrew Morton Cc: Johannes Weiner Cc: Tejun Heo Cc: linux-mm@kvack.org Cc: cgroups@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: kernel-team@fb.com Acked-by: Johannes Weiner --- mm/memcontrol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 63bb6a2aab81..ab9d24a657b9 100644 --- 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)