From: Jens Axboe <axboe@kernel.dk>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>, tglx@linutronix.de
Subject: Re: [PATCH] task_work: allow TWA_SIGNAL without a rescheduling IPI
Date: Thu, 28 Apr 2022 06:21:25 -0600 [thread overview]
Message-ID: <bf6cc541-4de7-3258-ebb8-caa3a8249bc7@kernel.dk> (raw)
In-Reply-To: <20220428090836.GQ2731@worktop.programming.kicks-ass.net>
On 4/28/22 3:08 AM, Peter Zijlstra wrote:
> On Mon, Apr 25, 2022 at 07:52:31PM -0600, Jens Axboe wrote:
>> On 4/22/22 8:34 AM, Jens Axboe wrote:
>>> Some use cases don't always need an IPI when sending a TWA_SIGNAL
>>> notification. Add TWA_SIGNAL_NO_IPI, which is just like TWA_SIGNAL,
>>> except it doesn't send an IPI to the target task. It merely sets
>>> TIF_NOTIFY_SIGNAL and wakes up the task.
>
> Could you perphaps elaborate on those use-cases? How do they guarantee
> the task_work is ran before userspace?
The task is still marked as having task_work, so there should be no
differences in how it's run before returning to userspace. That would
not have delivered an IPI before, if it was in the kernel.
The difference would be in the task currently running in userspace, and
whether we force a reschedule to ensure the task_work gets run now.
Without the forced reschedule, running of the task_work (from io_uring)
becomes more cooperative - it'll happen when the task transitions to the
kernel anyway (eg to wait for events).
--
Jens Axboe
next prev parent reply other threads:[~2022-04-28 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 14:34 [PATCH] task_work: allow TWA_SIGNAL without a rescheduling IPI Jens Axboe
2022-04-26 1:52 ` Jens Axboe
2022-04-28 9:08 ` Peter Zijlstra
2022-04-28 12:21 ` Jens Axboe [this message]
2022-04-28 22:28 ` Thomas Gleixner
2022-04-28 22:30 ` Jens Axboe
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=bf6cc541-4de7-3258-ebb8-caa3a8249bc7@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox