All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: StefanoStabellini <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	"George Dunlap" <george.dunlap@eu.citrix.com>,
	"Julien Grall" <julien.grall@arm.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v3 09/10] xen/nodemask: Sanitise the remainder of the nodemask API
Date: Tue, 30 Jul 2019 11:43:12 +0000	[thread overview]
Message-ID: <bb272ab1-c63c-0d5a-9360-d7a8a22ee52e@suse.com> (raw)
In-Reply-To: <20190729121204.13559-10-andrew.cooper3@citrix.com>

On 29.07.2019 14:12, Andrew Cooper wrote:
> --- 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_mem_affinity *ma)
>   	if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) {
>   		struct node *nd = &nodes[node];
>   
> -		if (!node_test_and_set(node, memory_nodes_parsed)) {
> +		if (!nodemask_test_and_set(node, &memory_nodes_parsed)) {

Shouldn't this have become __nodemask_test_and_set() already in the
previous patch (with the leading underscores taken care of in
whatever way we decide there)?

> @@ -376,7 +376,7 @@ static int __init nodes_cover_memory(void)
>   
>   		do {
>   			found = 0;
> -			for_each_node_mask(j, memory_nodes_parsed)
> +			for_each_node_mask( j, &memory_nodes_parsed )

Here and elsewhere - if you add the inner blanks, then there also
wants to be a blank ahead of the opening parenthesis.

> @@ -1171,7 +1171,7 @@ static unsigned int node_to_scrub(bool get_node)
>           node = 0;
>   
>       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;
>   
>       /*
> @@ -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 == NUMA_NO_NODE) &&
> -                 !node_test_and_set(node, node_scrubbing) )
> +                 !nodemask_test_and_set(node, &node_scrubbing) )
>               {
>                   if ( closest != NUMA_NO_NODE )
> -                    node_clear(closest, node_scrubbing);
> +                    nodemask_clear(closest, &node_scrubbing);
>                   shortest = dist;
>                   closest = node;
>               }
> @@ -1360,7 +1360,7 @@ bool scrub_free_pages(void)
>       spin_unlock(&heap_lock);
>   
>    out_nolock:
> -    node_clear(node, node_scrubbing);
> +    nodemask_clear(node, &node_scrubbing);

Seeing this happen after dropping the heap lock, I think the two
nodemask_test_and_set() that I've left in context above could be
converted to their non-locked counterparts at this occasion (or
again in the previous patch).

>   #if MAX_NUMNODES > 1
>   #define for_each_node_mask(node, mask)			\
> -	for ((node) = first_node(mask);			\
> +	for ((node) = nodemask_first(mask);		\
>   		(node) < MAX_NUMNODES;			\
> -		(node) = next_node((node), (mask)))
> +		(node) = nodemask_next(node, mask))
>   #else /* MAX_NUMNODES == 1 */
>   #define for_each_node_mask(node, mask)			\
> -	if (!nodes_empty(mask))				\
> +	if ( !nodemask_empty(mask) )			\
>   		for ((node) = 0; (node) < 1; (node)++)
>   #endif /* MAX_NUMNODES */

Further up in the file you did also replace tabs and insert spaces.
Would you mind doing this here as well (I notice you've adjusted
the if() already, but left the for()s alone).

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-07-30 11:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 12:11 [Xen-devel] [PATCH v3 00/10] xen/nodemask: API cleanup and fixes Andrew Cooper
2019-07-29 12:11 ` [Xen-devel] [PATCH v3 01/10] page-alloc: Clamp get_free_buddy() to online nodes Andrew Cooper
2019-07-29 15:48   ` Jan Beulich
2019-07-29 17:26     ` Andrew Cooper
2019-07-30  8:09       ` Jan Beulich
2019-07-30 17:32         ` Andrew Cooper
2019-07-31  8:22           ` Jan Beulich
2019-07-31  9:01             ` Andrew Cooper
2019-07-29 12:11 ` [Xen-devel] [PATCH v3 02/10] xen/bitmap: Drop {bitmap, cpumask, nodes}_shift_{left, right}() Andrew Cooper
2019-07-29 15:50   ` Jan Beulich
2019-07-29 12:11 ` [Xen-devel] [PATCH v3 03/10] xen/nodemask: Drop any_online_node() and first_unset_node() Andrew Cooper
2019-07-29 15:51   ` Jan Beulich
2019-07-29 12:11 ` [Xen-devel] [PATCH v3 04/10] xen/mask: Convert {cpu, node}mask_test() to be static inline Andrew Cooper
2019-07-30  8:52   ` Jan Beulich
2019-07-30  9:03     ` Andrew Cooper
2019-07-29 12:11 ` [Xen-devel] [PATCH v3 05/10] xen/cpumask: Introduce a CPUMASK_PR() wrapper for printing Andrew Cooper
2019-07-30  8:55   ` Jan Beulich
2019-07-29 12:12 ` [Xen-devel] [PATCH v3 06/10] xen/nodemask: Introduce a NODEMASK_PR() " Andrew Cooper
2019-07-30  8:58   ` Jan Beulich
2019-07-30  9:09     ` Andrew Cooper
2019-07-29 12:12 ` [Xen-devel] [PATCH v3 07/10] xen/nodemask: Drop nodes_{setall, clear}() and improve the initialisers Andrew Cooper
2019-07-30  9:44   ` Jan Beulich
2019-07-31 12:49     ` Andrew Cooper
2019-07-31 13:12       ` Jan Beulich
2019-07-31 13:32         ` Andrew Cooper
2019-07-29 12:12 ` [Xen-devel] [PATCH v3 08/10] xen/nodemask: Introduce unlocked __nodemask_{set, clear}() helpers Andrew Cooper
2019-07-30 11:26   ` Jan Beulich
2019-07-30 17:48     ` Andrew Cooper
2019-07-31  8:41       ` Jan Beulich
2019-07-29 12:12 ` [Xen-devel] [PATCH v3 09/10] xen/nodemask: Sanitise the remainder of the nodemask API Andrew Cooper
2019-07-30 11:43   ` Jan Beulich [this message]
2019-07-29 12:12 ` [Xen-devel] [PATCH v3 10/10] xen/nodemask: Drop remaining refeces to linux Andrew Cooper
2019-07-30 11:44   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb272ab1-c63c-0d5a-9360-d7a8a22ee52e@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.