public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slow_work_thread() should do the exclusive wait
@ 2009-04-13 18:17 Oleg Nesterov
  2009-04-13 19:03 ` Trond Myklebust
  2009-04-13 21:35 ` David Howells
  0 siblings, 2 replies; 42+ messages in thread
From: Oleg Nesterov @ 2009-04-13 18:17 UTC (permalink / raw)
  To: Andrew Morton, David Howells
  Cc: Serge Hallyn, Steve Dickson, Trond Myklebust, Al Viro,
	Daire Byrne, linux-kernel

slow_work_thread() sleeps on slow_work_thread_wq without WQ_FLAG_EXCLUSIVE,
this means that slow_work_enqueue()->__wake_up(nr_exclusive => 1) wakes up
all kslowd threads. Afaics this is not what we want, change slow_work_thread()
to use prepare_to_wait_exclusive().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- 6.30/kernel/slow-work.c~1_SW_EXCLUSIVE	2009-04-06 00:03:42.000000000 +0200
+++ 6.30/kernel/slow-work.c	2009-04-13 19:40:20.000000000 +0200
@@ -372,8 +372,8 @@ static int slow_work_thread(void *_data)
 		vsmax *= atomic_read(&slow_work_thread_count);
 		vsmax /= 100;
 
-		prepare_to_wait(&slow_work_thread_wq, &wait,
-				TASK_INTERRUPTIBLE);
+		prepare_to_wait_exclusive(&slow_work_thread_wq, &wait,
+						TASK_INTERRUPTIBLE);
 		if (!freezing(current) &&
 		    !slow_work_threads_should_exit &&
 		    !slow_work_available(vsmax) &&


^ permalink raw reply	[flat|nested] 42+ messages in thread
* [PATCH] slow_work_thread() should do the exclusive wait
@ 2009-06-11 12:12 David Howells
  0 siblings, 0 replies; 42+ messages in thread
From: David Howells @ 2009-06-11 12:12 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel, Oleg Nesterov, David Howells

From: Oleg Nesterov <oleg@redhat.com>

slow_work_thread() sleeps on slow_work_thread_wq without WQ_FLAG_EXCLUSIVE,
this means that slow_work_enqueue()->__wake_up(nr_exclusive => 1) wakes up all
kslowd threads.  This is not what we want, so we change slow_work_thread() to
use prepare_to_wait_exclusive() instead.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 kernel/slow-work.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/kernel/slow-work.c b/kernel/slow-work.c
index b28d191..521ed20 100644
--- a/kernel/slow-work.c
+++ b/kernel/slow-work.c
@@ -372,8 +372,8 @@ static int slow_work_thread(void *_data)
 		vsmax *= atomic_read(&slow_work_thread_count);
 		vsmax /= 100;
 
-		prepare_to_wait(&slow_work_thread_wq, &wait,
-				TASK_INTERRUPTIBLE);
+		prepare_to_wait_exclusive(&slow_work_thread_wq, &wait,
+					  TASK_INTERRUPTIBLE);
 		if (!freezing(current) &&
 		    !slow_work_threads_should_exit &&
 		    !slow_work_available(vsmax) &&


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

end of thread, other threads:[~2009-06-11 12:13 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13 18:17 [PATCH] slow_work_thread() should do the exclusive wait Oleg Nesterov
2009-04-13 19:03 ` Trond Myklebust
2009-04-13 19:14   ` Oleg Nesterov
2009-04-13 21:40   ` David Howells
2009-04-13 21:48     ` Oleg Nesterov
2009-04-13 21:57       ` Trond Myklebust
2009-04-13 22:24         ` Oleg Nesterov
2009-04-15 23:27           ` Andrew Morton
2009-04-16  9:10             ` David Howells
2009-04-16 14:33               ` Oleg Nesterov
2009-04-22 13:37                 ` [PATCH] Document that wake_up(), complete() and co. imply a full memory barrier David Howells
2009-04-22 13:51                   ` Ingo Molnar
2009-04-22 14:39                     ` Oleg Nesterov
2009-04-22 14:56                       ` Ingo Molnar
2009-04-22 15:07                         ` Oleg Nesterov
2009-04-22 15:12                     ` David Howells
2009-04-22 15:19                       ` Ingo Molnar
2009-04-22 16:23                       ` David Howells
2009-04-22 17:57                         ` Ingo Molnar
2009-04-23 16:32                           ` [PATCH] It may not be assumed that wake_up(), finish_wait() and co. imply a " David Howells
2009-04-23 16:55                             ` Oleg Nesterov
2009-04-24 11:46                               ` David Howells
2009-04-24 15:08                                 ` Paul E. McKenney
2009-04-24 17:08                                   ` Oleg Nesterov
2009-04-24 17:43                                     ` Paul E. McKenney
2009-04-24 17:48                                   ` David Howells
2009-04-24 18:06                                     ` Paul E. McKenney
2009-04-28 10:18                                       ` David Howells
2009-04-28 13:00                                         ` Paul E. McKenney
2009-04-24 17:28                                 ` Oleg Nesterov
2009-04-24 17:53                                   ` David Howells
2009-04-24 18:30                                     ` Oleg Nesterov
2009-04-23 17:07                             ` Linus Torvalds
2009-04-23 20:35                               ` David Howells
2009-04-23 21:12                                 ` Linus Torvalds
2009-04-23 21:24                                   ` Ingo Molnar
2009-04-23 16:36                           ` [PATCH] Document that wake_up(), complete() and co. imply a full " Oleg Nesterov
2009-04-23 20:37                             ` David Howells
2009-04-23 16:00             ` [PATCH] slow_work_thread() should do the exclusive wait David Howells
2009-04-23 16:18               ` Oleg Nesterov
2009-04-13 21:35 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2009-06-11 12:12 David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox