[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y991H+54aoY6pH8s@corigine.com>
Date: Sun, 5 Feb 2023 10:21:35 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: netdev <netdev@...r.kernel.org>, Jakub Kicinski <kuba@...nel.org>,
Pengfei Xu <pengfei.xu@...el.com>
Subject: Re: [PATCH] 9p/client: don't assume signal_pending() clears on
recalc_sigpending()
On Fri, Feb 03, 2023 at 07:02:42AM -0700, Jens Axboe wrote:
> signal_pending() really means that an exit to userspace is required to
> clear the condition, as it could be either an actual signal, or it could
> be TWA_SIGNAL based task_work that needs processing. The 9p client
> does a recalc_sigpending() to take care of the former, but that still
> leaves TWA_SIGNAL task_work. The result is that if we do have TWA_SIGNAL
> task_work pending, then we'll sit in a tight loop spinning as
> signal_pending() remains true even after recalc_sigpending().
>
> Move the signal_pending() logic into a helper that deals with both.
>
> Link: https://lore.kernel.org/lkml/Y9TgUupO5C39V%2FDW@xpf.sh.intel.com/
> Reported-and-tested-by: Pengfei Xu <pengfei.xu@...el.com>
> Signed-off-by: Jens Axboe <axboe@...nel.dk>
>
> ---
>
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 622ec6a586ee..7d9b9c150d47 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
...
> @@ -652,6 +653,28 @@ static struct p9_req_t *p9_client_prepare_req(struct p9_client *c,
> return ERR_PTR(err);
> }
>
> +static bool p9_sigpending(void)
> +{
> + if (!signal_pending(current))
> + return false;
> +
> + /*
> + * signal_pending() could mean either a real signal pending, or
> + * TWA_SIGNAL based task_work that needs processing. Don't return
> + * true for just the latter, run and clear it before a wait.
> + */
nit:
/* Multi-line comments in networking code,
* are like this.
*/
...
Powered by blists - more mailing lists