mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Oscar Salvador <osalvador@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] include/linux/nodemask.h: Use nr_node_ids instead of MAX_NUMNODES in nodemask_pr_args
Date: Tue, 18 Dec 2018 16:41:18 -0500	[thread overview]
Message-ID: <8f6a310d-6609-fa1e-114d-32043eb22aea@redhat.com> (raw)
In-Reply-To: <20181218124113.c5179c675dd217be7bed7d80@linux-foundation.org>

On 12/18/2018 03:41 PM, Andrew Morton wrote:
> On Tue, 18 Dec 2018 12:30:31 -0500 Waiman Long <longman@redhat.com> wrote:
>
>> When viewing the /proc/<pid>/status file, one can see output lines like
>>
>>   Cpus_allowed:	ffffffff,ffffffff,ffffffff
>>   Cpus_allowed_list:	0-95
>>   Mems_allowed:	00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f
>>   Mems_allowed_list:	0-3
> Oh dear.
>
>> It looks really strange that so many bits are displayed in the
>> "Mems_allowed:" line.  Whereas the "Cpus_allowed:" line is perfectly
>> fine.
>>
>> It is because the nodemask_pr_args() macro uses MAX_NUMNODES as the
>> number of nodes to iterate. The cpumask_pr_args() macro uses nr_cpu_ids
>> instead of MAX_CPUS. For nodes, there is a corresponding nr_node_ids.
>> So it makes sense to use nr_node_ids instead to be consistent with
>> "Cpus_allowed:".
>>
>> With that change, the "Mems_allowed:" line becomes
>>
>>   Mems_allowed:	f
> OK, I guess.  There is a risk of breaking existing userspace, but any
> half-decent parser should treat the above as equivalent.
>
> However there are quite a lot of nodemask_pr_args() callers in the tree
> and this patch potentially changes behaviour at all those sites. 
> Please work through all those callers and show how the output is
> altered so we can consider the patch's complete effect.
>
>
The /proc/<pid>/status file is the only one that will be affected by
this patch. I believe the "Mems_allowed_list" is what most users are
using, not the "Mems_allowed".

Cheers,
Longman


      reply	other threads:[~2018-12-18 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 17:30 Waiman Long
2018-12-18 20:41 ` Andrew Morton
2018-12-18 21:41   ` Waiman Long [this message]

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=8f6a310d-6609-fa1e-114d-32043eb22aea@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osalvador@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®