linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] workqueue: Fix for prematurely wakeups and cleanups
@ 2022-08-04  8:41 Lai Jiangshan
  2022-08-04  8:41 ` [RFC PATCH 1/8] workqueue: Unconditionally set cpumask in worker_attach_to_pool() Lai Jiangshan
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Lai Jiangshan @ 2022-08-04  8:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lai Jiangshan, Linus Torvalds, Eric W. Biederman, Tejun Heo,
	Petr Mladek, Michal Hocko, Peter Zijlstra, Wedson Almeida Filho

From: Lai Jiangshan <jiangshan.ljs@antgroup.com>

Patch1-3 are fixes for prematurely wakeups and patch4-8 are cleanups.

Patch2 fixes when prematurely wakeup happens after kthread_bind_mask().
Patch3 fixes when prematurely wakeup happens before kthread_bind_mask().
Patch1 prepares for patch2-3.

Like Petr's patch[1], a completion is introduced to do the synchronization,
but the synchronization is done in a different direction which allows the
newly created worker itself do some initialization instead of the manager
and allows for a more simplified code.
(The changed synchronization direction is not necessarily better.)

And make workqueue code less dependence on the semantics that kthread
provides.


[1]: https://lore.kernel.org/all/20220622140853.31383-1-pmladek@suse.com/
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Tejun Heo <tj@kernel.org>,
Cc: Petr Mladek <pmladek@suse.com>
Cc: Michal Hocko <mhocko@suse.com>,
Cc: Peter Zijlstra <peterz@infradead.org>,
Cc: Wedson Almeida Filho <wedsonaf@google.com>

Lai Jiangshan (8):
  workqueue: Unconditionally set cpumask in worker_attach_to_pool()
  workqueue: Make create_worker() safe against prematurely wakeups
  workqueue: Set PF_NO_SETAFFINITY instead of kthread_bind_mask()
  workqueue: Set/Clear PF_WQ_WORKER while attaching/detaching
  workqueue: Use worker_set_flags() in worker_enter_idle()
  workqueue: Simplify the starting of the newly created worker
  workqueue: Remove the outer loop in maybe_create_worker()
  workqueue: Move the locking out of maybe_create_worker()

 kernel/workqueue.c          | 123 +++++++++++++++---------------------
 kernel/workqueue_internal.h |  11 +++-
 2 files changed, 60 insertions(+), 74 deletions(-)

-- 
2.19.1.6.gb485710b


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-09-12  7:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04  8:41 [RFC PATCH 0/8] workqueue: Fix for prematurely wakeups and cleanups Lai Jiangshan
2022-08-04  8:41 ` [RFC PATCH 1/8] workqueue: Unconditionally set cpumask in worker_attach_to_pool() Lai Jiangshan
2022-08-16 21:18   ` Tejun Heo
2022-08-18 14:39     ` Lai Jiangshan
2022-09-12  7:54   ` Peter Zijlstra
2022-08-04  8:41 ` [RFC PATCH 2/8] workqueue: Make create_worker() safe against prematurely wakeups Lai Jiangshan
     [not found]   ` <20220804123520.1660-1-hdanton@sina.com>
2022-08-05  2:30     ` Lai Jiangshan
2022-08-16 21:46   ` Tejun Heo
2022-08-04  8:41 ` [RFC PATCH 3/8] workqueue: Set PF_NO_SETAFFINITY instead of kthread_bind_mask() Lai Jiangshan
2022-08-04  8:41 ` [RFC PATCH 4/8] workqueue: Set/Clear PF_WQ_WORKER while attaching/detaching Lai Jiangshan
2022-08-04  8:41 ` [RFC PATCH 5/8] workqueue: Use worker_set_flags() in worker_enter_idle() Lai Jiangshan
2022-08-04  8:41 ` [RFC PATCH 6/8] workqueue: Simplify the starting of the newly created worker Lai Jiangshan
2022-08-04  8:41 ` [RFC PATCH 7/8] workqueue: Remove the outer loop in maybe_create_worker() Lai Jiangshan
2022-08-16 22:08   ` Tejun Heo
2022-08-18 14:44     ` Lai Jiangshan
2022-08-19 17:29       ` Tejun Heo
2022-08-04  8:41 ` [RFC PATCH 8/8] workqueue: Move the locking out of maybe_create_worker() Lai Jiangshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).