mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev,
	Mike Snitzer <msnitzer@redhat.com>,
	Ignat Korchagin <ignat@cloudflare.com>,
	Damien Le Moal <damien.lemoal@wdc.com>,
	Bob Liu <bob.liu@oracle.com>, Hou Tao <houtao1@huawei.com>,
	Nathan Huckleberry <nhuck@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] softirq: fix memory corruption when freeing tasklet_struct
Date: Thu, 25 Jan 2024 14:33:57 -1000	[thread overview]
Message-ID: <ZbL99b6ywZUqG3YK@slm.duckdns.org> (raw)
In-Reply-To: <CAHk-=wjDW53w4-YcSmgKC5RruiRLHmJ1sXeYdp_ZgVoBw=5byA@mail.gmail.com>

Hello, Linus.

On Thu, Jan 25, 2024 at 11:51:28AM -0800, Linus Torvalds wrote:
...
> So we could have a per-cpu 'atomic_wq' that things can be scheduled
> on, and that runs from softirqs just like tasklets, and shares the
> workqueue queueing infrastructure but doesn't use the workqueue
> threads.
> 
> Yes, the traditional use of workqueues is to be able to sleep and do
> things in process context, so that sounds a bit odd, but let's face
> it, we
> 
>  (a) already have multiple classes of workqueues
> 
>  (b) avoiding deep - and possibly recursive - stack depths is another
> reason people use workqueues
> 
>  (c) avoiding interrupt context is a real concern, even if you don't
> want to sleep
> 
> and I really *really* would like to get rid of tasklets entirely.
> 
> They started as this very specific hardcoded softirq thing used by
> some drivers, and then the notion was generalized.
> 
> And I think it was generalized badly, as shown by this example.
> 
> I have added Tejun to the cc, so that he can throw his hands up in
> horror and say "Linus, you're crazy, your drug-fueled idea would be
> horrid because of Xyz".
> 
> But *maybe* Tejun has been taking the same drugs I have, and goes
> "yeah, that would fit well".
> 
> Tejun? Please tell me I'm not on some bad crack..

That doesn't sound too crazy to me. I need to think more about how flush /
cancel paths would look but hopefully it won't be too bad. I'll hack up
something and see how things look.

Thanks.

-- 
tejun

  parent reply	other threads:[~2024-01-26  0:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 18:29 Mikulas Patocka
2024-01-25 19:51 ` Linus Torvalds
2024-01-25 22:04   ` Mikulas Patocka
2024-01-25 23:15     ` Damien Le Moal
2024-01-26  6:56       ` Hannes Reinecke
2024-01-26 18:09         ` Mikulas Patocka
2024-01-25 22:51   ` Ignat Korchagin
2024-01-26  0:33   ` Tejun Heo [this message]
2024-01-26 18:36   ` Allen
2024-01-26 23:43   ` Tejun Heo
2024-01-27  3:13     ` Allen
2024-01-27 18:37     ` Tejun Heo
2024-01-30  9:19       ` Tejun Heo
2024-01-29 17:00     ` Allen
2024-01-29 17:06       ` Tejun Heo
2024-04-09 14:15 ` Li Lingfeng

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=ZbL99b6ywZUqG3YK@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=bob.liu@oracle.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=houtao1@huawei.com \
    --cc=ignat@cloudflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mpatocka@redhat.com \
    --cc=msnitzer@redhat.com \
    --cc=nhuck@google.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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®