Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1686636rwb; Thu, 1 Dec 2022 22:54:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CLrArahce117TL6iCWwfug/BqmrKZopKSNlgLLraSslyYITBpqmkxrXQyIh+MuI/3Tyki X-Received: by 2002:a63:f406:0:b0:44b:89b6:3026 with SMTP id g6-20020a63f406000000b0044b89b63026mr46113728pgi.115.1669964068363; Thu, 01 Dec 2022 22:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669964068; cv=none; d=google.com; s=arc-20160816; b=SWh6vtZwr2Xq6JghMhP9Xzw1eCe4FYA8siccDlm1Wdc6UQzRZjfFunymg2LflKTL7n ZOZPeIqQKHerMO7tBtbIvJq+niLLj0KOjxvbl0K1GVUXI9txhhEh0KCjqTw22pAFyyyZ +bcLR32NYGFL2S9QiULtMwIZPpFzUPzVnO3wbAjGkI0GpO9MULVmJXBgkROxDlHnJRho ZDlYx6wkqAXSAFUEQsXZWJAyUjtEkTr3+vNyNFcmrbkAI42HtkTPeTIgvco6LSebPyAm ZVjv8EUIXxNxUGw3pMXxoGn2dHctMD6GqDXDzN3qsGWjaG12JzXbt4QlERYHP2vAzRkU wW4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Lgp97qMeqnklU11PAt73Gk9v38JU+bL88R62sYKL6NM=; b=r4DiHFrth//QDisq9yG72USaVc5G5NJg17lyk4ey1NiV6AeAuLFdDfaPW4xDfxwwdO RffUJjFapcaKY/dMY5nZYPGRs3GUskCFaPTSK8kvD/GhYdN/rnJRtS2dmcMZmyzPMdEn k/0y00uBHnb/l4iBm6gghtiANCB+aj6612iyhUbf0s5zcLEsfrmUkjAYgf3crooPYAj9 fbBRf+1SSQ8HIOWOzBkg8KD6LcIQ8tQiBC3Xv21Po8NOLOnmvWFS3z2H7afnY5Uhar9s qrXZfriPiOj7CeTowpmcYLlcN/jtRW4rNcNIGje/uzxhD9c9Ik/46XVRkC31v/7wyFPs hJyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a636ec8000000b00477632e6011si1515159pgc.308.2022.12.01.22.54.15; Thu, 01 Dec 2022 22:54:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232182AbiLBGFN convert rfc822-to-8bit (ORCPT + 83 others); Fri, 2 Dec 2022 01:05:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbiLBGFK (ORCPT ); Fri, 2 Dec 2022 01:05:10 -0500 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4299DC4FB; Thu, 1 Dec 2022 22:05:07 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: [RFC PATCH v2] mm: Add nodes= arg to memory.reclaim X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: Date: Fri, 2 Dec 2022 14:04:45 +0800 Cc: Shakeel Butt , Huang Ying , Yang Shi , Yosry Ahmed , Tim Chen , weixugc@google.com, gthelen@google.com, fvdl@google.com, Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , cgroups@vger.kernel.org, Linux Doc Mailing List , linux-kernel@vger.kernel.org, Linux Memory Management List Content-Transfer-Encoding: 8BIT Message-Id: References: <20221130020328.1009347-1-almasrymina@google.com> <20221201213202.ycdaymwojd5plyrk@google.com> To: Mina Almasry X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 2, 2022, at 06:10, Mina Almasry wrote: > > On Thu, Dec 1, 2022 at 1:32 PM Shakeel Butt wrote: >> >> On Tue, Nov 29, 2022 at 06:03:27PM -0800, Mina Almasry wrote: >> [...] >>> diff --git a/mm/vmscan.c b/mm/vmscan.c >>> index 7b8e8e43806b..23fc5b523764 100644 >>> --- a/mm/vmscan.c >>> +++ b/mm/vmscan.c >>> @@ -6735,7 +6735,8 @@ unsigned long mem_cgroup_shrink_node(struct mem_cgroup *memcg, >>> unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, >>> unsigned long nr_pages, >>> gfp_t gfp_mask, >>> - unsigned int reclaim_options) >>> + unsigned int reclaim_options, >>> + nodemask_t nodemask) >> >> Can you please make this parameter a nodemask_t* and pass NULL instead >> of NODE_MASK_ALL? > > Thank you very much for the review. I sure can in the next version. To > be honest I thought about that and made the parameter nodemask_t > because I thought the call sites would be more readable. I.e. this: > > try_to_free_mem_cgroup_pages(memcg, 1, GFP_KERNEL, > MEMCG_RECLAIM_MAY_SWAP, NODE_MASK_ALL); nodemask_t is an array, which can be large depending on CONFIG_NODES_SHIFT. I don't think passing a big array is an efficient way. So I agree with Shakeel. Thanks. > > Would be more readable than this: > > try_to_free_mem_cgroup_pages(memcg, 1, GFP_KERNEL, > MEMCG_RECLAIM_MAY_SWAP, NULL); > > But the tradeoff is that the callers need include/linux/nodemask.h. > But yes I can fix in the next version. >