From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402413; cv=none; d=zoho.com; s=zohoarc; b=BhcLQox9WtsEhegCBy5n+mdrPZEqW7XkaiZtWnOswosvtiYHGXr23l/7RqcPRB7MMMTTR5KhC9RB5sgoLHfU++/UK6NOvRyiWl9qOBs6l1hxUdSJiqpjpx2Jmljj9b4C66ZCX/eDa9zaLQmEEv3h9We7kgP5fVH8t3e4Ym7fOIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402413; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nGsEt3/gwOdp0o55pbuiv76ZXRH1xQZny6M1rSCfwQE=; b=XFvoq8ZUyTXpZZR5Efg8ZpsFoDARNQ5b4SDDrcVZhk67LgAvX9nFG6zYcsFLDRuKaYgwFNJgmkrKAHRXr78/+POo+JVGM3swPFCX1q4gO4ATKWaEB0GuhvugAQghqDKEHTfwo2eJoVRU2zhxC5p4f8aAZNjBPSCTUFQiPmjQifg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402413646282.3773957501479; Mon, 29 Jul 2019 05:13:33 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vf-0006c2-U8; Mon, 29 Jul 2019 12:12:11 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Ve-0006bl-PC for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:10 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 16772d31-b1fa-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 12:12:09 +0000 (UTC) X-Inumbo-ID: 16772d31-b1fa-11e9-8980-bc764e045a96 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: aq2XepDnFyMLnK9OtWXd6SgrQQAcA/e+Cw3RfAxXnxYoNAVf9Ib/mcXkpBpY04FaTAisXmYPfS Qg9d8HoLWcCiCqHhiv4nFsIGwSyowaNbvK07yvZduz2yHEu0bs21xjsRU/ccHfbs2P6Rcxittp Ov2KqvUhFUr2B4x5iAQ24+fFuvu9eg+RqYHXlChhJvBZyPypolgO/XIr6j7EmLqsxCvjuqYejW oz6IEz+kUxnyMXBcTbZ82tXuKGs9tUoGHXE1wNCjQMZq9vTHlCKyMEUNDP3ZNbmd0yMLt2AtYX 1K4= X-SBRS: 2.7 X-MesageID: 3672658 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672658" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:11:55 +0100 Message-ID: <20190729121204.13559-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 01/10] page-alloc: Clamp get_free_buddy() to online nodes X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" d->node_affinity defaults to NODE_MASK_ALL which has bits set outside of node_online_map. This in turn causes the loop in get_free_buddy() to waste effort iterating over offline nodes. Always clamp d->node_affinity to node_online_map when in use. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: George Dunlap v3: * Rebase to before the nodemask API cleanup, to make it easier to backport. v2: * Rebase over the nodemask API change, and implement with a single nodes_and() --- xen/common/page_alloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 44a72d0b19..efa437c7df 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -811,11 +811,18 @@ static struct page_info *get_free_buddy(unsigned int = zone_lo, const struct domain *d) { nodeid_t first, node =3D MEMF_get_node(memflags), req_node =3D node; - nodemask_t nodemask =3D d ? d->node_affinity : node_online_map; + nodemask_t nodemask =3D node_online_map; unsigned int j, zone, nodemask_retry =3D 0; struct page_info *pg; bool use_unscrubbed =3D (memflags & MEMF_no_scrub); =20 + /* + * d->node_affinity is our preferred allocation set if provided, but it + * may have bit set outside of node_online_map. Clamp it. + */ + if ( d ) + nodes_and(nodemask, nodemask, d->node_affinity); + if ( node =3D=3D NUMA_NO_NODE ) { if ( d !=3D NULL ) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402407; cv=none; d=zoho.com; s=zohoarc; b=NuVJ3vMm4Cz9eaFQzfkvKrgN1HH8+J+MjrHmF8RgV/ZDgNTrNza3uA0ACAAUJ+aJUhBoNTj4IkXQwuUY5WmQEywGVvkws9EK7Sy43oUIXHK8CkTiIGHYrmdPnfc+eTugfDEw36lsuIRKFWw6RNFaC+t2s56HWxpMP7QuQmFu/VA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402407; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=EKu1PvSgKJcIiM3F0ebXGIoIOjIp1j1WzoorgpVtJQ4=; b=D0zSjt2L2Vt7QDTkfJeLleSJgrDAykvfunupsOwlLdmLxt/kNFRP63KA4NYDovxYIE6QR6/Vi65H7cB6C4AsxjCwicPBwmq5qgWMei3vDePnWkDHBxRQEMhfKAb8yOR8sukfbF+LnNQEFkrpBj67ndLdR4AQA3Cd8Qr1BgySDRk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402407797211.9443083912746; Mon, 29 Jul 2019 05:13:27 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vi-0006dZ-2w; Mon, 29 Jul 2019 12:12:14 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vh-0006cg-1W for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:13 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 17b824e4-b1fa-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 12:12:10 +0000 (UTC) X-Inumbo-ID: 17b824e4-b1fa-11e9-8980-bc764e045a96 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: rXCzYAjwYizDDTkz6FnzAG/UCfIsAm3iRY9iWj+g0iXQnTkp2dtZoQ5PGxZqpxYbdH1yOjpQNN 8zw/JT1wErd+RpwZbkspNiXdf7JArMzEhlwUwsTg7onpzfAGHXEIhNkNR+YLqz4x2robemVN0e ZjXt0fC55KAHI0wKjUFnLh3phmP2IKmuyJ7wuvDrtOZJ+T8P9JR7FNb5IKeO0n3h2s6Ekwx2z3 3hsvhe6hQmk8cNYvMhBrzhYBYGBU1YCkX+akSKP/DCB547cm8WzgDsC1JYG8aE4lG+wAcPq7+W g20= X-SBRS: 2.7 X-MesageID: 3672663 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672663" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:11:56 +0100 Message-ID: <20190729121204.13559-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 02/10] xen/bitmap: Drop {bitmap, cpumask, nodes}_shift_{left, right}() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" These operations have never been used in Xen since their introduction, and = it doesn't seem likely that they will in the future. Bloat-o-meter reports that they aren't the smalled when compiled, either. add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-814 (-814) Function old new delta __bitmap_shift_left 366 - -366 __bitmap_shift_right 448 - -448 Total: Before=3D3323730, After=3D3322916, chg -0.02% Suggested-by: Jan Beulich Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/common/bitmap.c | 88 ------------------------------------------= ---- xen/include/xen/bitmap.h | 22 ------------ xen/include/xen/cpumask.h | 15 -------- xen/include/xen/nodemask.h | 19 ---------- 4 files changed, 144 deletions(-) diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c index 34de387880..fd070bee97 100644 --- a/xen/common/bitmap.c +++ b/xen/common/bitmap.c @@ -109,94 +109,6 @@ void __bitmap_complement(unsigned long *dst, const uns= igned long *src, int bits) } EXPORT_SYMBOL(__bitmap_complement); =20 -/* - * __bitmap_shift_right - logical right shift of the bits in a bitmap - * @dst - destination bitmap - * @src - source bitmap - * @nbits - shift by this many bits - * @bits - bitmap size, in bits - * - * Shifting right (dividing) means moving bits in the MS -> LS bit - * direction. Zeros are fed into the vacated MS positions and the - * LS bits shifted off the bottom are lost. - */ -void __bitmap_shift_right(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k, lim =3D BITS_TO_LONGS(bits), left =3D bits % BITS_PER_LONG; - int off =3D shift/BITS_PER_LONG, rem =3D shift % BITS_PER_LONG; - unsigned long mask =3D (1UL << left) - 1; - for (k =3D 0; off + k < lim; ++k) { - unsigned long upper, lower; - - /* - * If shift is not word aligned, take lower rem bits of - * word above and make them the top rem bits of result. - */ - if (!rem || off + k + 1 >=3D lim) - upper =3D 0; - else { - upper =3D src[off + k + 1]; - if (off + k + 1 =3D=3D lim - 1 && left) - upper &=3D mask; - } - lower =3D src[off + k]; - if (left && off + k =3D=3D lim - 1) - lower &=3D mask; - dst[k] =3D rem - ? (upper << (BITS_PER_LONG - rem)) | (lower >> rem) - : lower; - if (left && k =3D=3D lim - 1) - dst[k] &=3D mask; - } - if (off) - memset(&dst[lim - off], 0, off*sizeof(unsigned long)); -} -EXPORT_SYMBOL(__bitmap_shift_right); - - -/* - * __bitmap_shift_left - logical left shift of the bits in a bitmap - * @dst - destination bitmap - * @src - source bitmap - * @nbits - shift by this many bits - * @bits - bitmap size, in bits - * - * Shifting left (multiplying) means moving bits in the LS -> MS - * direction. Zeros are fed into the vacated LS bit positions - * and those MS bits shifted off the top are lost. - */ - -void __bitmap_shift_left(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k, lim =3D BITS_TO_LONGS(bits), left =3D bits % BITS_PER_LONG; - int off =3D shift/BITS_PER_LONG, rem =3D shift % BITS_PER_LONG; - for (k =3D lim - off - 1; k >=3D 0; --k) { - unsigned long upper, lower; - - /* - * If shift is not word aligned, take upper rem bits of - * word below and make them the bottom rem bits of result. - */ - if (rem && k > 0) - lower =3D src[k - 1]; - else - lower =3D 0; - upper =3D src[k]; - if (left && k =3D=3D lim - 1) - upper &=3D (1UL << left) - 1; - dst[k + off] =3D rem ? (lower >> (BITS_PER_LONG - rem)) - | (upper << rem) - : upper; - if (left && k + off =3D=3D lim - 1) - dst[k + off] &=3D (1UL << left) - 1; - } - if (off) - memset(dst, 0, off*sizeof(unsigned long)); -} -EXPORT_SYMBOL(__bitmap_shift_left); - void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, const unsigned long *bitmap2, int bits) { diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h index 0430c1ce2a..4e1e690af1 100644 --- a/xen/include/xen/bitmap.h +++ b/xen/include/xen/bitmap.h @@ -38,8 +38,6 @@ * bitmap_empty(src, nbits) Are all bits zero in *src? * bitmap_full(src, nbits) Are all bits set in *src? * bitmap_weight(src, nbits) Hamming Weight: number set bits - * bitmap_shift_right(dst, src, n, nbits) *dst =3D *src >> n - * bitmap_shift_left(dst, src, n, nbits) *dst =3D *src << n */ =20 /* @@ -74,10 +72,6 @@ extern int __bitmap_equal(const unsigned long *bitmap1, const unsigned long *bitmap2, int bits); extern void __bitmap_complement(unsigned long *dst, const unsigned long *s= rc, int bits); -extern void __bitmap_shift_right(unsigned long *dst, - const unsigned long *src, int shift, int bits); -extern void __bitmap_shift_left(unsigned long *dst, - const unsigned long *src, int shift, int bits); extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, const unsigned long *bitmap2, int bits); extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, @@ -233,22 +227,6 @@ static inline int bitmap_weight(const unsigned long *s= rc, int nbits) return __bitmap_weight(src, nbits); } =20 -static inline void bitmap_shift_right(unsigned long *dst, - const unsigned long *src, int n, int nbits) -{ - bitmap_switch(nbits,, - *dst =3D *src >> n, - __bitmap_shift_right(dst, src, n, nbits)); -} - -static inline void bitmap_shift_left(unsigned long *dst, - const unsigned long *src, int n, int nbits) -{ - bitmap_switch(nbits,, - *dst =3D (*src << n) & BITMAP_LAST_WORD_MASK(nbits), - __bitmap_shift_left(dst, src, n, nbits)); -} - #undef bitmap_switch #undef bitmap_bytes =20 diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 1d73f9f3b6..6be9567e9e 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -31,9 +31,6 @@ * int cpumask_full(mask) Is mask full (all bits sets)? * int cpumask_weight(mask) Hamming weigh - number of set bits * - * void cpumask_shift_right(dst, src, n) Shift right - * void cpumask_shift_left(dst, src, n) Shift left - * * int cpumask_first(mask) Number lowest set bit, or NR_CPUS * int cpumask_next(cpu, mask) Next cpu past 'cpu', or NR_CPUS * int cpumask_last(mask) Number highest set bit, or NR_CPUS @@ -213,18 +210,6 @@ static inline void cpumask_copy(cpumask_t *dstp, const= cpumask_t *srcp) bitmap_copy(dstp->bits, srcp->bits, nr_cpumask_bits); } =20 -static inline void cpumask_shift_right(cpumask_t *dstp, - const cpumask_t *srcp, int n) -{ - bitmap_shift_right(dstp->bits, srcp->bits, n, nr_cpumask_bits); -} - -static inline void cpumask_shift_left(cpumask_t *dstp, - const cpumask_t *srcp, int n) -{ - bitmap_shift_left(dstp->bits, srcp->bits, n, nr_cpumask_bits); -} - static inline int cpumask_first(const cpumask_t *srcp) { return min_t(int, nr_cpu_ids, find_first_bit(srcp->bits, nr_cpu_ids)); diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index e287399352..5eebc2c5ee 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -30,9 +30,6 @@ * int nodes_full(mask) Is mask full (all bits sets)? * int nodes_weight(mask) Hamming weight - number of set bits * - * void nodes_shift_right(dst, src, n) Shift right - * void nodes_shift_left(dst, src, n) Shift left - * * int first_node(mask) Number lowest set bit, or MAX_NUMNODES * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES * int last_node(mask) Number highest set bit, or MAX_NUMNODES @@ -189,22 +186,6 @@ static inline int __nodes_weight(const nodemask_t *src= p, int nbits) return bitmap_weight(srcp->bits, nbits); } =20 -#define nodes_shift_right(dst, src, n) \ - __nodes_shift_right(&(dst), &(src), (n), MAX_NUMNODES) -static inline void __nodes_shift_right(nodemask_t *dstp, - const nodemask_t *srcp, int n, int nbits) -{ - bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); -} - -#define nodes_shift_left(dst, src, n) \ - __nodes_shift_left(&(dst), &(src), (n), MAX_NUMNODES) -static inline void __nodes_shift_left(nodemask_t *dstp, - const nodemask_t *srcp, int n, int nbits) -{ - bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); -} - /* FIXME: better would be to fix all architectures to never return > MAX_NUMNODES, then the silly min_ts could be dropped. */ =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402409; cv=none; d=zoho.com; s=zohoarc; b=KY+vZwYzNsfNlbzpt2XCsAnvKrkFiMsZ20VGFZbPTmHUOevBbKaISNyQWGLdO+BnDoKhRh+uKSrikqx7EPuDUvqc7ptlWaVzL1WE4EJDQhBfWjQHXw3Ft14RSFESUlAY+UIrxIeIIH3PV2dvKigxL75fzw6lcanUJRAWqzx/VQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402409; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ihRxWnpY1pylcxV5RICocXHl7kVrPN/FDMTJ5miOjD4=; b=bn7ae8USFh62vbBABGtw+tXiTKqGejBcGUwlZzh78yY1Boy//jVZHijBfS+vn2v0Ot06W19lV3EDhyM1lJXiF67XN2xrUFgkTEMdV317fwOqrXYfHEskhFNH8CRn3ReJon3y2lb+34XvBqzWr7imijTRch+Rx5kiIA+r6tpuul8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15644024095498.365147041650744; Mon, 29 Jul 2019 05:13:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vg-0006cE-GH; Mon, 29 Jul 2019 12:12:12 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vf-0006bv-7D for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:11 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 175a1506-b1fa-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 12:12:10 +0000 (UTC) X-Inumbo-ID: 175a1506-b1fa-11e9-8980-bc764e045a96 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VkmIG/zsE2itTtiAGL2m1VcRbq5d7vVg1V33C3publY1+sM9PFPcQVKul8E30OSAAP+0vQOJTZ A/nVMZZhmbHctGNQAdW4cwBBbDhjH1laL6nOKO3BLBor1wGFOz1D7ChVXnbuzAdRXZ3OW4VRlW rN6qgETf1GsL3yUoGkfN97619QGuf82ZhRtEp9EuJvUUj9/xFXr5VtNOy9Z+jR4Gg5jc3m69Hi eF9Yc4CkcrJsOrjQKHYxImlAZiKohXmzHdu7n+GIf+jVPVR3rRBkZ8aE/1RJExj+dnlAy6lhHx 7NY= X-SBRS: 2.7 X-MesageID: 3672662 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672662" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:11:57 +0100 Message-ID: <20190729121204.13559-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 03/10] xen/nodemask: Drop any_online_node() and first_unset_node() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" These have never been used in Xen, and it is unlikely that they would be useful in the future. any_online_cpu() was dropped by c/s 22bdce1c048 "eliminate first_cpu() etc" but the API comment was left in place. Drop that too. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/include/xen/cpumask.h | 2 -- xen/include/xen/nodemask.h | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 6be9567e9e..9448f5c6f8 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -50,8 +50,6 @@ * int cpu_possible(cpu) Is some cpu possible? * int cpu_present(cpu) Is some cpu present (can schedule)? * - * int any_online_cpu(mask) First online cpu in mask, or NR_CPUS - * * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 5eebc2c5ee..c28dd3c768 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -33,8 +33,6 @@ * int first_node(mask) Number lowest set bit, or MAX_NUMNODES * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES * int last_node(mask) Number highest set bit, or MAX_NUMNODES - * int first_unset_node(mask) First node not set in mask, or=20 - * MAX_NUMNODES. * int cycle_node(node, mask) Next node cycling from 'node', or * MAX_NUMNODES * @@ -49,8 +47,6 @@ * * int node_online(node) Is some node online? * - * int any_online_node(mask) First online node in mask - * * node_set_online(node) set bit 'node' in node_online_map * node_set_offline(node) clear bit 'node' in node_online_map * @@ -224,13 +220,6 @@ static inline int __last_node(const nodemask_t *srcp, = int nbits) m; \ }) =20 -#define first_unset_node(mask) __first_unset_node(&(mask)) -static inline int __first_unset_node(const nodemask_t *maskp) -{ - return min_t(int,MAX_NUMNODES, - find_first_zero_bit(maskp->bits, MAX_NUMNODES)); -} - #define cycle_node(n, src) __cycle_node((n), &(src), MAX_NUMNODES) static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits) { @@ -293,15 +282,6 @@ extern nodemask_t node_online_map; #define node_online(node) ((node) =3D=3D 0) #endif =20 -#define any_online_node(mask) \ -({ \ - int node; \ - for_each_node_mask(node, (mask)) \ - if (node_online(node)) \ - break; \ - node; \ -}) - #define node_set_online(node) set_bit((node), node_online_map.bits) #define node_set_offline(node) clear_bit((node), node_online_map.bits) =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402401; cv=none; d=zoho.com; s=zohoarc; b=LdRfg1TdaNzAFPSb6NySFPRlNDRn64HLE/ORsbosQcPOtRJbPAesBSALPut++Wge45ftgKfnBGTprzDnbhGGTuNaa3uThjmIWt4Uv6Q3Guv31A5b/z49Q2p6pPt34ZVgTZIZ1IByHY7DWwtRPehEKt4ig1yfkmuNaZNOaNm+9d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402401; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=RWpdJanPLQBrXvvwvrRczJWyzyELZEQxVu/qA7CmYKQ=; b=JzMG7zdSn+Tkt+mWMxO5xD95D13dZjNTIGLirLPb1sU76IDK7PGGggl6EZpENT4hkysvCx+0mrRkHu3cn+FJvrQi7NQ1a/WaPBmtv884HAb/xB7VaOGvkH2LFv/Qkpm9oDjE9TWr/WpyztkV0WmPSdR+1Xgr3ikddNOEcA/Y0e8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 156440240168844.57678809999254; Mon, 29 Jul 2019 05:13:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vk-0006fj-Qy; Mon, 29 Jul 2019 12:12:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vi-0006dd-9y for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:14 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 17befd4e-b1fa-11e9-b449-abd9a3914de4; Mon, 29 Jul 2019 12:12:11 +0000 (UTC) X-Inumbo-ID: 17befd4e-b1fa-11e9-b449-abd9a3914de4 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Mn0KggICg/WSrmSQcF68gZXvT3Owj2nOW1sCTN9iecYlv9zgSDVpXOS185yU11CYcEiL11/nP5 Mrlg2BawMiN1xrsGQntdHnwipvq+W97xDrOQZ9zfx+BmGgwQKuRTlrNDoQxrqBJQ9Lneo+tvrp jAJL6LuuQF1gcwf9g5FSSebM0BM68eqW8EgK+C+a2eXWkJn4TRK3bSqnHi3z11IsSxDOrMWEy/ dz8WVhZbF96ThPC2ThwPnolEdQqAG6+9X2wTyVtG320AH51oF59nq89Vod7bQAlCEK2+YhC3Nl KZw= X-SBRS: 2.7 X-MesageID: 3672664 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672664" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:11:58 +0100 Message-ID: <20190729121204.13559-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 04/10] xen/mask: Convert {cpu, node}mask_test() to be static inline X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The buggy version of GCC isn't supported by Xen, so reimplement the helpers with type checking, using Xen's latest type expectations. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/arch/x86/srat.c | 2 +- xen/common/page_alloc.c | 2 +- xen/include/xen/cpumask.h | 18 +++++------------- xen/include/xen/nodemask.h | 18 +++++++----------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 47a4267220..506a56d66b 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -495,7 +495,7 @@ int __init acpi_scan_nodes(u64 start, u64 end) for (i =3D 0; i < nr_cpu_ids; i++) { if (cpu_to_node[i] =3D=3D NUMA_NO_NODE) continue; - if (!node_isset(cpu_to_node[i], processor_nodes_parsed)) + if (!nodemask_test(cpu_to_node[i], &processor_nodes_parsed)) numa_set_node(i, NUMA_NO_NODE); } numa_init_array(); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index efa437c7df..77e649d065 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -878,7 +878,7 @@ static struct page_info *get_free_buddy(unsigned int zo= ne_lo, return NULL; =20 /* Pick next node. */ - if ( !node_isset(node, nodemask) ) + if ( !nodemask_test(node, &nodemask) ) { /* Very first node may be caller-specified and outside nodemas= k. */ ASSERT(!nodemask_retry); diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 9448f5c6f8..478ec66e5b 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -14,7 +14,7 @@ * void cpumask_clear_cpu(cpu, mask) turn off bit 'cpu' in mask * void cpumask_setall(mask) set all bits * void cpumask_clear(mask) clear all bits - * int cpumask_test_cpu(cpu, mask) true iff bit 'cpu' set in mask + * bool cpumask_test_cpu(cpu, mask) true iff bit 'cpu' set in mask * int cpumask_test_and_set_cpu(cpu, mask) test and set bit 'cpu' in mask * int cpumask_test_and_clear_cpu(cpu, mask) test and clear bit 'cpu' in m= ask * @@ -53,15 +53,6 @@ * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map - * - * Subtlety: - * 1) The 'type-checked' form of cpumask_test_cpu() causes gcc (3.3.2, any= way) - * to generate slightly worse code. Note for example the additional - * 40 lines of assembly code compiling the "for each possible cpu" - * loops buried in the disk_stat_read() macros calls when compiling - * drivers/block/genhd.c (arch i386, CONFIG_SMP=3Dy). So use a simple - * one-line #define for cpumask_test_cpu(), instead of wrapping an inli= ne - * inside a macro, the way we do the other calls. */ =20 #include @@ -117,9 +108,10 @@ static inline void cpumask_clear(cpumask_t *dstp) bitmap_zero(dstp->bits, nr_cpumask_bits); } =20 -/* No static inline type checking - see Subtlety (1) above. */ -#define cpumask_test_cpu(cpu, cpumask) \ - test_bit(cpumask_check(cpu), (cpumask)->bits) +static inline bool cpumask_test_cpu(unsigned int cpu, const cpumask_t *dst) +{ + return test_bit(cpumask_check(cpu), dst->bits); +} =20 static inline int cpumask_test_and_set_cpu(int cpu, volatile cpumask_t *ad= dr) { diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index c28dd3c768..7ab8b794c6 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -14,7 +14,7 @@ * void node_clear(node, mask) turn off bit 'node' in mask * void nodes_setall(mask) set all bits * void nodes_clear(mask) clear all bits - * int node_isset(node, mask) true iff bit 'node' set in mask + * bool nodemask_test(node, mask) true iff bit 'node' set in mask * int node_test_and_set(node, mask) test and set bit 'node' in mask * * void nodes_and(dst, src1, src2) dst =3D src1 & src2 [intersection] @@ -45,18 +45,12 @@ * * int num_online_nodes() Number of online Nodes * - * int node_online(node) Is some node online? + * bool node_online(node) Is this node online? * * node_set_online(node) set bit 'node' in node_online_map * node_set_offline(node) clear bit 'node' in node_online_map * * for_each_online_node(node) for-loop node over node_online_map - * - * Subtlety: - * 1) The 'type-checked' form of node_isset() causes gcc (3.3.2, anyway) - * to generate slightly worse code. So use a simple one-line #define - * for node_isset(), instead of wrapping an inline inside a macro, the - * way we do the other calls. */ =20 #include @@ -90,8 +84,10 @@ static inline void __nodes_clear(nodemask_t *dstp, int n= bits) bitmap_zero(dstp->bits, nbits); } =20 -/* No static inline type checking - see Subtlety (1) above. */ -#define node_isset(node, nodemask) test_bit((node), (nodemask).bits) +static inline bool nodemask_test(unsigned int node, const nodemask_t *dst) +{ + return test_bit(node, dst->bits); +} =20 #define node_test_and_set(node, nodemask) \ __node_test_and_set((node), &(nodemask)) @@ -276,7 +272,7 @@ extern nodemask_t node_online_map; =20 #if MAX_NUMNODES > 1 #define num_online_nodes() nodes_weight(node_online_map) -#define node_online(node) node_isset((node), node_online_map) +#define node_online(node) nodemask_test(node, &node_online_map) #else #define num_online_nodes() 1 #define node_online(node) ((node) =3D=3D 0) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402404; cv=none; d=zoho.com; s=zohoarc; b=HfsHzi3Z5QaX37k3DbQ75eJM3AoXaRikO8xlBA+GxqPeS0KEiBPitCecQqtUi5XRX0IFONCF3VYHBIrAS/OVDS3fr4+IXXa7RHaRPe8E520lUH4IMAiixUWs/wluM/Aj3un/DQ3GcaS01jBYi9jC1EZjuXgWhBLOUGaK6LDoGNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402404; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rVSNMjbX0LJDlUr0jrOplyuk3ZXRCHVNUz3aQFq97Jc=; b=PrED2YmQVIPCBEWlWkpaf5xAfFYuY3tlLckzX44V+fTkUJ4fRNr1xpu8dpdqsURpinuMjz8c5y0MA5diIt999epPFhxR4tdu2zNPNYskIqL+rVXGgZtMV2AyLfV1TJ7DLCseG3oQRUK2+xoVAVFuLBvS0+BecSg30Wi5dPgAlgo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402404672239.88440459483343; Mon, 29 Jul 2019 05:13:24 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vl-0006g7-4v; Mon, 29 Jul 2019 12:12:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vi-0006eD-Jq for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:14 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 18cf1a87-b1fa-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 12:12:12 +0000 (UTC) X-Inumbo-ID: 18cf1a87-b1fa-11e9-8980-bc764e045a96 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Fd0Grkw7Lgdg1b3B2WJZHvRgi7xi4sNKc4XXSa6uR+7O2/PE4puBXmUrXK3z+dYE1/FFmu9qPI lM8zfog747MIbPCw9c1kGrPKoemoI6Bej4tTfkfhwzRb+HDSgcCFcJNs6uSPARwhm0XpC4vK1i n0K+ntnKeHm3LhuiS4Yn8d5is928OJvdGt0mOoDoCA3NLwibxjPfCnab3/J+kqCP520KDR3WcN OhtQcy1jwx3nHMgqTh61Z2XHJcB5CwQjzR7Hn8dnAV23ScfZw/JM4tiPInSwtSqrQaGxkpz/r1 5BI= X-SBRS: 2.7 X-MesageID: 3672666 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672666" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:11:59 +0100 Message-ID: <20190729121204.13559-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 05/10] xen/cpumask: Introduce a CPUMASK_PR() wrapper for printing X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Dario Faggioli , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Having to specify 'nr_cpu_id, cpumask_bits(foo)' for all printing operations is quite repetative. Introduce a wrapper to help. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: George Dunlap CC: Dario Faggioli CC: Juergen Gross v3: * New Juergen: If this is too disruptive to your core schedulling series, I can defer it. Its just API cleanup patching the subsequent patch. --- xen/arch/x86/cpu/mcheck/mce.c | 2 +- xen/arch/x86/crash.c | 2 +- xen/arch/x86/io_apic.c | 6 ++---- xen/arch/x86/irq.c | 5 ++--- xen/arch/x86/sysctl.c | 3 +-- xen/common/cpupool.c | 7 +++---- xen/common/keyhandler.c | 8 ++++---- xen/common/sched_credit.c | 6 +++--- xen/common/sched_credit2.c | 12 ++++++------ xen/common/sched_null.c | 7 +++---- xen/common/sched_rt.c | 3 +-- xen/include/xen/cpumask.h | 6 ++++++ 12 files changed, 33 insertions(+), 34 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 2a9747ed19..28ad7dd659 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -547,7 +547,7 @@ void mcheck_cmn_handler(const struct cpu_user_regs *reg= s) =20 snprintf(ebuf, sizeof(ebuf), "MCE: Fatal error happened on CPUs %*pb", - nr_cpu_ids, cpumask_bits(&mce_fatal_cpus)); + CPUMASK_PR(&mce_fatal_cpus)); =20 mc_panic(ebuf); } diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c index a9f3e1890c..32132e4cb9 100644 --- a/xen/arch/x86/crash.c +++ b/xen/arch/x86/crash.c @@ -160,7 +160,7 @@ static void nmi_shootdown_cpus(void) printk("Shot down all CPUs\n"); else printk("Failed to shoot down CPUs {%*pbl}\n", - nr_cpu_ids, cpumask_bits(&waiting_to_crash)); + CPUMASK_PR(&waiting_to_crash)); =20 /* * Try to crash shutdown IOMMU functionality as some old crashdump diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index f93f711051..5d25862bd8 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2238,8 +2238,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int= irq, int edge_level, int a SET_DEST(entry, logical, cpu_mask_to_apicid(mask)); } else { printk(XENLOG_ERR "IRQ%d: no target CPU (%*pb vs %*pb)\n", - irq, nr_cpu_ids, cpumask_bits(desc->arch.cpu_mask), - nr_cpu_ids, cpumask_bits(TARGET_CPUS)); + irq, CPUMASK_PR(desc->arch.cpu_mask), CPUMASK_PR(TARGET_CPU= S)); desc->status |=3D IRQ_DISABLED; } =20 @@ -2437,8 +2436,7 @@ int ioapic_guest_write(unsigned long physbase, unsign= ed int reg, u32 val) else { gprintk(XENLOG_ERR, "IRQ%d: no target CPU (%*pb vs %*pb)\n", - irq, nr_cpu_ids, cpumask_bits(desc->arch.cpu_mask), - nr_cpu_ids, cpumask_bits(TARGET_CPUS)); + irq, CPUMASK_PR(desc->arch.cpu_mask), CPUMASK_PR(TARGET_CPU= S)); desc->status |=3D IRQ_DISABLED; rte.mask =3D 1; } diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 668a1f5b36..0ee33464d2 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -2398,8 +2398,7 @@ static void dump_irqs(unsigned char key) spin_lock_irqsave(&desc->lock, flags); =20 printk(" IRQ:%4d aff:{%*pbl}/{%*pbl} vec:%02x %-15s status=3D%03= x ", - irq, nr_cpu_ids, cpumask_bits(desc->affinity), - nr_cpu_ids, cpumask_bits(desc->arch.cpu_mask), + irq, CPUMASK_PR(desc->affinity), CPUMASK_PR(desc->arch.cpu_= mask), desc->arch.vector, desc->handler->typename, desc->status); =20 if ( ssid ) @@ -2563,7 +2562,7 @@ void fixup_irqs(const cpumask_t *mask, bool verbose) printk("Cannot set affinity for IRQ%u\n", irq); else if ( break_affinity ) printk("Broke affinity for IRQ%u, new: %*pb\n", - irq, nr_cpu_ids, cpumask_bits(affinity)); + irq, CPUMASK_PR(affinity)); } =20 /* That doesn't seem sufficient. Give it 1ms. */ diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 3f06fecbd8..c50d910a1c 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -150,8 +150,7 @@ static long smt_up_down_helper(void *data) =20 if ( !ret ) printk(XENLOG_INFO "SMT %s - online CPUs 0x%*pb\n", - up ? "enabled" : "disabled", - nr_cpu_ids, cpumask_bits(&cpu_online_map)); + up ? "enabled" : "disabled", CPUMASK_PR(&cpu_online_map)); =20 return ret; } diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 31ac323e40..f90e496eda 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -712,18 +712,17 @@ void dump_runq(unsigned char key) sched_smt_power_savings? "enabled":"disabled"); printk("NOW=3D%"PRI_stime"\n", now); =20 - printk("Online Cpus: %*pbl\n", nr_cpu_ids, cpumask_bits(&cpu_online_ma= p)); + printk("Online Cpus: %*pbl\n", CPUMASK_PR(&cpu_online_map)); if ( !cpumask_empty(&cpupool_free_cpus) ) { - printk("Free Cpus: %*pbl\n", - nr_cpu_ids, cpumask_bits(&cpupool_free_cpus)); + printk("Free Cpus: %*pbl\n", CPUMASK_PR(&cpupool_free_cpus)); schedule_dump(NULL); } =20 for_each_cpupool(c) { printk("Cpupool %d:\n", (*c)->cpupool_id); - printk("Cpus: %*pbl\n", nr_cpu_ids, cpumask_bits((*c)->cpu_valid)); + printk("Cpus: %*pbl\n", CPUMASK_PR((*c)->cpu_valid)); schedule_dump(*c); } =20 diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 4f4a660b0c..a5e95e2fe9 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -272,8 +272,8 @@ static void dump_domains(unsigned char key) printk(" nr_pages=3D%d xenheap_pages=3D%d shared_pages=3D%u pag= ed_pages=3D%u " "dirty_cpus=3D{%*pbl} max_pages=3D%u\n", d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), - atomic_read(&d->paged_pages), nr_cpu_ids, - cpumask_bits(d->dirty_cpumask), d->max_pages); + atomic_read(&d->paged_pages), CPUMASK_PR(d->dirty_cpumask), + d->max_pages); printk(" handle=3D%02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=3D%08lx\n", d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3], @@ -312,8 +312,8 @@ static void dump_domains(unsigned char key) printk("dirty_cpu=3D%u", v->dirty_cpu); printk("\n"); printk(" cpu_hard_affinity=3D{%*pbl} cpu_soft_affinity=3D{%= *pbl}\n", - nr_cpu_ids, cpumask_bits(v->cpu_hard_affinity), - nr_cpu_ids, cpumask_bits(v->cpu_soft_affinity)); + CPUMASK_PR(v->cpu_hard_affinity), + CPUMASK_PR(v->cpu_soft_affinity)); printk(" pause_count=3D%d pause_flags=3D%lx\n", atomic_read(&v->pause_count), v->pause_flags); arch_dump_vcpu_info(v); diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 3c0d7c7267..81dee5e472 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -2057,8 +2057,8 @@ csched_dump_pcpu(const struct scheduler *ops, int cpu) =20 printk("CPU[%02d] nr_run=3D%d, sort=3D%d, sibling=3D%*pb, core=3D%*pb\= n", cpu, spc->nr_runnable, spc->runq_sort_last, - nr_cpu_ids, cpumask_bits(per_cpu(cpu_sibling_mask, cpu)), - nr_cpu_ids, cpumask_bits(per_cpu(cpu_core_mask, cpu))); + CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)), + CPUMASK_PR(per_cpu(cpu_core_mask, cpu))); =20 /* current VCPU (nothing to say if that's the idle vcpu). */ svc =3D CSCHED_VCPU(curr_on_cpu(cpu)); @@ -2119,7 +2119,7 @@ csched_dump(const struct scheduler *ops) prv->ticks_per_tslice, prv->vcpu_migr_delay/ MICROSECS(1)); =20 - printk("idlers: %*pb\n", nr_cpu_ids, cpumask_bits(prv->idlers)); + printk("idlers: %*pb\n", CPUMASK_PR(prv->idlers)); =20 printk("active vcpus:\n"); loop =3D 0; diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 8e4381d8a7..33fc86ffb2 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -3653,8 +3653,8 @@ dump_pcpu(const struct scheduler *ops, int cpu) =20 printk("CPU[%02d] runq=3D%d, sibling=3D%*pb, core=3D%*pb\n", cpu, c2r(cpu), - nr_cpu_ids, cpumask_bits(per_cpu(cpu_sibling_mask, cpu)), - nr_cpu_ids, cpumask_bits(per_cpu(cpu_core_mask, cpu))); + CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)), + CPUMASK_PR(per_cpu(cpu_core_mask, cpu))); =20 /* current VCPU (nothing to say if that's the idle vcpu) */ svc =3D csched2_vcpu(curr_on_cpu(cpu)); @@ -3698,7 +3698,7 @@ csched2_dump(const struct scheduler *ops) "\taveload =3D %"PRI_stime" (~%"PRI_stime"%%)\n", i, cpumask_weight(&prv->rqd[i].active), - nr_cpu_ids, cpumask_bits(&prv->rqd[i].active), + CPUMASK_PR(&prv->rqd[i].active), prv->rqd[i].max_weight, prv->rqd[i].pick_bias, prv->rqd[i].load, @@ -3708,9 +3708,9 @@ csched2_dump(const struct scheduler *ops) printk("\tidlers: %*pb\n" "\ttickled: %*pb\n" "\tfully idle cores: %*pb\n", - nr_cpu_ids, cpumask_bits(&prv->rqd[i].idle), - nr_cpu_ids, cpumask_bits(&prv->rqd[i].tickled), - nr_cpu_ids, cpumask_bits(&prv->rqd[i].smt_idle)); + CPUMASK_PR(&prv->rqd[i].idle), + CPUMASK_PR(&prv->rqd[i].tickled), + CPUMASK_PR(&prv->rqd[i].smt_idle)); } =20 printk("Domain info:\n"); diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index c47c1b5aae..5aec9f17bd 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -782,9 +782,8 @@ static void null_dump_pcpu(const struct scheduler *ops,= int cpu) lock =3D pcpu_schedule_lock_irqsave(cpu, &flags); =20 printk("CPU[%02d] sibling=3D%*pb, core=3D%*pb", - cpu, - nr_cpu_ids, cpumask_bits(per_cpu(cpu_sibling_mask, cpu)), - nr_cpu_ids, cpumask_bits(per_cpu(cpu_core_mask, cpu))); + cpu, CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)), + CPUMASK_PR(per_cpu(cpu_core_mask, cpu))); if ( per_cpu(npc, cpu).vcpu !=3D NULL ) printk(", vcpu=3D%pv", per_cpu(npc, cpu).vcpu); printk("\n"); @@ -810,7 +809,7 @@ static void null_dump(const struct scheduler *ops) =20 spin_lock_irqsave(&prv->lock, flags); =20 - printk("\tcpus_free =3D %*pbl\n", nr_cpu_ids, cpumask_bits(&prv->cpus_= free)); + printk("\tcpus_free =3D %*pbl\n", CPUMASK_PR(&prv->cpus_free)); =20 printk("Domain info:\n"); loop =3D 0; diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 0acfc3d702..e0e350bdf3 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -344,8 +344,7 @@ rt_dump_vcpu(const struct scheduler *ops, const struct = rt_vcpu *svc) has_extratime(svc), vcpu_on_q(svc), vcpu_runnable(svc->vcpu), - svc->flags, - nr_cpu_ids, cpumask_bits(mask)); + svc->flags, CPUMASK_PR(mask)); } =20 static void diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 478ec66e5b..ca712efe57 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -61,6 +61,12 @@ =20 typedef struct cpumask{ DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; =20 +/* + * printf arguments for a cpumask. Shorthand for using '%*pb[l]' when + * printing a cpumask. + */ +#define CPUMASK_PR(src) nr_cpu_ids, cpumask_bits(src) + extern unsigned int nr_cpu_ids; =20 #if NR_CPUS > 4 * BITS_PER_LONG --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402396; cv=none; d=zoho.com; s=zohoarc; b=V8xkHy0Kd1zOwgpIO0lEK1PemLscxPRkGRLvMDuMosUm3NaxSzQJaz3YR2urDb1onLGT/3wyDiHr8Gtu6a5rUIwGELfSuSWZWs4BorxYEAcm5BQr4MHOgywrqwVHPkW4UTiocyDyRM2SFcbpFL3aAiTbLbBFgGCuS2Avl96yr/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402396; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=g4yaKBGIeXz3DoRtASdyAaxtyy6urX1vMQuzZy7PUzg=; b=iIDHu2dVpVzOYCXUsVPyCj4/c1U3bY/6KqX2gcwhPMrZjqHiLeqqvooXeuwMkvNmYjAP8lwaacGIaV/8IhdhY6TmMOllwvsMd8/0amigs6J2rb/tdroQxE0qBkcozhNNM07QsKx5tJqSAM3UYl9HyLf/3ipv/ZeN4GK9qpAnus8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402396185923.114478601884; Mon, 29 Jul 2019 05:13:16 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vh-0006dF-Pn; Mon, 29 Jul 2019 12:12:13 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vg-0006cc-Vw for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:13 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 185cb658-b1fa-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 12:12:12 +0000 (UTC) X-Inumbo-ID: 185cb658-b1fa-11e9-8980-bc764e045a96 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 5QZiSNMik7uRCxlEeakZ1vL297kyK81835L9fPWpvLzcdvePxl5X3If1poscTHuzkrJsUzbEMr NcJu7oUn3vXinvH09IEq3CvDy+rBA6xCJ2BSDfPlA26tKOfcp4ZZseklU+A36Z6/2YIH7KlOl6 pQQkzCLs2jkJTnHbG+XWBWnFkwr4xsUxjLxgGrvpZWoFnhrUNAjAhs43Ijrd/EXJatnB12CMj3 wvcPFEdcLbeWuZiexO1OUvu5gHionW3RPTUnOKlik0HwW5dtXwKsO/KTPjxiTfUTYf/xDOUu5Y BwU= X-SBRS: 2.7 X-MesageID: 3672665 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672665" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:12:00 +0100 Message-ID: <20190729121204.13559-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 06/10] xen/nodemask: Introduce a NODEMASK_PR() wrapper for printing X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Rework nodes_addr() into nodemask_bits() and change the indirection to match its cpumask_bits() counterpart, and update the caller. Use NODEMASK_PR() to fix up one opencoded access into nodemask.bits in dump_domains(). Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/common/domctl.c | 4 ++-- xen/common/keyhandler.c | 2 +- xen/include/xen/nodemask.h | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index fa260ce5fb..9ed9f57f0d 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -123,14 +123,14 @@ int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask, static int nodemask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_nodemap, const nodemask_t *nodemask) { - return bitmap_to_xenctl_bitmap(xenctl_nodemap, nodes_addr(*nodemask), + return bitmap_to_xenctl_bitmap(xenctl_nodemap, nodemask_bits(nodemask), MAX_NUMNODES); } =20 static int xenctl_bitmap_to_nodemask(nodemask_t *nodemask, const struct xenctl_bitmap *xenctl_no= demap) { - return xenctl_bitmap_to_bitmap(nodes_addr(*nodemask), xenctl_nodemap, + return xenctl_bitmap_to_bitmap(nodemask_bits(nodemask), xenctl_nodemap, MAX_NUMNODES); } =20 diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index a5e95e2fe9..57b360ee4b 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -293,7 +293,7 @@ static void dump_domains(unsigned char key) dump_pageframe_info(d); =20 printk("NODE affinity for domain %d: [%*pbl]\n", - d->domain_id, MAX_NUMNODES, d->node_affinity.bits); + d->domain_id, NODEMASK_PR(&d->node_affinity)); =20 printk("VCPU information and callbacks for domain %u:\n", d->domain_id); diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 7ab8b794c6..1dd6c7458e 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -39,7 +39,7 @@ * nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set * NODE_MASK_ALL Initializer - all bits set * NODE_MASK_NONE Initializer - no bits set - * unsigned long *nodes_addr(mask) Array of unsigned long's in mask + * unsigned long *nodemask_bits(mask) Array of unsigned long's in mask * * for_each_node_mask(node, mask) for-loop node over mask * @@ -58,6 +58,15 @@ #include =20 typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; + +/* + * printf arguments for a nodemask. Shorthand for using '%*pb[l]' when + * printing a nodemask. + */ +#define NODEMASK_PR(src) MAX_NUMNODES, nodemask_bits(src) + +#define nodemask_bits(src) ((src)->bits) + extern nodemask_t _unused_nodemask_arg_; =20 #define node_set(node, dst) __node_set((node), &(dst)) @@ -250,8 +259,6 @@ static inline int __cycle_node(int n, const nodemask_t = *maskp, int nbits) [0 ... BITS_TO_LONGS(MAX_NUMNODES)-1] =3D 0UL \ } }) =20 -#define nodes_addr(src) ((src).bits) - #if MAX_NUMNODES > 1 #define for_each_node_mask(node, mask) \ for ((node) =3D first_node(mask); \ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402406; cv=none; d=zoho.com; s=zohoarc; b=n0GGHSM1ir/Vm8ALLyQOF2+QqgrALpC9P0EpYoJFRfKFu7l+dd2XNiQc1Ixb/jWxzQdqHqgl8NNsGadgL/W6BrIzQlAb4NPWcaGzYU/jhEDftaklRlVSh23oAd2+aZPxjzoizPmQW6AN7Eia7A9Z/fA7dfsriKGrrA38+JYpwqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402406; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ndHZHlFaFYjC0b6PU+1xg1IgbuPPhmjKH+XS+GU/jOU=; b=MXuS3Aw1x9ZyREcwl68/ade5Tj8OsEjVbdph09tNi9yFGJyPgd8AnqqlSVUJr/i2VGghTUTU+57WrC1yOrVcQFgKR66yfXz7VZmayKGO9v4Axnru+a+N55rt/70AxOaXjNWENEbRT5inaEBkYjTsgsk2mp0Kvi3bgOdwHSG8/vs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402406664518.0804444977858; Mon, 29 Jul 2019 05:13:26 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vo-0006lE-Ma; Mon, 29 Jul 2019 12:12:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vn-0006jK-H0 for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:19 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1b64c5d2-b1fa-11e9-803b-2f6df10fe840; Mon, 29 Jul 2019 12:12:17 +0000 (UTC) X-Inumbo-ID: 1b64c5d2-b1fa-11e9-803b-2f6df10fe840 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: f4kfPd8Kk9C2lKqQCRUk0/B/lVw3mswK6V/oTmKlQUerF1nbg4ldRqPi/owYtXqWBR9ol5rjsa uN+B7jhfva4Q3S7Y8W1XX4MUJmuhFPjhVFsNLl77GDGfc8qwnLUx4WFfaFYdb4LB3BTUHECOwf 6Pvc9nKU3rMTAkmdiJSsE5NjZfBdqIxp638QmYr4IRAcXS+KxLHTjFxfTnmLMFpYfYFo/vy8rb MW7MqClffGt/3ztFOw43sAtlcIX+5JYjx1pjrycE1L1m0SL7TOxufK/zlGbmXXmwg0EwGsohXz nJ8= X-SBRS: 2.7 X-MesageID: 3672670 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672670" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:12:01 +0100 Message-ID: <20190729121204.13559-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 07/10] xen/nodemask: Drop nodes_{setall, clear}() and improve the initialisers X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is no need to use runtime variable-length clearing when MAX_NUMNODES = is known to the compiler. Drop these functions and use the initialisers inste= ad. numa_initmem_init() opencodes nodemask_of_node(), but its implemention is still poor, so replace it with NODEMASK_OF() which is calculated at compile time, and without the use of a locked set_bit() operation. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/arch/x86/dom0_build.c | 2 +- xen/arch/x86/numa.c | 3 +- xen/common/domain.c | 4 +-- xen/include/xen/nodemask.h | 85 +++++++++++++++++-------------------------= ---- 4 files changed, 35 insertions(+), 59 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index c69570920c..06500c87c6 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -231,7 +231,7 @@ unsigned int __init dom0_max_vcpus(void) =20 if ( pv_shim ) { - nodes_setall(dom0_nodes); + dom0_nodes =3D NODEMASK_ALL; =20 /* * When booting in shim mode APs are not started until the guest b= rings diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 7e1f563012..7473f83b7b 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -269,8 +269,7 @@ void __init numa_initmem_init(unsigned long start_pfn, = unsigned long end_pfn) /* setup dummy node covering all memory */ memnode_shift =3D BITS_PER_LONG - 1; memnodemap =3D _memnodemap; - nodes_clear(node_online_map); - node_set_online(0); + node_online_map =3D NODEMASK_OF(0); for ( i =3D 0; i < nr_cpu_ids; i++ ) numa_set_node(i, 0); cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); diff --git a/xen/common/domain.c b/xen/common/domain.c index e8e850796e..11565a64b3 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -384,7 +384,7 @@ struct domain *domain_create(domid_t domid, INIT_PAGE_LIST_HEAD(&d->xenpage_list); =20 spin_lock_init(&d->node_affinity_lock); - d->node_affinity =3D NODE_MASK_ALL; + d->node_affinity =3D NODEMASK_ALL; d->auto_node_affinity =3D 1; =20 spin_lock_init(&d->shutdown_lock); @@ -615,7 +615,7 @@ void domain_update_node_affinity(struct domain *d) dom_affinity =3D cpumask_empty(dom_cpumask_soft) ? dom_cpumask : dom_cpumask_soft; =20 - nodes_clear(d->node_affinity); + d->node_affinity =3D NODEMASK_NONE; for_each_cpu ( cpu, dom_affinity ) node_set(cpu_to_node(cpu), d->node_affinity); } diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 1dd6c7458e..9933fec5c4 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -12,8 +12,6 @@ * * void node_set(node, mask) turn on bit 'node' in mask * void node_clear(node, mask) turn off bit 'node' in mask - * void nodes_setall(mask) set all bits - * void nodes_clear(mask) clear all bits * bool nodemask_test(node, mask) true iff bit 'node' set in mask * int node_test_and_set(node, mask) test and set bit 'node' in mask * @@ -36,9 +34,9 @@ * int cycle_node(node, mask) Next node cycling from 'node', or * MAX_NUMNODES * - * nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set - * NODE_MASK_ALL Initializer - all bits set - * NODE_MASK_NONE Initializer - no bits set + * nodemask_t NODEMASK_OF(node) Initializer - bit 'node' set + * NODEMASK_ALL Initializer - all bits set + * NODEMASK_NONE Initializer - no bits set * unsigned long *nodemask_bits(mask) Array of unsigned long's in mask * * for_each_node_mask(node, mask) for-loop node over mask @@ -67,7 +65,34 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } n= odemask_t; =20 #define nodemask_bits(src) ((src)->bits) =20 -extern nodemask_t _unused_nodemask_arg_; +#define NODEMASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES) + +#define NODEMASK_NONE \ +((nodemask_t) {{ \ + [0 ... BITS_TO_LONGS(MAX_NUMNODES) - 1] =3D 0 \ +}}) + +#if MAX_NUMNODES <=3D BITS_PER_LONG + +#define NODEMASK_ALL ((nodemask_t) {{ NODEMASK_LAST_WORD }}) +#define NODEMASK_OF(node) ((nodemask_t) {{ 1UL << (node) }}) + +#else /* MAX_NUMNODES > BITS_PER_LONG */ + +#define NODEMASK_ALL \ +((nodemask_t) {{ \ + [0 ... BITS_TO_LONGS(MAX_NUMNODES) - 2] =3D ~0UL, \ + [BITS_TO_LONGS(MAX_NUMNODES) - 1] =3D NODEMASK_LAST_WORD \ +}}) + +#define NODEMASK_OF(node) \ +({ \ + nodemask_t m =3D NODES_NONE; \ + m.bits[(node) / BITS_PER_LONG] =3D 1UL << ((node) % BITS_PER_LONG); \ + m; \ +}) + +#endif /* MAX_NUMNODES */ =20 #define node_set(node, dst) __node_set((node), &(dst)) static inline void __node_set(int node, volatile nodemask_t *dstp) @@ -81,18 +106,6 @@ static inline void __node_clear(int node, volatile node= mask_t *dstp) clear_bit(node, dstp->bits); } =20 -#define nodes_setall(dst) __nodes_setall(&(dst), MAX_NUMNODES) -static inline void __nodes_setall(nodemask_t *dstp, int nbits) -{ - bitmap_fill(dstp->bits, nbits); -} - -#define nodes_clear(dst) __nodes_clear(&(dst), MAX_NUMNODES) -static inline void __nodes_clear(nodemask_t *dstp, int nbits) -{ - bitmap_zero(dstp->bits, nbits); -} - static inline bool nodemask_test(unsigned int node, const nodemask_t *dst) { return test_bit(node, dst->bits); @@ -213,18 +226,6 @@ static inline int __last_node(const nodemask_t *srcp, = int nbits) return pnode; } =20 -#define nodemask_of_node(node) \ -({ \ - typeof(_unused_nodemask_arg_) m; \ - if (sizeof(m) =3D=3D sizeof(unsigned long)) { \ - m.bits[0] =3D 1UL<<(node); \ - } else { \ - nodes_clear(m); \ - node_set((node), m); \ - } \ - m; \ -}) - #define cycle_node(n, src) __cycle_node((n), &(src), MAX_NUMNODES) static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits) { @@ -235,30 +236,6 @@ static inline int __cycle_node(int n, const nodemask_t= *maskp, int nbits) return nxt; } =20 -#define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES) - -#if MAX_NUMNODES <=3D BITS_PER_LONG - -#define NODE_MASK_ALL \ -((nodemask_t) { { \ - [BITS_TO_LONGS(MAX_NUMNODES)-1] =3D NODE_MASK_LAST_WORD \ -} }) - -#else - -#define NODE_MASK_ALL \ -((nodemask_t) { { \ - [0 ... BITS_TO_LONGS(MAX_NUMNODES)-2] =3D ~0UL, \ - [BITS_TO_LONGS(MAX_NUMNODES)-1] =3D NODE_MASK_LAST_WORD \ -} }) - -#endif - -#define NODE_MASK_NONE \ -((nodemask_t) { { \ - [0 ... BITS_TO_LONGS(MAX_NUMNODES)-1] =3D 0UL \ -} }) - #if MAX_NUMNODES > 1 #define for_each_node_mask(node, mask) \ for ((node) =3D first_node(mask); \ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402412; cv=none; d=zoho.com; s=zohoarc; b=XId8mrxeEjZ/QMK160b3R0Kf7RHZbGCzEIxTJnqhTDj/LHdbtAHDs8SagTby6Nf1KSEKQRUu/KXX2WwTiOM5JB2x1EWoCgF+erXS/E5eG/rqrl9X52ElV+RclEdIA1siriy2262nlA8Ei6tz1AGdJH+xOd33G9o3hgks33oCfbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402412; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ahpsmhCB1hOTQ3Sf+YeInafeFg4WAPWwnVfeYxYMPLI=; b=JHA+U17dNFJ5vllUidVwQylyUqtP3em3optyXeAeV1sGPH8wZvxqQIL02ZvbPrV/mzlF3J+eqW4ee+PeGtblQnaOz3GS9Ed7RoacYtDiIWW44s0WccDI3yv450FMlP0bfWIAX248wR/1nl+VIzJwkTy3/6+q+ndNCudJx2M6kB8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402412030991.8867768412894; Mon, 29 Jul 2019 05:13:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vk-0006fM-H6; Mon, 29 Jul 2019 12:12:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vi-0006dc-9g for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:14 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 19196c88-b1fa-11e9-a920-c38cce9d7243; Mon, 29 Jul 2019 12:12:13 +0000 (UTC) X-Inumbo-ID: 19196c88-b1fa-11e9-a920-c38cce9d7243 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: DrraWLNbgCR9vHZf8Lr+j2mjbl3oOB4oIFPs8no0crbJy+jJ/Q4kM85d8qYfduYgPJmxNErBOz LIqIK2AJL5sLr/Jtl5o7VgfIDUANGoYAZjCRi7dhKohTv2OSO/66nY59t7NyaG6QLtU2xMYNFQ 9Lkb6uWLLoJyYvCss6sh+/6eNzIyy3kjpPGcgirqnIhxRPbVn/A6lYsdYIdcGitGRyQk0ng1RA 5MKB5KVoQD9+1qs+gErcO4Wp4hOy9z2jPVu9G5S1A4vlOffqOl0ao4a02fhkGE6W2bDy4fjLuv jas= X-SBRS: 2.7 X-MesageID: 3672667 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672667" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:12:02 +0100 Message-ID: <20190729121204.13559-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 08/10] xen/nodemask: Introduce unlocked __nodemask_{set, clear}() helpers X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" As with the cpumask side of things, there are times when we do not need loc= ked bit operations on a nodemask. Convert appropriate callers. Three of them operate on init-time data, while domain_update_node_affinity() already has updates to the nodemask in questi= on protected by a spinlock. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk v3: * New --- xen/arch/x86/dom0_build.c | 2 +- xen/arch/x86/srat.c | 4 ++-- xen/common/domain.c | 2 +- xen/include/xen/nodemask.h | 12 ++++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 06500c87c6..c625e64d03 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -246,7 +246,7 @@ unsigned int __init dom0_max_vcpus(void) =20 for ( i =3D 0; i < dom0_nr_pxms; ++i ) if ( (node =3D pxm_to_node(dom0_pxms[i])) !=3D NUMA_NO_NODE ) - node_set(node, dom0_nodes); + __nodemask_set(node, &dom0_nodes); nodes_and(dom0_nodes, dom0_nodes, node_online_map); if ( nodes_empty(dom0_nodes) ) dom0_nodes =3D node_online_map; diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 506a56d66b..5f44ac27f1 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -228,7 +228,7 @@ acpi_numa_x2apic_affinity_init(const struct acpi_srat_x= 2apic_cpu_affinity *pa) } =20 apicid_to_node[pa->apic_id] =3D node; - node_set(node, processor_nodes_parsed); + __nodemask_set(node, &processor_nodes_parsed); acpi_numa =3D 1; printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n", pxm, pa->apic_id, node); @@ -261,7 +261,7 @@ acpi_numa_processor_affinity_init(const struct acpi_sra= t_cpu_affinity *pa) return; } apicid_to_node[pa->apic_id] =3D node; - node_set(node, processor_nodes_parsed); + __nodemask_set(node, &processor_nodes_parsed); acpi_numa =3D 1; printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n", pxm, pa->apic_id, node); diff --git a/xen/common/domain.c b/xen/common/domain.c index 11565a64b3..5dbc68cbc3 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -617,7 +617,7 @@ void domain_update_node_affinity(struct domain *d) =20 d->node_affinity =3D NODEMASK_NONE; for_each_cpu ( cpu, dom_affinity ) - node_set(cpu_to_node(cpu), d->node_affinity); + __nodemask_set(cpu_to_node(cpu), &d->node_affinity); } =20 spin_unlock(&d->node_affinity_lock); diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 9933fec5c4..1605c1bcc5 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -11,7 +11,9 @@ * The available nodemask operations are: * * void node_set(node, mask) turn on bit 'node' in mask + * void __nodemask_set(node, mask) turn on bit 'node' in mask (unlocked) * void node_clear(node, mask) turn off bit 'node' in mask + * void __nodemask_clear(node, mask) turn off bit 'node' in mask (unlocked) * bool nodemask_test(node, mask) true iff bit 'node' set in mask * int node_test_and_set(node, mask) test and set bit 'node' in mask * @@ -100,12 +102,22 @@ static inline void __node_set(int node, volatile node= mask_t *dstp) set_bit(node, dstp->bits); } =20 +static inline void __nodemask_set(unsigned int node, nodemask_t *dst) +{ + __set_bit(node, dst->bits); +} + #define node_clear(node, dst) __node_clear((node), &(dst)) static inline void __node_clear(int node, volatile nodemask_t *dstp) { clear_bit(node, dstp->bits); } =20 +static inline void __nodemask_clear(unsigned int node, nodemask_t *dst) +{ + __clear_bit(node, dst->bits); +} + static inline bool nodemask_test(unsigned int node, const nodemask_t *dst) { return test_bit(node, dst->bits); --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564402409; cv=none; d=zoho.com; s=zohoarc; b=JPf9SaZaPijLuf132ckBz7RjpCUiTvAUjW8K301v+QBgRkB2mOnSvlO3epMRe5j14qKmCHaF7eVTYIAhoLL3U8l3TG1MchgDFS2G/AIFl8OuEkQ1YUADrNjZqZ66+5dkUsRWsGJIh5NlHxe036JYKHF2VmJYCnKORM4O2S2j4Dk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564402409; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=HevqrPIfUH3aVWSYxRr3D7qMtR5dMyceriHGKBukLh0=; b=Q8KF6wGGv+cTa2E+zEyXZMqDuagqq7N9P7A37ppbMA9eTCUxMVmBqAPG+VIpIxseVGbjIylTYrercutnZNQnTkmcPL63He5ku2MXfqRsJCdtoUb70Ssg2yx6lPofGh8TD5IitCsCdr5qFttrjEH/3xLYgEWx6qNipGAmcpAmkHg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564402409615840.0589930260059; Mon, 29 Jul 2019 05:13:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vm-0006iI-P8; Mon, 29 Jul 2019 12:12:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4Vl-0006g8-7o for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:12:17 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 19b088ac-b1fa-11e9-a069-5f339fc91643; Mon, 29 Jul 2019 12:12:14 +0000 (UTC) X-Inumbo-ID: 19b088ac-b1fa-11e9-a069-5f339fc91643 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: LKzS8NoSYwXYckjPrFuU/jSEgH+mwYr/+8pfY0j2gMqDQ+VtyDJYnAFxUvgr4IFMOuOyHwgDEt 7bRWw3IYy80DDpXuPjTTn+V9jjmi7m93rsST3N8LXGOW8wbg6XGfIdMXg5znAqYAGXEkZg3K+o I9ySh/HGj7wYu5HDULe1mNyjR7nb0ObyAXRMze7BhUmAPFln6LBFIcV1tU7Og2Ve2B45cPVXJ5 IPum94ZhyPRNmAKH2ED09tf9727Xr2qG34rhmmUPYe/JSfJKQREz1Pw6/th3jckBRO1y3dtS38 Amk= X-SBRS: 2.7 X-MesageID: 3672669 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3672669" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:12:03 +0100 Message-ID: <20190729121204.13559-10-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 09/10] xen/nodemask: Sanitise the remainder of the nodemask API X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The nodemask API differs from the cpumask API because each wrapper to bitmap operations is further wrapped by a macro which takes the address of the nodemask objects. This results in code which is slightly confusing to read as it doesn't foll= ow C's calling conventions, and prohibits the use of slightly more complicated constructs for specifying parameters. Drop all wrapping macros, rename the nodemask static inline functions to dr= op the double underscores, and feed MAX_NUMNODES into appropriate locations. Furthermore, the naming is inconsistent. As we're changing all callers anyway, rationalise all the naming to be of the form nodemask_*(), and upda= te the types to per Xen's latest expectations. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: George Dunlap v3: * Split various bits out into earlier patches * Rename the APIs to be consistent. v2: * New --- xen/arch/x86/dom0_build.c | 8 +- xen/arch/x86/numa.c | 4 +- xen/arch/x86/srat.c | 9 ++- xen/common/domain.c | 4 +- xen/common/page_alloc.c | 26 +++---- xen/common/sched_credit.c | 2 +- xen/common/sysctl.c | 2 +- xen/include/xen/nodemask.h | 186 ++++++++++++++++++++---------------------= ---- 8 files changed, 109 insertions(+), 132 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index c625e64d03..cb0f693d76 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -247,10 +247,10 @@ unsigned int __init dom0_max_vcpus(void) for ( i =3D 0; i < dom0_nr_pxms; ++i ) if ( (node =3D pxm_to_node(dom0_pxms[i])) !=3D NUMA_NO_NODE ) __nodemask_set(node, &dom0_nodes); - nodes_and(dom0_nodes, dom0_nodes, node_online_map); - if ( nodes_empty(dom0_nodes) ) + nodemask_and(&dom0_nodes, &dom0_nodes, &node_online_map); + if ( nodemask_empty(&dom0_nodes) ) dom0_nodes =3D node_online_map; - for_each_node_mask ( node, dom0_nodes ) + for_each_node_mask ( node, &dom0_nodes ) cpumask_or(&dom0_cpus, &dom0_cpus, &node_to_cpumask(node)); cpumask_and(&dom0_cpus, &dom0_cpus, cpupool0->cpu_valid); if ( cpumask_empty(&dom0_cpus) ) @@ -344,7 +344,7 @@ unsigned long __init dom0_compute_nr_pages( if ( !dom0_mem_set && CONFIG_DOM0_MEM[0] ) parse_dom0_mem(CONFIG_DOM0_MEM); =20 - for_each_node_mask ( node, dom0_nodes ) + for_each_node_mask ( node, &dom0_nodes ) avail +=3D avail_domheap_pages_region(node, 0, 0) + initial_images_nrpages(node); =20 diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 7473f83b7b..d3db213432 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -186,13 +186,13 @@ void __init numa_init_array(void) mapping. To avoid this fill in the mapping for all possible CPUs, as the number of CPUs is not known yet. We round robin the existing nodes. */ - rr =3D first_node(node_online_map); + rr =3D nodemask_first(&node_online_map); for ( i =3D 0; i < nr_cpu_ids; i++ ) { if ( cpu_to_node[i] !=3D NUMA_NO_NODE ) continue; numa_set_node(i, rr); - rr =3D cycle_node(rr, node_online_map); + rr =3D nodemask_cycle(rr, &node_online_map); } } =20 diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 5f44ac27f1..9e37e24d70 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -332,7 +332,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_m= em_affinity *ma) if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) { struct node *nd =3D &nodes[node]; =20 - if (!node_test_and_set(node, memory_nodes_parsed)) { + if (!nodemask_test_and_set(node, &memory_nodes_parsed)) { nd->start =3D start; nd->end =3D end; } else { @@ -376,7 +376,7 @@ static int __init nodes_cover_memory(void) =20 do { found =3D 0; - for_each_node_mask(j, memory_nodes_parsed) + for_each_node_mask( j, &memory_nodes_parsed ) if (start < nodes[j].end && end > nodes[j].start) { if (start >=3D nodes[j].start) { @@ -480,10 +480,11 @@ int __init acpi_scan_nodes(u64 start, u64 end) return -1; } =20 - nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); + nodemask_or(&all_nodes_parsed, &memory_nodes_parsed, + &processor_nodes_parsed); =20 /* Finally register nodes */ - for_each_node_mask(i, all_nodes_parsed) + for_each_node_mask( i, &all_nodes_parsed ) { u64 size =3D nodes[i].end - nodes[i].start; if ( size =3D=3D 0 ) diff --git a/xen/common/domain.c b/xen/common/domain.c index 5dbc68cbc3..3228b08b3a 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -630,7 +630,7 @@ void domain_update_node_affinity(struct domain *d) int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity) { /* Being affine with no nodes is just wrong */ - if ( nodes_empty(*affinity) ) + if ( nodemask_empty(affinity) ) return -EINVAL; =20 spin_lock(&d->node_affinity_lock); @@ -639,7 +639,7 @@ int domain_set_node_affinity(struct domain *d, const no= demask_t *affinity) * Being/becoming explicitly affine to all nodes is not particularly * useful. Let's take it as the `reset node affinity` command. */ - if ( nodes_full(*affinity) ) + if ( nodemask_full(affinity) ) { d->auto_node_affinity =3D 1; goto out; diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 77e649d065..97539ffd69 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -821,12 +821,12 @@ static struct page_info *get_free_buddy(unsigned int = zone_lo, * may have bit set outside of node_online_map. Clamp it. */ if ( d ) - nodes_and(nodemask, nodemask, d->node_affinity); + nodemask_and(&nodemask, &nodemask, &d->node_affinity); =20 if ( node =3D=3D NUMA_NO_NODE ) { if ( d !=3D NULL ) - node =3D cycle_node(d->last_alloc_node, nodemask); + node =3D nodemask_cycle(d->last_alloc_node, &nodemask); =20 if ( node >=3D MAX_NUMNODES ) node =3D cpu_to_node(smp_processor_id()); @@ -882,19 +882,19 @@ static struct page_info *get_free_buddy(unsigned int = zone_lo, { /* Very first node may be caller-specified and outside nodemas= k. */ ASSERT(!nodemask_retry); - first =3D node =3D first_node(nodemask); + first =3D node =3D nodemask_first(&nodemask); if ( node < MAX_NUMNODES ) continue; } - else if ( (node =3D next_node(node, nodemask)) >=3D MAX_NUMNODES ) - node =3D first_node(nodemask); + else if ( (node =3D nodemask_next(node, &nodemask)) >=3D MAX_NUMNO= DES ) + node =3D nodemask_first(&nodemask); if ( node =3D=3D first ) { /* When we have tried all in nodemask, we fall back to others.= */ if ( (memflags & MEMF_exact_node) || nodemask_retry++ ) return NULL; - nodes_andnot(nodemask, node_online_map, nodemask); - first =3D node =3D first_node(nodemask); + nodemask_andnot(&nodemask, &node_online_map, &nodemask); + first =3D node =3D nodemask_first(&nodemask); if ( node >=3D MAX_NUMNODES ) return NULL; } @@ -1171,7 +1171,7 @@ static unsigned int node_to_scrub(bool get_node) node =3D 0; =20 if ( node_need_scrub[node] && - (!get_node || !node_test_and_set(node, node_scrubbing)) ) + (!get_node || !nodemask_test_and_set(node, &node_scrubbing)) ) return node; =20 /* @@ -1182,7 +1182,7 @@ static unsigned int node_to_scrub(bool get_node) for ( ; ; ) { do { - node =3D cycle_node(node, node_online_map); + node =3D nodemask_cycle(node, &node_online_map); } while ( !cpumask_empty(&node_to_cpumask(node)) && (node !=3D local_node) ); =20 @@ -1205,10 +1205,10 @@ static unsigned int node_to_scrub(bool get_node) * then we'd need to take this lock every time we come in here. */ if ( (dist < shortest || closest =3D=3D NUMA_NO_NODE) && - !node_test_and_set(node, node_scrubbing) ) + !nodemask_test_and_set(node, &node_scrubbing) ) { if ( closest !=3D NUMA_NO_NODE ) - node_clear(closest, node_scrubbing); + nodemask_clear(closest, &node_scrubbing); shortest =3D dist; closest =3D node; } @@ -1360,7 +1360,7 @@ bool scrub_free_pages(void) spin_unlock(&heap_lock); =20 out_nolock: - node_clear(node, node_scrubbing); + nodemask_clear(node, &node_scrubbing); return node_to_scrub(false) !=3D NUMA_NO_NODE; } =20 @@ -2010,7 +2010,7 @@ static void __init scrub_heap_pages(void) continue; =20 last_distance =3D INT_MAX; - best_node =3D first_node(node_online_map); + best_node =3D nodemask_first(&node_online_map); /* Figure out which NODE CPUs are close. */ for_each_online_node ( j ) { diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 81dee5e472..3e569d6970 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1810,7 +1810,7 @@ csched_load_balance(struct csched_private *prv, int c= pu, } while( peer_cpu !=3D first_cpu ); =20 next_node: - peer_node =3D cycle_node(peer_node, node_online_map); + peer_node =3D nodemask_cycle(peer_node, &node_online_map); } while( peer_node !=3D node ); } =20 diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 765effde8d..c8c6805bb4 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -280,7 +280,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_s= ysctl) bool_t do_meminfo =3D !guest_handle_is_null(ni->meminfo); bool_t do_distance =3D !guest_handle_is_null(ni->distance); =20 - num_nodes =3D last_node(node_online_map) + 1; + num_nodes =3D nodemask_last(&node_online_map) + 1; =20 if ( do_meminfo || do_distance ) { diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 1605c1bcc5..ed918e4a8d 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -10,30 +10,30 @@ * * The available nodemask operations are: * - * void node_set(node, mask) turn on bit 'node' in mask + * void nodemask_set(node, mask) turn on bit 'node' in mask * void __nodemask_set(node, mask) turn on bit 'node' in mask (unlocked) - * void node_clear(node, mask) turn off bit 'node' in mask + * void nodemask_clear(node, mask) turn off bit 'node' in mask * void __nodemask_clear(node, mask) turn off bit 'node' in mask (unlocked) * bool nodemask_test(node, mask) true iff bit 'node' set in mask - * int node_test_and_set(node, mask) test and set bit 'node' in mask + * bool nodemask_test_and_set(node, mask) test and set bit 'node' in mask * - * void nodes_and(dst, src1, src2) dst =3D src1 & src2 [intersection] - * void nodes_or(dst, src1, src2) dst =3D src1 | src2 [union] - * void nodes_xor(dst, src1, src2) dst =3D src1 ^ src2 - * void nodes_andnot(dst, src1, src2) dst =3D src1 & ~src2 - * void nodes_complement(dst, src) dst =3D ~src + * void nodemask_and(dst, src1, src2) dst =3D src1 & src2 [intersection] + * void nodemask_or(dst, src1, src2) dst =3D src1 | src2 [union] + * void nodemask_xor(dst, src1, src2) dst =3D src1 ^ src2 + * void nodemask_andnot(dst, src1, src2)dst =3D src1 & ~src2 + * void nodemask_complement(dst, src) dst =3D ~src * - * int nodes_equal(mask1, mask2) Does mask1 =3D=3D mask2? - * int nodes_intersects(mask1, mask2) Do mask1 and mask2 intersect? - * int nodes_subset(mask1, mask2) Is mask1 a subset of mask2? - * int nodes_empty(mask) Is mask empty (no bits sets)? - * int nodes_full(mask) Is mask full (all bits sets)? - * int nodes_weight(mask) Hamming weight - number of set bits + * bool nodemask_equal(mask1, mask2) Does mask1 =3D=3D mask2? + * bool nodemask_intersects(mask1, mask2) Do mask1 and mask2 intersect? + * bool nodemask_subset(mask1, mask2) Is mask1 a subset of mask2? + * bool nodemask_empty(mask) Is mask empty (no bits sets)? + * bool nodemask_full(mask) Is mask full (all bits sets)? + * unsigned int nodemask_weight(mask) Hamming weight - number of set bits * - * int first_node(mask) Number lowest set bit, or MAX_NUMNODES - * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES - * int last_node(mask) Number highest set bit, or MAX_NUMNODES - * int cycle_node(node, mask) Next node cycling from 'node', or + * node nodemask_first(mask) Number lowest set bit, or MAX_NUMNODES + * node nodemask_next(node, mask) Next node past 'node', or MAX_NUMNODES + * node nodemask_last(mask) Number highest set bit, or MAX_NUMNODES + * node nodemask_cycle(node, mask) Next node cycling from 'node', or * MAX_NUMNODES * * nodemask_t NODEMASK_OF(node) Initializer - bit 'node' set @@ -43,7 +43,7 @@ * * for_each_node_mask(node, mask) for-loop node over mask * - * int num_online_nodes() Number of online Nodes + * unsigned int num_online_nodes() Number of online Nodes * * bool node_online(node) Is this node online? * @@ -96,10 +96,9 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } n= odemask_t; =20 #endif /* MAX_NUMNODES */ =20 -#define node_set(node, dst) __node_set((node), &(dst)) -static inline void __node_set(int node, volatile nodemask_t *dstp) +static inline void nodemask_set(unsigned int node, nodemask_t *dst) { - set_bit(node, dstp->bits); + set_bit(node, dst->bits); } =20 static inline void __nodemask_set(unsigned int node, nodemask_t *dst) @@ -107,10 +106,9 @@ static inline void __nodemask_set(unsigned int node, n= odemask_t *dst) __set_bit(node, dst->bits); } =20 -#define node_clear(node, dst) __node_clear((node), &(dst)) -static inline void __node_clear(int node, volatile nodemask_t *dstp) +static inline void nodemask_clear(unsigned int node, nodemask_t *dst) { - clear_bit(node, dstp->bits); + clear_bit(node, dst->bits); } =20 static inline void __nodemask_clear(unsigned int node, nodemask_t *dst) @@ -123,139 +121,117 @@ static inline bool nodemask_test(unsigned int node,= const nodemask_t *dst) return test_bit(node, dst->bits); } =20 -#define node_test_and_set(node, nodemask) \ - __node_test_and_set((node), &(nodemask)) -static inline int __node_test_and_set(int node, nodemask_t *addr) +static inline bool nodemask_test_and_set(unsigned int node, nodemask_t *ds= t) { - return test_and_set_bit(node, addr->bits); + return test_and_set_bit(node, dst->bits); } =20 -#define nodes_and(dst, src1, src2) \ - __nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES) -static inline void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline void nodemask_and(nodemask_t *dst, const nodemask_t *src1, + const nodemask_t *src2) { - bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); + bitmap_and(dst->bits, src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_or(dst, src1, src2) \ - __nodes_or(&(dst), &(src1), &(src2), MAX_NUMNODES) -static inline void __nodes_or(nodemask_t *dstp, const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline void nodemask_or(nodemask_t *dst, const nodemask_t *src1, + const nodemask_t *src2) { - bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); + bitmap_or(dst->bits, src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_xor(dst, src1, src2) \ - __nodes_xor(&(dst), &(src1), &(src2), MAX_NUMNODES) -static inline void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline void nodemask_xor(nodemask_t *dst, const nodemask_t *src1, + const nodemask_t *src2) { - bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); + bitmap_xor(dst->bits, src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_andnot(dst, src1, src2) \ - __nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES) -static inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1= p, - const nodemask_t *src2p, int nbits) +static inline void nodemask_andnot(nodemask_t *dst, const nodemask_t *src1, + const nodemask_t *src2) { - bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); + bitmap_andnot(dst->bits, src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_complement(dst, src) \ - __nodes_complement(&(dst), &(src), MAX_NUMNODES) -static inline void __nodes_complement(nodemask_t *dstp, - const nodemask_t *srcp, int nbits) +static inline void nodemask_complement(nodemask_t *dst, const nodemask_t *= src) { - bitmap_complement(dstp->bits, srcp->bits, nbits); + bitmap_complement(dst->bits, src->bits, MAX_NUMNODES); } =20 -#define nodes_equal(src1, src2) \ - __nodes_equal(&(src1), &(src2), MAX_NUMNODES) -static inline int __nodes_equal(const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline bool nodemask_equal(const nodemask_t *src1, + const nodemask_t *src2) { - return bitmap_equal(src1p->bits, src2p->bits, nbits); + return bitmap_equal(src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_intersects(src1, src2) \ - __nodes_intersects(&(src1), &(src2), MAX_NUMNODES) -static inline int __nodes_intersects(const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline bool nodemask_intersects(const nodemask_t *src1, + const nodemask_t *src2) { - return bitmap_intersects(src1p->bits, src2p->bits, nbits); + return bitmap_intersects(src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_subset(src1, src2) \ - __nodes_subset(&(src1), &(src2), MAX_NUMNODES) -static inline int __nodes_subset(const nodemask_t *src1p, - const nodemask_t *src2p, int nbits) +static inline bool nodemask_subset(const nodemask_t *src1, + const nodemask_t *src2) { - return bitmap_subset(src1p->bits, src2p->bits, nbits); + return bitmap_subset(src1->bits, src2->bits, MAX_NUMNODES); } =20 -#define nodes_empty(src) __nodes_empty(&(src), MAX_NUMNODES) -static inline int __nodes_empty(const nodemask_t *srcp, int nbits) +static inline bool nodemask_empty(const nodemask_t *src) { - return bitmap_empty(srcp->bits, nbits); + return bitmap_empty(src->bits, MAX_NUMNODES); } =20 -#define nodes_full(nodemask) __nodes_full(&(nodemask), MAX_NUMNODES) -static inline int __nodes_full(const nodemask_t *srcp, int nbits) +static inline bool nodemask_full(const nodemask_t *src) { - return bitmap_full(srcp->bits, nbits); + return bitmap_full(src->bits, MAX_NUMNODES); } =20 -#define nodes_weight(nodemask) __nodes_weight(&(nodemask), MAX_NUMNODES) -static inline int __nodes_weight(const nodemask_t *srcp, int nbits) +static inline unsigned int nodemask_weight(const nodemask_t *src) { - return bitmap_weight(srcp->bits, nbits); + return bitmap_weight(src->bits, MAX_NUMNODES); } =20 /* FIXME: better would be to fix all architectures to never return > MAX_NUMNODES, then the silly min_ts could be dropped. */ =20 -#define first_node(src) __first_node(&(src), MAX_NUMNODES) -static inline int __first_node(const nodemask_t *srcp, int nbits) +static inline unsigned int nodemask_first(const nodemask_t *src) { - return min_t(int, nbits, find_first_bit(srcp->bits, nbits)); + return min_t(unsigned int, MAX_NUMNODES, + find_first_bit(src->bits, MAX_NUMNODES)); } =20 -#define next_node(n, src) __next_node((n), &(src), MAX_NUMNODES) -static inline int __next_node(int n, const nodemask_t *srcp, int nbits) +static inline unsigned int nodemask_next(unsigned int n, const nodemask_t = *src) { - return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1)); + return min_t(unsigned int, MAX_NUMNODES, + find_next_bit(src->bits, MAX_NUMNODES, n + 1)); } =20 -#define last_node(src) __last_node(&(src), MAX_NUMNODES) -static inline int __last_node(const nodemask_t *srcp, int nbits) +static inline unsigned int nodemask_last(const nodemask_t *src) { - int node, pnode =3D nbits; - for (node =3D __first_node(srcp, nbits); - node < nbits; - node =3D __next_node(node, srcp, nbits)) - pnode =3D node; - return pnode; + unsigned int node, pnode =3D MAX_NUMNODES; + + for ( node =3D nodemask_first(src); + node < MAX_NUMNODES; node =3D nodemask_next(node, src) ) + pnode =3D node; + + return pnode; } =20 -#define cycle_node(n, src) __cycle_node((n), &(src), MAX_NUMNODES) -static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits) +static inline unsigned int nodemask_cycle(unsigned int n, const nodemask_t= *src) { - int nxt =3D __next_node(n, maskp, nbits); + unsigned int nxt =3D nodemask_next(n, src); + + if ( nxt =3D=3D MAX_NUMNODES ) + nxt =3D nodemask_first(src); =20 - if (nxt =3D=3D nbits) - nxt =3D __first_node(maskp, nbits); return nxt; } =20 #if MAX_NUMNODES > 1 #define for_each_node_mask(node, mask) \ - for ((node) =3D first_node(mask); \ + for ((node) =3D nodemask_first(mask); \ (node) < MAX_NUMNODES; \ - (node) =3D next_node((node), (mask))) + (node) =3D nodemask_next(node, mask)) #else /* MAX_NUMNODES =3D=3D 1 */ #define for_each_node_mask(node, mask) \ - if (!nodes_empty(mask)) \ + if ( !nodemask_empty(mask) ) \ for ((node) =3D 0; (node) < 1; (node)++) #endif /* MAX_NUMNODES */ =20 @@ -267,16 +243,16 @@ static inline int __cycle_node(int n, const nodemask_= t *maskp, int nbits) extern nodemask_t node_online_map; =20 #if MAX_NUMNODES > 1 -#define num_online_nodes() nodes_weight(node_online_map) +#define num_online_nodes() nodemask_weight(&node_online_map) #define node_online(node) nodemask_test(node, &node_online_map) #else -#define num_online_nodes() 1 +#define num_online_nodes() 1U #define node_online(node) ((node) =3D=3D 0) #endif =20 -#define node_set_online(node) set_bit((node), node_online_map.bits) -#define node_set_offline(node) clear_bit((node), node_online_map.bits) +#define node_set_online(node) set_bit(node, node_online_map.bits) +#define node_set_offline(node) clear_bit(node, node_online_map.bits) =20 -#define for_each_online_node(node) for_each_node_mask((node), node_online_= map) +#define for_each_online_node(node) for_each_node_mask(node, &node_online_m= ap) =20 #endif /* __LINUX_NODEMASK_H */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Mon Apr 29 05:41:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564403329; cv=none; d=zoho.com; s=zohoarc; b=GB1unlXewuG/3o6af/2HZGrBmZ283u5wMQJvRJv11721Uapi1/COYpMLACHT1MY5UyuAE6ypwjsBY5LVlZ9SOtLIXjaeGo+46O7B517Ch531dgU1SHfDXJm75+gm2xuY1o8ZJJLzPNR+Viwufp7thHiSzx+a7eNK8z2Wx1sBKJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564403329; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/d4FWnnKd3c4PN7XAlGzjSf3SfavfX6URixY7pP7FTY=; b=nWsjtrabm/Ht7t6z9yPGMo3UJahax4mkIXhlXiG/eS5FzMid6MDzR2o3voJuBZqrpjRVc71KLB4ZMAdcfaUwvuEamZT1lECTjPoLUE8tLyaiItdb3Pk1x2bED8Bv4KcGEKDOeFN/V8AzYNmqqZwNs7qhk3J2wtKGn5nCD6KZMOE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564403329645733.3416727277236; Mon, 29 Jul 2019 05:28:49 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4ki-0000Oa-7v; Mon, 29 Jul 2019 12:27:44 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs4kh-0000OS-1H for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 12:27:43 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 41b78d26-b1fc-11e9-b8e9-275bf5d2db5d; Mon, 29 Jul 2019 12:27:40 +0000 (UTC) X-Inumbo-ID: 41b78d26-b1fc-11e9-b8e9-275bf5d2db5d Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: cX8Z9eJmHgeoWhosIk17timF7Tx0EqaEmf8wj0OKTMn68TGeNqg/UigVzITaTo6khbTHVcxQx0 Un+6cn+JD3VYfiZ8YtrHc458GayN3Oy2TgcJpiANrzCEvps5TutR1TGdJuJ7z6/w+gygSXyT/P n2OsS5d4a5nZEgRMDpWGxpFC5pck45ahG+UNYa2FhgBz8sxwXkQDEZN89uc+NkIQC3sMYtjUwF l/eDeWJw1hE5essiW2Jqc8g0jOD6ZEV5u344XuVl0RkRFgeJ0cSITMSOunsXFd9zEN5glOY6s8 z0Q= X-SBRS: 2.7 X-MesageID: 3565566 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,322,1559534400"; d="scan'208";a="3565566" From: Andrew Cooper To: Xen-devel Date: Mon, 29 Jul 2019 13:12:04 +0100 Message-ID: <20190729121204.13559-11-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190729121204.13559-1-andrew.cooper3@citrix.com> References: <20190729121204.13559-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 10/10] xen/nodemask: Drop remaining refeces to linux X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This file has now diverged completely from its Linux roots. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk --- xen/include/xen/nodemask.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index ed918e4a8d..be4016e571 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -1,11 +1,11 @@ -#ifndef __LINUX_NODEMASK_H -#define __LINUX_NODEMASK_H +#ifndef XEN_NODEMASK_H +#define XEN_NODEMASK_H =20 /* * Nodemasks provide a bitmap suitable for representing the * set of Node's in a system, one bit position per Node number. * - * See detailed comments in the file linux/bitmap.h describing the + * See detailed comments in the file xen/bitmap.h describing the * data type on which these nodemasks are based. * * The available nodemask operations are: @@ -255,4 +255,13 @@ extern nodemask_t node_online_map; =20 #define for_each_online_node(node) for_each_node_mask(node, &node_online_m= ap) =20 -#endif /* __LINUX_NODEMASK_H */ +#endif /* XEN_NODEMASK_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel