From: Mikulas Patocka <mpatocka@redhat.com>
To: Li Lingfeng <lilingfeng3@huawei.com>
Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org,
torvalds@linux-foundation.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev,
msnitzer@redhat.com, ignat@cloudflare.com,
damien.lemoal@wdc.com, houtao1@huawei.com, nhuck@google.com,
peterz@infradead.org, yukuai3@huawei.com, yangerkun@huawei.com,
yi.zhang@huawei.com, lilingfeng@huaweicloud.com
Subject: Re: [PATCH 6.6] Revert "dm-crypt, dm-verity: disable tasklets"
Date: Mon, 15 Apr 2024 17:04:52 +0200 (CEST) [thread overview]
Message-ID: <3bc637b9-f7b4-aef6-74a8-5066d0d646f3@redhat.com> (raw)
In-Reply-To: <4e5e4634-a2d0-ce35-3884-829d385c0879@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]
On Fri, 12 Apr 2024, Li Lingfeng wrote:
> Hi
>
> I'm having difficulty understanding "Workqueues and ksoftirqd may be scheduled
> arbitrarily".
> This is my understanding:
> kcryptd_queue_crypt
> tasklet_schedule
> __tasklet_schedule
> __tasklet_schedule_common
> raise_softirq_irqoff
> wakeup_softirqd
> wake_up_process // ksoftirqd
>
> run_ksoftirqd
> __do_softirq
> softirq_handle_begin
> __local_bh_disable_ip // Turn off preemption
> <---------- [1] ---------->
> tasklet_action // h->action
> tasklet_action_common
> tasklet_trylock
> kcryptd_crypt_tasklet // t->func(t->data)
> ...
> queue_work(cc->io_queue, &io->work)
> <---------- [2] ---------->
> tasklet_unlock
>
> // workqueue process
> kcryptd_io_bio_endio
> ...
> // free tasklet_struct
>
> Since preemption has been turned off at [1], I'm confused about how the CPU
> can be scheduled out to do work first at [2].
> Would you mind explaining it to me?
>
> Thanks
Yes, you are right that scheduling is disabled when ksoftirqd processes a
softirq task.
But the upstream kernel switched to bh workqueues anyway, so there is no
need to submit a different solution to the stable kernels.
Mikulas
prev parent reply other threads:[~2024-04-15 15:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 9:15 Li Lingfeng
2024-04-11 9:52 ` Greg KH
2024-04-11 12:17 ` Li Lingfeng
2024-04-11 12:37 ` Mikulas Patocka
2024-04-12 2:06 ` Li Lingfeng
2024-04-15 15:04 ` Mikulas Patocka [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=3bc637b9-f7b4-aef6-74a8-5066d0d646f3@redhat.com \
--to=mpatocka@redhat.com \
--cc=damien.lemoal@wdc.com \
--cc=dm-devel@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=houtao1@huawei.com \
--cc=ignat@cloudflare.com \
--cc=lilingfeng3@huawei.com \
--cc=lilingfeng@huaweicloud.com \
--cc=linux-kernel@vger.kernel.org \
--cc=msnitzer@redhat.com \
--cc=nhuck@google.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
/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
all inboxes | Powered by JetHome®