From: <wang.yi59@zte.com.cn>
To: <yury.norov@gmail.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<andriy.shevchenko@linux.intel.com>, <linux@rasmusvillemoes.dk>,
<linux-kernel@vger.kernel.org>, <xue.zhihong@zte.com.cn>,
<wang.liang82@zte.com.cn>, <Liu.Jianjun3@zte.com.cn>,
<yury.norov@gmail.com>
Subject: Re:[PATCH] bitmap: fix a unproper remap when mpol_rebind_nodemask()
Date: Wed, 15 Jun 2022 16:54:47 +0800 (CST) [thread overview]
Message-ID: <202206151654471905256@zte.com.cn> (raw)
In-Reply-To: <CAAH8bW_GCviYSadmf5CUxgJixkXbq+SfL63ZJt7Lsm9OAmPjVQ@mail.gmail.com>
> On Mon, Jun 13, 2022 at 8:45 PM <wang.yi59@zte.com.cn> wrote:
> >
> >
> > - change the bitmap_remap() as this patch did, but this changed the
> > behavior of this routine which looks does the right thing. One good
> > news is this function is only called by mpol_rebind_nodemask().
>
> There are users of bitmap_remap() in drivers/gpio/gpio-xilinx.c
>
> > - don't change the bitmap_remap(), to be honest, I didn't figure out
> > a way. Any suggestions?
>
> I haven't had a chance to play with it (because of my dayjob), but I
> have a strong feeling that the proper solution should come from
> existing functionality.
>
> Did you experiment with MPOL_F_{STATIC,RELATIVE}_NODES?
> Those flags enable nodes_and() and mpol_relative_nodemask()
> paths correspondingly.
>
You are right, adding MPOL_F_STATIC_NODES can fix this situation. So it
seems that we don't need to do anything in kernel now.
Many thanks for your time :)
> What I suggested is:
>
> 328 node_clear(1, pol->w.cpuset_mems_allowed);
> 329 node_clear(3, pol->w.cpuset_mems_allowed);
> 330 nodes_remap(tmp, pol->nodes, pol->w.cpuset_mems_allowed,
> 331 *nodes);
> 332 pol->w.cpuset_mems_allowed = *nodes;
>
> > In the example above, if set cpuset.mems to 0,2 firstly, the nodes
> > binds will change from 1 to 2. And then set cpuset.mems to 1,3, it will
> > change from 2 to 3 again.
---
Best wishes
Yi Wang
prev parent reply other threads:[~2022-06-15 8:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 11:29 [PATCH] bitmap: fix a unproper remap when mpol_rebind_nodemask() Yi Wang
2022-06-13 19:20 ` Yury Norov
2022-06-14 3:45 ` wang.yi59
2022-06-14 16:40 ` [PATCH] " Yury Norov
2022-06-14 16:50 ` Andy Shevchenko
2022-06-15 8:54 ` wang.yi59 [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=202206151654471905256@zte.com.cn \
--to=wang.yi59@zte.com.cn \
--cc=Liu.Jianjun3@zte.com.cn \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=wang.liang82@zte.com.cn \
--cc=xue.zhihong@zte.com.cn \
--cc=yury.norov@gmail.com \
/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.