Files
tegra-linux-noble/include/linux
Tejun Heo 1265057fa0 workqueue: fix CPU binding of flush_delayed_work[_sync]()
delayed_work encodes the workqueue to use and the last CPU in
delayed_work->work.data while it's on timer.  The target CPU is
implicitly recorded as the CPU the timer is queued on and
delayed_work_timer_fn() queues delayed_work->work to the CPU it is
running on.

Unfortunately, this leaves flush_delayed_work[_sync]() no way to find
out which CPU the delayed_work was queued for when they try to
re-queue after killing the timer.  Currently, it chooses the local CPU
flush is running on.  This can unexpectedly move a delayed_work queued
on a specific CPU to another CPU and lead to subtle errors.

There isn't much point in trying to save several bytes in struct
delayed_work, which is already close to a hundred bytes on 64bit with
all debug options turned off.  This patch adds delayed_work->cpu to
remember the CPU it's queued for.

Note that if the timer is migrated during CPU down, the work item
could be queued to the downed global_cwq after this change.  As a
detached global_cwq behaves like an unbound one, this doesn't change
much for the delayed_work.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
2012-08-13 16:27:55 -07:00
..
2012-07-17 15:11:37 -04:00
2012-07-30 18:16:01 -07:00
2012-07-30 18:15:23 -07:00
2012-07-30 17:25:21 -07:00
2012-06-29 11:38:17 -04:00
2012-07-31 18:42:43 -07:00
2012-07-30 17:25:11 -07:00
2012-06-27 15:42:24 -07:00
2012-07-22 23:57:58 +04:00
2012-07-05 15:04:10 +02:00
2012-07-02 15:11:12 +02:00
2012-07-20 11:07:00 -07:00
2012-07-18 08:59:58 -07:00
2012-07-19 10:38:32 -04:00
2012-07-29 21:24:13 +04:00
2012-07-09 16:42:24 -04:00
2012-07-30 19:06:52 -04:00
2012-07-30 19:06:52 -04:00
2012-07-30 19:06:52 -04:00
2012-07-10 10:32:06 -05:00
2012-07-31 18:42:43 -07:00
2012-07-12 07:54:46 -07:00
2012-07-19 10:38:32 -04:00
2012-07-30 17:25:20 -07:00
2012-07-02 13:40:06 +03:00
2012-07-16 22:31:34 -07:00
2012-07-30 17:25:16 -07:00
2012-07-23 00:58:46 -07:00
2012-07-22 23:57:55 +04:00
2012-07-31 08:16:24 -06:00
2012-07-31 18:42:50 -07:00