Files
android_kernel_xiaomi_sm8450/include/linux
Tejun Heo e09c2c2954 workqueue: apply __WQ_ORDERED to create_singlethread_workqueue()
create_singlethread_workqueue() is a compat interface for single
threaded workqueue which maps to ordered workqueue w/ rescuer in the
current implementation.  create_singlethread_workqueue() currently
implemented by invoking alloc_workqueue() w/ appropriate parameters.

8719dceae2 ("workqueue: reject adjusting max_active or applying
attrs to ordered workqueues") introduced __WQ_ORDERED to protect
ordered workqueues against dynamic attribute changes which can break
ordering guarantees but forgot to apply it to
create_singlethread_workqueue().  This in itself is okay as nobody
currently uses dynamic attribute change on workqueues created with
create_singlethread_workqueue().

However, 4c16bd327c ("workqueue: implement NUMA affinity for unbound
workqueues") broke singlethreaded guarantee for ordered workqueues
through allocating a separate pool_workqueue on each NUMA node by
default.  A later change 8a2b753844 ("workqueue: fix ordered
workqueues in NUMA setups") fixed it by allocating only one global
pool_workqueue if __WQ_ORDERED is set.

Combined, the __WQ_ORDERED omission in create_singlethread_workqueue()
became critical breaking its single threadedness and ordering
guarantee.

Let's make create_singlethread_workqueue() wrap
alloc_ordered_workqueue() instead so that it inherits __WQ_ORDERED and
can implicitly track future ordered_workqueue changes.

v2: I missed that __WQ_ORDERED now protects against pwq splitting
    across NUMA nodes and incorrectly described the patch as a
    nice-to-have fix to protect against future dynamic attribute
    usages.  Oleg pointed out that this is actually a critical
    breakage due to 8a2b753844 ("workqueue: fix ordered workqueues
    in NUMA setups").

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Mike Anderson <mike.anderson@us.ibm.com>
Cc: Oleg Nesterov <onestero@redhat.com>
Cc: Gustavo Luiz Duarte <gduarte@redhat.com>
Cc: Tomas Henzl <thenzl@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 4c16bd327c ("workqueue: implement NUMA affinity for unbound workqueues")
2014-09-13 05:13:08 +09:00
..
2014-05-06 17:54:53 -04:00
2014-08-01 22:35:55 +08:00
2014-07-08 13:36:52 -07:00
2014-06-26 15:46:55 -03:00
2014-06-04 13:34:30 +09:00
2014-04-01 23:19:14 -04:00
2014-03-10 11:44:42 -04:00
2014-08-07 14:40:08 -04:00
2014-04-18 14:20:48 +02:00
2014-08-06 18:01:24 -07:00
2014-05-20 10:30:40 +09:00
2014-02-20 14:54:28 +01:00
2014-08-06 18:01:19 -07:00
2014-06-06 16:08:13 -07:00
2014-06-02 16:05:24 -07:00
2014-06-02 14:56:01 -07:00
2014-07-08 09:40:06 +02:00
2014-04-17 12:30:40 -07:00
2014-06-16 16:26:54 +02:00
2014-03-13 12:11:00 +10:30
2014-07-22 21:55:45 +01:00
2014-01-25 08:55:09 +01:00
2014-07-03 12:02:14 -07:00
2014-05-27 17:38:11 -07:00
2014-07-17 22:07:37 +02:00
2014-03-04 13:51:06 -05:00
2014-01-27 21:02:39 -08:00
2014-04-01 23:19:10 -04:00
2014-01-25 03:14:05 -05:00
2014-04-07 10:59:19 -07:00
2014-07-09 14:58:37 +01:00
2014-06-04 16:54:07 -07:00
2014-06-04 16:54:21 -07:00
2014-07-15 22:40:22 +02:00
2014-03-19 22:24:08 -04:00
2014-06-04 16:54:12 -07:00
2014-08-08 15:57:26 -07:00
2014-08-08 15:57:31 -07:00
2014-08-06 13:03:44 +02:00
2014-06-12 00:21:11 -04:00
2014-02-15 11:55:28 -08:00
2014-02-17 15:01:37 -08:00
2014-08-08 15:57:17 -07:00
2014-06-04 16:53:57 -07:00
2014-08-08 15:57:24 -07:00
2014-06-04 16:53:56 -07:00
2014-05-14 09:46:32 -07:00
2014-08-08 15:57:22 -07:00
2014-06-04 16:53:57 -07:00
2014-04-07 16:35:53 -07:00
2014-06-04 16:53:57 -07:00
2014-01-30 16:56:55 -08:00