Messages in this thread | | | Date | Fri, 5 Aug 2022 00:24:31 -0700 | From | Eric Biggers <> | Subject | Re: [PATCH v2 3/3] kernel/watch_queue: Remove wqueue->defunct and use pipe for clear check |
| |
On Thu, Aug 04, 2022 at 08:11:52PM +0530, Siddh Raman Pant wrote: > static inline bool lock_wqueue(struct watch_queue *wqueue) > { > spin_lock_bh(&wqueue->lock); > - if (unlikely(wqueue->defunct)) { > + if (unlikely(!READ_ONCE(wqueue->pipe))) { > spin_unlock_bh(&wqueue->lock); > return false; > }
Why is the READ_ONCE() needed? Doesn't wqueue->lock protect wqueue->pipe?
> + /* This pipe will get freed by the caller free_pipe_info(). > + * Removing this reference also prevents new notifications. > + */
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
| |