Re: [RFC][PATCH] irq_work
From: Peter Zijlstra
Date: Fri Jun 25 2010 - 06:39:50 EST
On Thu, 2010-06-24 at 14:38 +0200, Andi Kleen wrote:
> The sleepable
> soft irq would have avoided that (that's not a show stopper)
I'm still not convinced sleepable softirq is a workable thing.
A) are non-preemptible
B) are per-cpu because of A
C) can be ran from ksoftirqd context
D) generic kernel infrastructure with identical semantics on all archs
If you were to make something like a sleepable softirq, you'd loose A
(per definition), B (sleepable implies migratable to cpus_allowed) and
possibly D (unless you want to touch all architectures).
Now from your 'requirements':
> I have one case that needs to sleep (but only when interrupting user code)
> TIF works for user space, but it's a bit ugly because it requires adding
> more data to the task_struct because CPUs can change.
Which I read as:
1) needs to run in the task context of the task that got 'interrupted'
2) needs to stay on the cpu it got interrupted on.
So C is out of the window too, at which point there's nothing resembling
To boot, x86_64 runs softirqs from the hardirq stack:
/* Call softirq on interrupt stack. Interrupts are off. */
push %rbp # backlink for old unwinder
Also, -rt has something that could be considered sleepable softirqs,
although we call them preemptible softirqs. It runs all softirqs from
cpu bound kthreads, which again doesn't match your requirements.
So no, I don't think your idea of sleepable softirqs is sound.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/