1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 09:32:12 +00:00
Oleg Nesterov 39f17c7074 sched/task.h: fix the wrong comment on task_lock() nesting with tasklist_lock
The ancient comment above task_lock() states that it can be nested outside
of read_lock(&tasklist_lock), but this is no longer true:

  CPU_0			CPU_1			CPU_2

  task_lock()		read_lock(tasklist)
  						write_lock_irq(tasklist)
  read_lock(tasklist)	task_lock()

Unless CPU_0 calls read_lock() in IRQ context, queued_read_lock_slowpath()
won't get the lock immediately, it will spin waiting for the pending
writer on CPU_2, resulting in a deadlock.

Link: https://lkml.kernel.org/r/20250914110908.GA18769@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-22 20:10:59 -07:00
..
2025-07-29 11:42:31 -07:00
2025-07-31 11:50:25 -07:00
2025-07-23 01:38:56 -04:00
2025-07-31 13:43:02 -07:00
2025-08-02 12:07:09 -07:00
2025-07-31 13:43:02 -07:00
2025-08-09 07:20:44 +03:00
2025-07-31 13:16:09 -07:00
2025-07-29 20:21:54 -07:00
2025-07-21 18:18:51 +01:00
2025-07-31 11:28:03 -04:00
2025-07-31 18:23:53 -07:00
2025-08-01 15:47:06 -07:00
2025-07-29 17:42:52 -07:00
2025-07-31 16:52:32 -07:00
2025-07-19 18:59:57 -07:00
2025-07-29 12:15:39 -07:00
2025-08-09 18:10:01 +03:00
2025-07-22 15:57:02 +00:00
2025-07-30 09:58:50 -07:00
2025-08-04 16:27:21 -07:00
2025-07-16 14:28:21 +02:00
2025-07-19 18:59:51 -07:00
2025-07-24 19:12:32 -07:00
2025-09-13 17:32:44 -07:00
2025-07-28 16:30:12 -07:00
2025-08-02 12:06:10 -07:00
2025-07-31 12:43:08 -07:00
2025-07-30 17:14:01 -07:00
2025-07-17 06:01:16 -06:00
2025-07-13 16:38:24 -07:00
2025-08-06 07:32:52 +03:00
2025-07-30 17:14:01 -07:00
2025-08-01 15:47:06 -07:00
2025-07-14 15:20:02 -07:00
2025-07-14 15:20:02 -07:00
2025-07-31 16:11:43 -05:00
2025-07-29 11:42:31 -07:00
2025-07-22 18:07:11 +02:00
2025-07-10 09:39:18 +02:00
2025-08-03 15:03:04 -07:00
2025-07-28 18:20:32 -07:00
2025-07-29 13:00:20 -07:00
2025-08-04 10:54:36 -07:00
2025-07-19 10:17:56 +05:30
2025-07-30 19:26:49 -07:00
2025-07-23 11:56:02 +02:00
2025-07-21 17:48:32 -07:00
Hi,
2025-07-28 18:18:16 -07:00
2025-08-01 14:17:48 -07:00
2025-07-17 11:26:56 +02:00
2025-08-02 12:01:37 -07:00