From: Jens Axboe <axboe@kernel.dk>
To: Dominique Martinet <asmadeus@codewreck.org>
Cc: Christian Schoenebeck <linux_oss@crudebyte.com>,
Eric Van Hensbergen <ericvh@kernel.org>,
netdev <netdev@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>,
Pengfei Xu <pengfei.xu@intel.com>,
v9fs-developer@lists.sourceforge.net
Subject: Re: [PATCH v2] 9p/client: don't assume signal_pending() clears on recalc_sigpending()
Date: Mon, 6 Feb 2023 15:56:01 -0700 [thread overview]
Message-ID: <68954e9a-00fc-8313-b76a-e1d336c84909@kernel.dk> (raw)
In-Reply-To: <Y+F/YSjhcQax1bMm@codewreck.org>
On 2/6/23 3:29?PM, Dominique Martinet wrote:
>>> Hm, schedule_delayed_work on the last fput, ok.
>>> I was wondering what it had to do with the current 9p thread, but since
>>> it's not scheduled on a particular cpu it can pick another cpu to wake
>>> up, that makes sense -- although conceptually it feels rather bad to
>>> interrupt a remote IO because of a local task that can be done later;
>>> e.g. between having the fput wait a bit, or cancel a slow operation like
>>> a 1MB write, I'd rather make the fput wait.
>>> Do you know why that signal/interrupt is needed in the first place?
>>
>> It's needed if the task is currently sleeping in the kernel, to abort a
>> sleeping loop. The task_work may contain actions that will result in the
>> sleep loop being satisfied and hence ending, which means it needs to be
>> processed. That's my worry with the check-and-clear, then reset state
>> solution.
>
> I see, sleeping loop might not wake up until the signal is handled, but
> it won't handle it if we don't get out.
Exactly
> Not bailing out on sigkill is bad enough but that's possibly much worse
> indeed... And that also means the busy loop isn't any better, I was
> wondering how it was noticed if it was just a few busy checks but in
> that case just temporarily clearing the flag won't get out either,
> that's not even a workaround.
>
> I assume that also explains why it wants that task, and cannot just run
> from the idle context-- it's not just any worker task, it's in the
> process context? (sorry for using you as a rubber duck...)
Right, it needs to run in the context of the right task. So we can't
just punt it out-of-line to something else, whihc would obviously also
solve that dependency loop.
>>> I'll setup some uring IO on 9p and see if I can produce these.
>>
>> I'm attaching a test case. I don't think it's particularly useful, but
>> it does nicely demonstrate the infinite loop that 9p gets into if
>> there's task_work pending.
>
> Thanks, that helps!
> I might not have time until weekend but I'll definitely look at it.
Sounds good, thanks! I'll consider my patch abandoned and wait for what
you have.
--
Jens Axboe
prev parent reply other threads:[~2023-02-06 22:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 16:04 [PATCH v2] 9p/client: don't assume signal_pending() clears on recalc_sigpending() Jens Axboe
2023-02-05 10:02 ` Dominique Martinet
2023-02-06 20:19 ` Jens Axboe
2023-02-06 21:42 ` Dominique Martinet
2023-02-06 21:56 ` Jens Axboe
2023-02-06 21:58 ` Jens Axboe
2023-02-06 22:29 ` Dominique Martinet
2023-02-06 22:56 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=68954e9a-00fc-8313-b76a-e1d336c84909@kernel.dk \
--to=axboe@kernel.dk \
--cc=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux_oss@crudebyte.com \
--cc=netdev@vger.kernel.org \
--cc=pengfei.xu@intel.com \
--cc=v9fs-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.