|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally, I envisioned bthreads as replacement for pollers and
workqueues. But even without preemption, having functions you call
possibly accessing structures you are iterating over can corrupt
memory. This problem exists with pollers as well, but because of their
limited scope, it's harder to shoot your foot with them, as you
don't keep implicit state between poller activations unlike bthreads,
which maintain their stack across context switches.
Limit bthread scope instead to be a replacement for workqueues. This
still allows us to port some classes of state-machine-in-kthread kernel
code, while avoding the aforementioned pitfalls.
Cc: Jan Luebbe <j.luebbe@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210622082617.18011-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|