[PATCH 0/3] kernel/watch_queue: Clean up some code

Siddh Raman Pant posted 3 patches 3 years, 8 months ago
include/linux/watch_queue.h | 95 +++++++++++++++++++++++++++----------
kernel/watch_queue.c        | 11 ++---
2 files changed, 75 insertions(+), 31 deletions(-)
[PATCH 0/3] kernel/watch_queue: Clean up some code
Posted by Siddh Raman Pant 3 years, 8 months ago
There is a dangling reference to pipe in a watch_queue after clearing it.
Thus, NULL that pointer while clearing. This can be thought of as a v4 of
the patches I had sent earlier.

This change renders wqueue->defunct superfluous, as the latter is only used
to check if watch_queue is cleared. With this change, the pipe is NULL'd
while clearing, so we can just check if the pipe is NULL.

Extending comment for watch_queue->pipe in the definition of watch_queue
made the comment conventionally too long (it was already past 80 chars),
so I have changed the struct annotations to be doxygen-styled, so that
I can extend the comment mentioning that the pipe is NULL when watch_queue
is cleared.

Siddh Raman Pant (3):
  kernel/watch_queue: Remove dangling pipe reference while clearing
    watch_queue
  kernel/watch_queue: Improve struct annotation formatting
  kernel/watch_queue: Remove wqueue->defunct and use pipe for clear
    check

 include/linux/watch_queue.h | 95 +++++++++++++++++++++++++++----------
 kernel/watch_queue.c        | 11 ++---
 2 files changed, 75 insertions(+), 31 deletions(-)

-- 
2.35.1
Re: [PATCH 0/3] kernel/watch_queue: Clean up some code
Posted by Eric Biggers 3 years, 8 months ago
On Thu, Aug 04, 2022 at 07:00:21PM +0530, Siddh Raman Pant wrote:
> There is a dangling reference to pipe in a watch_queue after clearing it.
> Thus, NULL that pointer while clearing. This can be thought of as a v4 of
> the patches I had sent earlier.
> 
> This change renders wqueue->defunct superfluous, as the latter is only used
> to check if watch_queue is cleared. With this change, the pipe is NULL'd
> while clearing, so we can just check if the pipe is NULL.
> 
> Extending comment for watch_queue->pipe in the definition of watch_queue
> made the comment conventionally too long (it was already past 80 chars),
> so I have changed the struct annotations to be doxygen-styled, so that
> I can extend the comment mentioning that the pipe is NULL when watch_queue
> is cleared.
> 
> Siddh Raman Pant (3):
>   kernel/watch_queue: Remove dangling pipe reference while clearing
>     watch_queue
>   kernel/watch_queue: Improve struct annotation formatting
>   kernel/watch_queue: Remove wqueue->defunct and use pipe for clear
>     check
> 
>  include/linux/watch_queue.h | 95 +++++++++++++++++++++++++++----------
>  kernel/watch_queue.c        | 11 ++---
>  2 files changed, 75 insertions(+), 31 deletions(-)

I think patches 1 and 3 should be merged together.

Also, please use a consistent version number for all patches in the series.  You
have a version 1, version 2, and version 4 patch all in the same series, which
is very confusing.

- Eric
Re: [PATCH 0/3] kernel/watch_queue: Clean up some code
Posted by Siddh Raman Pant 3 years, 8 months ago
On Fri, 05 Aug 2022 12:46:17 +0530  Eric Biggers  wrote:
> I think patches 1 and 3 should be merged together.
> 
> Also, please use a consistent version number for all patches in the series.  You
> have a version 1, version 2, and version 4 patch all in the same series, which
> is very confusing.
> 
> - Eric
> 

Will do.

Sorry for the confusion.

Thanks,
Siddh