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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 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 AC0CEC432C0 for ; Fri, 22 Nov 2019 15:53:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6B4CF2071B for ; Fri, 22 Nov 2019 15:53:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="bMOmi7yg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B4CF2071B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F12736B0510; Fri, 22 Nov 2019 10:53:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EC38D6B0511; Fri, 22 Nov 2019 10:53:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD9C06B0512; Fri, 22 Nov 2019 10:53:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id C8D766B0510 for ; Fri, 22 Nov 2019 10:53:26 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 4A1A0181AEF2A for ; Fri, 22 Nov 2019 15:53:26 +0000 (UTC) X-FDA: 76184358012.16.drop67_dcd5bcf9e5e X-HE-Tag: drop67_dcd5bcf9e5e X-Filterd-Recvd-Size: 5802 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Nov 2019 15:53:25 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id y39so8352002qty.0 for ; Fri, 22 Nov 2019 07:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=GkZzui3E9R3KSyvipQDNYjoE7WRU9+0cmj9xVI1nge4=; b=bMOmi7ygSWmpbSxd0KtFQM18DSKQIWiDhQXCEWRVzL4ABA+tQ4p/noNyDwbyeZ7pYW /nyBWQS5gqF+TouRNoVIdFOyqMlsbpaGqnNdJJ4FeNta2eJdhG6vEAZ3dLikvY11PpGG My9zL0y6GgxmYbylX/Dfkqr+e1adRx++jyTSsP1J97qhavhjUNFqq+uynHc6eCuOLoxI /sEgg+vSw6PShFw89sKe8mZ3zfocz/Bb3qxBX1whZwTBAfc6aRRs8xlO+lt8KC6z8l1o GrIBblPQrr+pqA9AaTdu0oDn1rF6es5c/+TKWiT77Cvj+O0hmiYlClcTnAILhfe/eNq+ QPtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=GkZzui3E9R3KSyvipQDNYjoE7WRU9+0cmj9xVI1nge4=; b=nklQ+keUwHN+QMkA9lVIsfhH7aljRjKoHsDd6sTpdonAL5kmAH5lNSh7nLXBidCGod cpt1Pu5VwXW/RJ9MDFGRPKewvy2DqcKE9rFl0RlrsevAR7MaqDh1TlzOgOz6TAvwlBcW zezCYpiAKSegexmuDoKnhAefMiIguvXGCs4mwA/A50aKgw7Zfh32msHtnXVQWtz3SD2j xrrZv3hqn43X4ksNjiFu8s5opxf0nmP5DqGc/gd7oQTSnSGoyuSXLUo/LN74gPYEAl3q 8V/wRRgzSGRRmguStKxKumMRDcxr+lAzV3SG3ozpgX9+K/aFytSsaMUai6voMCIOGJkt vxgw== X-Gm-Message-State: APjAAAXVEe3VASML2rFbUvV8py0Y1pNKkewaCgHavskqQQWQxopl2kY5 VJ/TTiAN+dLpWYOS0S/i5l15uw== X-Google-Smtp-Source: APXvYqz4nUTeANeIQEGSerWAMv7XxTLPv6XFuTte7s/zwHjmvMG890BYNrElq2UiAZfiDt/guQ3u0w== X-Received: by 2002:ac8:2f54:: with SMTP id k20mr879767qta.235.1574438005031; Fri, 22 Nov 2019 07:53:25 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id d13sm3609264qta.67.2019.11.22.07.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2019 07:53:24 -0800 (PST) Message-ID: <1574438002.9585.24.camel@lca.pw> Subject: Re: [RFC v1 00/19] Modify zonelist to nodelist v1 From: Qian Cai To: Pengfei Li , "lixinhai.lxh@gmail.com" Cc: akpm , mgorman , Michal Hocko , Vlastimil Babka , cl , "iamjoonsoo.kim" , guro , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Date: Fri, 22 Nov 2019 10:53:22 -0500 In-Reply-To: <20191122232847.3ad94414.fly@kernel.page> References: <20191121151811.49742-1-fly@kernel.page> <2019112215245905276118@gmail.com> <20191122232847.3ad94414.fly@kernel.page> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Fri, 2019-11-22 at 23:28 +0800, Pengfei Li wrote: > On Fri, 22 Nov 2019 15:25:00 +0800 > "lixinhai.lxh@gmail.com" wrote: >=20 > > On 2019-11-21=C2=A0at 23:17=C2=A0Pengfei Li=C2=A0wrote: > > > Motivation > > > ---------- > > > Currently if we want to iterate through all the nodes we have to > > > traverse all the zones from the zonelist. > > >=20 > > > So in order to reduce the number of loops required to traverse node= , > > > this series of patches modified the zonelist to nodelist. > > >=20 > > > Two new macros have been introduced: > > > 1) for_each_node_nlist > > > 2) for_each_node_nlist_nodemask > > >=20 > > >=20 > > > Benefit > > > ------- > > > 1. For a NUMA system with N nodes, each node has M zones, the numbe= r > > > =C2=A0=C2=A0 of loops is reduced from N*M times to N times when tra= versing > > > node. > > >=20 > >=20 > > It looks to me that we don't really have system which has N nodes and= =20 > > each node with=C2=A0M zones in its address range.=C2=A0 > > We may have systems which has several nodes, but only the first node > > has all zone types, other nodes only have NORMAL zone. (Evenly > > distribute the !NORMAL zones on all nodes is not reasonable, as those > > zones have limited size) > > So iterate over zones to reach nodes should at N level, not M*N level= . > >=20 >=20 > Thanks for your comments. >=20 > In the case you said, the number of loops required to traverse all > nodes is similar to traversing all zones. >=20 > I have two main reasons to explain that this series of patches is > beneficial. >=20 > 1. When node has more than one zone, it will take fewer cycles to > traverse all nodes. (for example, ZONE_MOVABLE?) ZONE_MOVABLE is broken for ages (non-movable allocations are there all th= e time last time I tried) which indicates there is very few people care about it= , so it is rather weak to use that as a justification for the churns it might cau= se. >=20 > 2. Using zonelist to traverse all nodes is inefficient, pgdat must be > obtained indirectly via zone->zone_pgdat, and additional judgment must > be made. >=20 > E.g > 1) Using zonelist to traverse all nodes >=20 > last_pgdat =3D NULL;=09 > for_each_zone_zonelist(zone, xxx) { > pgdat =3D zone->zone_pgdat; > if (pgdat =3D=3D last_pgdat) > continue; >=20 > last_pgdat =3D pgdat; > do_something(pgdat); > } >=20 > 2) Using nodelist to traverse all nodes >=20 > for_each_node_nodelist(node, xxx) { > do_something(NODE_INFO(node)); > } >=20