lkml.org 
[lkml]   [2022]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-08-05 09:25    [W:0.093 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site