Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp464540pxb; Tue, 14 Sep 2021 01:20:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNwjBxUs4f8MjTFdT+gAwbSaoVTKiIq9CaszKPoeXkhKLn/FeHcgbEiUkbCmlgst1aysEn X-Received: by 2002:a05:6402:51d2:: with SMTP id r18mr10629931edd.108.1631607640106; Tue, 14 Sep 2021 01:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631607640; cv=none; d=google.com; s=arc-20160816; b=lbX426duYzu75NcHCG0br9wIQLj33Gwsfu+MeOm38rT1eYQwD9AH+WxQq+peFWuxYq 2EXePp2pegX1FiUpY5uBgn9CJtOKI7NA+QZQWpa+vPHfcktMnbsUAeGPFq8Buq0C4TuD d34oQz/ns2+yKsUVdjTF60eTitxb+f333GVgVZ2b2pWmbAD1CGpsvzHGLrwZ+o152OXU +8fxysrXTxRbSrR5klCKEOXKz+GmnxSd2WZ5auvT28pZewCSTyNT54U/bOndFeJprItU I9Q5CXA4yGYw+x00C9cOsX+ZYcNxk5uViK4ILWf3ra/oL5y+OlocK4Is/X48krxFed+m pqCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FmdG8PcnuIQuqHtdoYXiNJLHdhDIQt4J2A8/AC35I5c=; b=NaTMNhwp/2OP1+KWMUrmaz461VjKzsjCD18/UixzTR8tRFrJuYqjkUtu3ZjlZ1xPUk Ke1jjv2sLJeAwx6X0GGRl/Nz/7/3d1v/URmEiCDi4Typ9HZpC+x4LUazzBdVhDo0kxtS QX0XyotwpQlznb0JtNtBK6LjwnSf9G0n9jHz3uCx2ypvUl02GyQ3idqppyVuytd06OYh j4wZlYyJVofUQ+FNNq4R5pGPIe0kEhJ0xtwf3MT32ZKeyDXpSO07MrHIco4t2F6sRLuO VcqWaaa0cP2WwtzY96ALO7PezvFAgG1zbhZvvWg6bs72oytb6zf1cdhP240qOMBaBwax jq0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IEJQ2TEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si12678900eje.410.2021.09.14.01.20.16; Tue, 14 Sep 2021 01:20:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IEJQ2TEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230283AbhINIT0 (ORCPT + 99 others); Tue, 14 Sep 2021 04:19:26 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:59132 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbhINITN (ORCPT ); Tue, 14 Sep 2021 04:19:13 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 33098200DA; Tue, 14 Sep 2021 08:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631607473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FmdG8PcnuIQuqHtdoYXiNJLHdhDIQt4J2A8/AC35I5c=; b=IEJQ2TEznajvCNl1nH6A7iIwCu5Yz2J4O6kJpMm04Zzijue7NO/Y3POHnHOX/b/kVKP4jV J+NBflkpoVjrX5prgNDVxIDkMc5fP1DKHCuipbUuWPRYs87/FbhXcV/LjmatEWuDCKSPaZ sC94sWIZJ7yhH2Qaf8zqyF2fSfFK1d4= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 94D58A3B88; Tue, 14 Sep 2021 08:17:52 +0000 (UTC) Date: Tue, 14 Sep 2021 10:17:52 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Feng Tang , Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , Johannes Weiner , Mel Gorman , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/page_alloc: detect allocation forbidden by cpuset and bail out early Message-ID: References: <1631590828-25565-1-git-send-email-feng.tang@intel.com> <24d89efa-502f-e31a-5d45-536352485bbb@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24d89efa-502f-e31a-5d45-536352485bbb@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 14-09-21 10:01:26, Vlastimil Babka wrote: > On 9/14/21 05:40, Feng Tang wrote: [...] > > +/* Whether the 'nodes' are all movable nodes */ > > +static inline bool movable_only_nodes(nodemask_t *nodes) > > +{ > > + struct zonelist *zonelist; > > + struct zoneref *z; > > + > > + if (nodes_empty(*nodes)) > > + return false; > > + > > + zonelist = > > + &NODE_DATA(first_node(*nodes))->node_zonelists[ZONELIST_FALLBACK]; > > + z = first_zones_zonelist(zonelist, ZONE_NORMAL, nodes); > > + return (!z->zone) ? true : false; > > +} > > Hmm, could all that become just this? > > !nodes_intersects(&node_states[N_NORMAL_MEMORY], nodes) Maybe yes but I find the zonelist approach much easier to follow even though the code looks more complex at first sight. It talks about an empty zone list for ZONE_NORMAL request which is quite clear from the scribble. I always have to re-learn how the N*MEMORY works TBH. Maybe this is just me though. -- Michal Hocko SUSE Labs