[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f9c6f92-7160-46b1-86ee-2a4233c7860f@kernel.dk>
Date: Fri, 3 May 2024 13:36:38 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Breno Leitao <leitao@...ian.org>, Pavel Begunkov <asml.silence@...il.com>
Cc: leit@...a.com, "open list:IO_URING" <io-uring@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] io_uring/io-wq: Use set_bit() and test_bit() at
worker->flags
On 5/3/24 1:24 PM, Christophe JAILLET wrote:
> Le 03/05/2024 ? 20:41, Jens Axboe a ?crit :
>> On 5/3/24 11:37 AM, Breno Leitao wrote:
>>> @@ -631,7 +631,8 @@ static int io_wq_worker(void *data)
>>> bool exit_mask = false, last_timeout = false;
>>> char buf[TASK_COMM_LEN];
>>> - worker->flags |= (IO_WORKER_F_UP | IO_WORKER_F_RUNNING);
>>> + set_bit(IO_WORKER_F_UP, &worker->flags);
>>> + set_bit(IO_WORKER_F_RUNNING, &worker->flags);
>>
>> You could probably just use WRITE_ONCE() here with the mask, as it's
>> setup side.
>>
>
> Or simply:
> set_mask_bits(&worker->flags, 0, IO_WORKER_F_UP | IO_WORKER_F_RUNNING);
Looks like overkill, as we don't really need that kind of assurances
here. WRITE_ONCE should be fine. Not that it _really_ matters as it's
not a performance critical part, but it also sends wrong hints to the
reader of the code on which kind of guarantees are needing here.
--
Jens Axboe
Powered by blists - more mailing lists