Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp711793ybh; Thu, 12 Mar 2020 09:42:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuqU93pM8xhWFFyxmjqQbpPRJ2LNd3uVQ/Tngn+Hw9IcciJSjOIW4+t+ESFU2420aX9e88E X-Received: by 2002:a9d:22:: with SMTP id 31mr6665386ota.173.1584031357384; Thu, 12 Mar 2020 09:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584031357; cv=none; d=google.com; s=arc-20160816; b=c+xKdS1GagW54tBJv0oGa8/TM+pJtAkTrOgjXpE990oIs7ytPWXoAYbm+ab0eAGSlA dNCKZmwxWJuvsdxK3IkKUqR4jNZOeL9npypsKiE91LaXDPqqLX3ivnISYAjlnoM187xk bKSu2obExHmWr1xUJ0iQNEMO/LOupz8dIO2mW/6VAaYUd74uYd1ShqNFcQFej4YuhdRc 8y+mbuQJohdeyconD04i1NmwK81PbkpsjG3eUNtnu4GimkeNGcd9HSzcifEBv4ojn8sW ttP5fEQAQB4is55fb7ICRgPlXCw9C1qErlKCHwsmxl+IoW5NdX7U7/mmKBwD7wMEI1gm WWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=N2Uu/Isy7NWEK22NJk3FeLyFIU8DnOEsZiiSW7A75uw=; b=PVdaedBr9juInJ35uyO8CTyos2s8ykapskoWAg9SlTFz2Zk4d+robyDWIAH5oOHmh2 YZewAd7vXiQam/8U+Gs1wYim3LPDctQZ1tSCtanHVJjHyvUHJlUJYusgnrJIMCDe+0Z/ vgnZNpiW0WfjRdxGao1HqRRj8Drd+kfYSleq7htlEgHyswasAsswtwsHwNuvIzRahBut 9/ocZRAxr+5lkoteTI+deENemXYHKSDBL2Hfqwg+RSrfSPTQAPLIh4A8zwZ1zMlbDShJ zkragOkT4R0V9tiOp/gwbJQBfk8fU8vVopDi3mBX1rVGUGwF0s2yxamwibid/4bCXhTf XiSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=t7xkgWzL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si3126482otn.318.2020.03.12.09.42.24; Thu, 12 Mar 2020 09:42: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=@chrisdown.name header.s=google header.b=t7xkgWzL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbgCLQlk (ORCPT + 99 others); Thu, 12 Mar 2020 12:41:40 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39656 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgCLQlk (ORCPT ); Thu, 12 Mar 2020 12:41:40 -0400 Received: by mail-wm1-f66.google.com with SMTP id f7so7102893wml.4 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=LW/m+d4mqzQhUQ2/dxFob0fou+FoXe9Aj58jvffIZVNbLFhhxkzFErekIxB/FYWuoj nfu6M2a0vWp5F0Mh56NCRiqG/dLCJ7zi3KtXfB9QyoYqobriVQn1jM2fSnCSXwnU8v4g 1+bH3Hh3bZK5W6H0vA+hPVi8wErozzB6jN3OI/PGC6YuzJVGvSG+9XqYtY5193YKDy6i K+U0WS0rc98sk3TWYjBDfRRGnOP7yKyYcdL3nQZafhOqhI3T6PauVpPUjETLUcVXuvdo cp+3+joc39niAMJphP+QxT6t8a4qjpy/FBAcwuLWXicur9PhoqLU+NdoNEW5olPeh/ns 8NCQ== X-Gm-Message-State: ANhLgQ2IL+jhYEmEjJBZM3/+pwER0viSb2gS6CdpqRb4cbfguUxpPsM6 aHvcsTFd83poQDd56aZ3X9qo0Q== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) -- 2.25.1