linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: kosaki.motohiro@jp.fujitsu.com,
	Marcelo Tosatti <marcelo@kvack.org>,
	Daniel Spang <daniel.spang@gmail.com>,
	Rik van Riel <riel@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [RFC][PATCH 2/5] introduce wake_up_locked_nr() new API
Date: Tue, 15 Jan 2008 10:00:22 +0900	[thread overview]
Message-ID: <20080115095915.1175.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080115092828.116F.KOSAKI.MOTOHIRO@jp.fujitsu.com>

introduce new API wake_up_locked_nr() and wake_up_locked_all().
it it similar as wake_up_nr() and wake_up_all(), but it doesn't lock.

Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

---
 include/linux/wait.h |    7 +++++--
 kernel/sched.c       |    5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6.24-rc6-mm1-memnotify/include/linux/wait.h
===================================================================
--- linux-2.6.24-rc6-mm1-memnotify.orig/include/linux/wait.h	2008-01-13 16:43:04.000000000 +0900
+++ linux-2.6.24-rc6-mm1-memnotify/include/linux/wait.h	2008-01-13 16:52:21.000000000 +0900
@@ -142,7 +142,7 @@ static inline void __remove_wait_queue(w
 }
 
 void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key));
-extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode));
+void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr, void *key));
 extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr));
 void FASTCALL(__wake_up_bit(wait_queue_head_t *, void *, int));
 int FASTCALL(__wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned));
@@ -155,7 +155,10 @@ wait_queue_head_t *FASTCALL(bit_waitqueu
 #define wake_up(x)			__wake_up(x, TASK_NORMAL, 1, NULL)
 #define wake_up_nr(x, nr)		__wake_up(x, TASK_NORMAL, nr, NULL)
 #define wake_up_all(x)			__wake_up(x, TASK_NORMAL, 0, NULL)
-#define wake_up_locked(x)		__wake_up_locked((x), TASK_NORMAL)
+
+#define wake_up_locked(x)		__wake_up_locked((x), TASK_NORMAL, 1, NULL)
+#define wake_up_locked_nr(x, nr)	__wake_up_locked((x), TASK_NORMAL, nr, NULL)
+#define wake_up_locked_all(x)		__wake_up_locked((x), TASK_NORMAL, 0, NULL)
 
 #define wake_up_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
 #define wake_up_interruptible_nr(x, nr)	__wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
Index: linux-2.6.24-rc6-mm1-memnotify/kernel/sched.c
===================================================================
--- linux-2.6.24-rc6-mm1-memnotify.orig/kernel/sched.c	2008-01-13 16:42:22.000000000 +0900
+++ linux-2.6.24-rc6-mm1-memnotify/kernel/sched.c	2008-01-13 16:53:28.000000000 +0900
@@ -3837,9 +3837,10 @@ EXPORT_SYMBOL(__wake_up);
 /*
  * Same as __wake_up but called with the spinlock in wait_queue_head_t held.
  */
-void __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
+void __wake_up_locked(wait_queue_head_t *q, unsigned int mode,
+		      int nr_exclusive, void *key)
 {
-	__wake_up_common(q, mode, 1, 0, NULL);
+	__wake_up_common(q, mode, nr_exclusive, 0, key);
 }
 
 /**


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-01-15  1:00 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15  0:52 [RFC][PATCH 0/5] mem notifications v4 KOSAKI Motohiro
2008-01-15  0:59 ` [RFC][PATCH 1/5] introduce poll_wait_exclusive() new API KOSAKI Motohiro
2008-01-15  1:00 ` KOSAKI Motohiro [this message]
2008-01-15  1:01 ` [RFC][PATCH 3/5] add /dev/mem_notify device KOSAKI Motohiro
2008-01-15  1:08   ` Randy Dunlap
2008-01-15  1:20     ` KOSAKI Motohiro
2008-01-15  1:24       ` KOSAKI Motohiro
2008-01-15  2:10   ` KAMEZAWA Hiroyuki
2008-01-15  2:20     ` KOSAKI Motohiro
2008-01-15  2:56       ` Rik van Riel
2008-01-15 10:46   ` Alan Cox
2008-01-15 10:59     ` KOSAKI Motohiro
2008-01-15 11:20       ` Alan Cox
2008-01-15 11:48         ` KOSAKI Motohiro
2008-01-15 13:42           ` Alan Cox
2008-01-16  2:43             ` KOSAKI Motohiro
2008-01-15 12:05         ` Marcelo Tosatti
2008-01-15 13:42           ` Alan Cox
2008-01-15 22:16   ` Pavel Machek
2008-01-16  1:57     ` KOSAKI Motohiro
2008-01-16  4:13       ` Marcelo Tosatti
2008-01-16 11:42         ` Pavel Machek
2008-01-16 11:51           ` Daniel Spång
2008-01-17  3:04             ` KOSAKI Motohiro
2008-01-15  1:02 ` [RFC][PATCH 4/5] memory_pressure_notify() caller KOSAKI Motohiro
2008-01-15  2:06   ` KAMEZAWA Hiroyuki
2008-01-15  2:37     ` KOSAKI Motohiro
2008-01-15  3:00       ` KAMEZAWA Hiroyuki
2008-01-15  3:08         ` KOSAKI Motohiro
2008-01-15 22:55   ` Daniel Spång
2008-01-15 22:59     ` Rik van Riel
2008-01-15 23:39       ` Daniel Spång
2008-01-16  1:48         ` KOSAKI Motohiro
2008-01-16 11:03           ` Daniel Spång
2008-01-17  3:26             ` KOSAKI Motohiro
2008-01-18 10:24               ` Daniel Spång
2008-01-18 10:30                 ` KOSAKI Motohiro
2008-01-15  1:03 ` [RFC][PATCH 5/5] /proc/zoneinfo enhancement KOSAKI Motohiro
2008-01-15 10:44   ` Alan Cox
2008-01-15 10:49     ` KOSAKI Motohiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080115095915.1175.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.spang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@kvack.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox