lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3bc637b9-f7b4-aef6-74a8-5066d0d646f3@redhat.com>
Date: Mon, 15 Apr 2024 17:04:52 +0200 (CEST)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Li Lingfeng <lilingfeng3@...wei.com>
cc: stable@...r.kernel.org, gregkh@...uxfoundation.org, 
    torvalds@...ux-foundation.org, tglx@...utronix.de, 
    linux-kernel@...r.kernel.org, dm-devel@...ts.linux.dev, 
    msnitzer@...hat.com, ignat@...udflare.com, damien.lemoal@....com, 
    houtao1@...wei.com, nhuck@...gle.com, peterz@...radead.org, 
    yukuai3@...wei.com, yangerkun@...wei.com, yi.zhang@...wei.com, 
    lilingfeng@...weicloud.com
Subject: Re: [PATCH 6.6] Revert "dm-crypt, dm-verity: disable tasklets"



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ