Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4536294ybv; Mon, 10 Feb 2020 21:59:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzZh9e//JouktY1YqkKfNQA8jQJQR0vBGNKcUB8hIo6nRqwAxbA9gxQ74qJXGw6eChpp+Xi X-Received: by 2002:aca:1a06:: with SMTP id a6mr1797593oia.148.1581400787955; Mon, 10 Feb 2020 21:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581400787; cv=none; d=google.com; s=arc-20160816; b=MnoEWEBB1q32UKMAbQAkZo3ROrQAsIOaU2efrMRQR7rDZBPXC4X494q/q8j9+sK22C KWMkWlaxPepoH5537cqQGGovHCv5RcfEP0GogMFrXqUXSEiY64QJEonsMC3NYdikThnk stzMlPHwebRn1SPxlJZ/t4N45qUZ2StxcLjZ0O9LyjnzCX9d+BZ9vl6scWR7SAjrcuaT BIsUDQbfupMmLHklkTCSYbvADl7LMeUDrAIy4YHqMWPbXiESQFw3WDAGdToOfM1HaECJ 9JjlgDyTYGdmRDnNDkx9C+FE51LmIYOGUQGGTw+YA22RIX2nqUOZt2+dKD+5Y30vTcOG dotw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=TZCo5+QEnBduPGo+spCOvK+p5C8UfqcCFSHu/lOvyzg=; b=XvPzlBNBjZ9KJsH+GgUgFs9lzocshNYm7YjZoJadPVmWFcNcu4bTVuBbX1jLd5sXaZ DbxLqTxwElEXuRUXvRh9H+MeKGzhcmLKWi5gcgABg0nohmPGtD8P8l/FRUTVUGEH5ZgL W6Rqr2NJoatVpSkDw1IdhcvCmeHkRuR0gYkDvvBEVQUPmSWMPm+P4/oRpM3G0tIaBy6A h+CC1/mNwJvIzr5erq4rO02W3tWMW/i87YtOsaFrIKVup1Z4c2/yJsYU5rLW7CBceWot s2c8C8C7dLtktdOLucH2XW5zRUA+5+x5NNsTf0zdx9/pSgJKG9p4yxkonzNwoYfQlN/1 FTBA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si1384796oti.219.2020.02.10.21.59.36; Mon, 10 Feb 2020 21:59:47 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbgBKFYc (ORCPT + 99 others); Tue, 11 Feb 2020 00:24:32 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:37366 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbgBKFYb (ORCPT ); Tue, 11 Feb 2020 00:24:31 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04396;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0TpeTAeD_1581398658; Received: from localhost(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TpeTAeD_1581398658) by smtp.aliyun-inc.com(127.0.0.1); Tue, 11 Feb 2020 13:24:29 +0800 From: Yang Shi To: akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mm: vmpressure: use mem_cgroup_is_root API Date: Tue, 11 Feb 2020 13:24:09 +0800 Message-Id: <1581398649-125989-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1581398649-125989-1-git-send-email-yang.shi@linux.alibaba.com> References: <1581398649-125989-1-git-send-email-yang.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use mem_cgroup_is_root() API to check if memcg is root memcg instead of open coding. Signed-off-by: Yang Shi --- mm/vmpressure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 0590f00..d69019f 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -280,7 +280,7 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree, enum vmpressure_levels level; /* For now, no users for root-level efficiency */ - if (!memcg || memcg == root_mem_cgroup) + if (!memcg || mem_cgroup_is_root(memcg)) return; spin_lock(&vmpr->sr_lock); -- 1.8.3.1