[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1826d5c4a90.282ac4bf118702.5300662644268737477@siddh.me>
Date: Fri, 05 Aug 2022 15:05:41 +0530
From: Siddh Raman Pant <code@...dh.me>
To: "Eric Biggers" <ebiggers@...nel.org>
Cc: "christophe.jaillet" <christophe.jaillet@...adoo.fr>,
"corbet" <corbet@....net>, "dhowells" <dhowells@...hat.com>,
"edumazet" <edumazet@...gle.com>,
"linux-kernel-mentees"
<linux-kernel-mentees@...ts.linuxfoundation.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>,
"mchehab" <mchehab@...nel.org>, "rdunlap" <rdunlap@...radead.org>
Subject: Re: [PATCH v2 3/3] kernel/watch_queue: Remove wqueue->defunct and
use pipe for clear check
On Fri, 05 Aug 2022 12:54:31 +0530 Eric Biggers wrote:
> Why is the READ_ONCE() needed? Doesn't wqueue->lock protect wqueue->pipe?
We are changing the pointer while a notification can be potentially waiting to
be posted to the pipe. So a barrier is needed to prevent compiler magic from
reloading the value.
This was remarked by David Howells here:
https://lore.kernel.org/lkml/3558070.1658933200@warthog.procyon.org.uk/
> This isn't the correct block comment format; it should look like:
>
> /*
> * This pipe will get freed by the caller free_pipe_info().
> * Removing this reference also prevents new notifications.
> */
>
> - Eric
>
Okay, will make the change.
Thanks,
Siddh
Powered by blists - more mailing lists