From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65C52C433FE for ; Mon, 13 Sep 2021 12:12:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0071D610D2 for ; Mon, 13 Sep 2021 12:12:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0071D610D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 560086B0071; Mon, 13 Sep 2021 08:12:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50FE6900003; Mon, 13 Sep 2021 08:12:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FE81900002; Mon, 13 Sep 2021 08:12:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 32EFF6B0071 for ; Mon, 13 Sep 2021 08:12:41 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C3E0E20BFD for ; Mon, 13 Sep 2021 12:12:40 +0000 (UTC) X-FDA: 78582438480.20.E90D1FA Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf21.hostedemail.com (Postfix) with ESMTP id E1266D02D6D5 for ; Mon, 13 Sep 2021 12:12:39 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10105"; a="219779613" X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="219779613" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 05:12:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="543150497" Received: from shbuild999.sh.intel.com (HELO localhost) ([10.239.146.151]) by FMSMGA003.fm.intel.com with ESMTP; 13 Sep 2021 05:12:33 -0700 Date: Mon, 13 Sep 2021 20:12:33 +0800 From: Feng Tang To: Michal Hocko Cc: Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , Johannes Weiner , Mel Gorman , Vlastimil Babka , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/page_alloc: detect allocation forbidden by cpuset and bail out early Message-ID: <20210913121233.GD56674@shbuild999.sh.intel.com> References: <1631518709-42881-1-git-send-email-feng.tang@intel.com> <20210913113423.GC56674@shbuild999.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E1266D02D6D5 X-Stat-Signature: hc8wta1dgs7ough6jmt8mifu9kywb3jo Authentication-Results: imf21.hostedemail.com; dkim=none; spf=none (imf21.hostedemail.com: domain of feng.tang@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=feng.tang@intel.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none) X-HE-Tag: 1631535159-193918 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: On Mon, Sep 13, 2021 at 01:45:51PM +0200, Michal Hocko wrote: > On Mon 13-09-21 19:34:23, Feng Tang wrote: > > On Mon, Sep 13, 2021 at 11:15:54AM +0200, Michal Hocko wrote: > [...] > > > > +/* Whether the 'nodes' are all movable nodes */ > > > > +static inline bool movable_only_nodes(nodemask_t *nodes) > > > > +{ > > > > + struct zonelist *zonelist; > > > > + struct zoneref *z; > > > > + > > > > + zonelist = &(first_online_pgdat())->node_zonelists[ZONELIST_FALLBACK]; > > > > > > This will work but it just begs a question why you haven't chosen a node > > > from the given nodemask. So I believe it would be easier to read if you > > > did > > > zonelist = NODE_DATA(first_node(nodes))->node_zonelists[ZONELIST_FALLBACK] > > > > This was also my first try to get the 'zonelist', but from the > > update_nodemask(), the nodemask could be NULL. > > I guess you meant to say s@NULL@empty@ > While this complicates things a bit it is nothing really hard to work > around. You simply check for nodes_empty() and return false because such > a nodemask cannot by definition be movable only. Yes, a nodes_empty() check can solve it, thanks, - Feng > -- > Michal Hocko > SUSE Labs