[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210426175217.GD1741690@redhat.com>
Date: Mon, 26 Apr 2021 13:52:17 -0400
From: Vivek Goyal <vgoyal@...hat.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-fsdevel@...r.kernel.org, linux-nvdimm@...ts.01.org,
dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
virtio-fs@...hat.com, miklos@...redi.hu, jack@...e.cz,
slp@...hat.com, groug@...d.org
Subject: Re: [PATCH v4 1/3] dax: Add an enum for specifying dax wakup mode
On Mon, Apr 26, 2021 at 02:46:32PM +0100, Matthew Wilcox wrote:
> On Fri, Apr 23, 2021 at 09:07:21AM -0400, Vivek Goyal wrote:
> > +enum dax_wake_mode {
> > + WAKE_NEXT,
> > + WAKE_ALL,
> > +};
>
> Why define them in this order when ...
>
> > @@ -196,7 +207,7 @@ static void dax_wake_entry(struct xa_state *xas, void *entry, bool wake_all)
> > * must be in the waitqueue and the following check will see them.
> > */
> > if (waitqueue_active(wq))
> > - __wake_up(wq, TASK_NORMAL, wake_all ? 0 : 1, &key);
> > + __wake_up(wq, TASK_NORMAL, mode == WAKE_ALL ? 0 : 1, &key);
>
> ... they're used like this? This is almost as bad as
>
> enum bool {
> true,
> false,
> };
Hi Matthew,
So you prefer that I should switch order of WAKE_NEXT and WAKE_ALL?
enum dax_wake_mode {
WAKE_ALL,
WAKE_NEXT,
};
And then do following to wake task.
if (waitqueue_active(wq))
__wake_up(wq, TASK_NORMAL, mode, &key);
I am fine with this if you like this better.
Or you are suggesting that don't introduce "enum dax_wake_mode" to
begin with.
Vivek
Powered by blists - more mailing lists