All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/8][for -mm] mem_notify v6: introduce wake_up_locked_nr() new API
@ 2008-02-09 15:21 ` KOSAKI Motohiro
  0 siblings, 0 replies; 2+ messages in thread
From: KOSAKI Motohiro @ 2008-02-09 15:21 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: kosaki.motohiro, Marcelo Tosatti, Daniel Spang, Rik van Riel,
	Andrew Morton, Alan Cox, linux-fsdevel, Pavel Machek, Al Boldi,
	Jon Masters, Zan Lynx

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 |   12 ++++++++----
 kernel/sched.c       |    5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

Index: b/include/linux/wait.h
===================================================================
--- a/include/linux/wait.h	2008-02-03 20:27:54.000000000 +0900
+++ b/include/linux/wait.h	2008-02-03 20:32:12.000000000 +0900
@@ -142,7 +142,8 @@ 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,10 +156,13 @@ 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_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_interruptible_nr(x, nr)	__wake_up(x,
TASK_INTERRUPTIBLE, nr, NULL)
+#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)
 #define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
 #define wake_up_interruptible_sync(x)	__wake_up_sync((x),
TASK_INTERRUPTIBLE, 1)

Index: b/kernel/sched.c
===================================================================
--- a/kernel/sched.c	2008-02-03 20:27:54.000000000 +0900
+++ b/kernel/sched.c	2008-02-03 20:29:09.000000000 +0900
@@ -4115,9 +4115,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);
 }

 /**

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

* [PATCH 2/8][for -mm] mem_notify v6: introduce wake_up_locked_nr() new API
@ 2008-02-09 15:21 ` KOSAKI Motohiro
  0 siblings, 0 replies; 2+ messages in thread
From: KOSAKI Motohiro @ 2008-02-09 15:21 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: kosaki.motohiro, Marcelo Tosatti, Daniel Spang, Rik van Riel,
	Andrew Morton, Alan Cox, linux-fsdevel, Pavel Machek, Al Boldi,
	Jon Masters, Zan Lynx

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 |   12 ++++++++----
 kernel/sched.c       |    5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

Index: b/include/linux/wait.h
===================================================================
--- a/include/linux/wait.h	2008-02-03 20:27:54.000000000 +0900
+++ b/include/linux/wait.h	2008-02-03 20:32:12.000000000 +0900
@@ -142,7 +142,8 @@ 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,10 +156,13 @@ 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_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_interruptible_nr(x, nr)	__wake_up(x,
TASK_INTERRUPTIBLE, nr, NULL)
+#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)
 #define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
 #define wake_up_interruptible_sync(x)	__wake_up_sync((x),
TASK_INTERRUPTIBLE, 1)

Index: b/kernel/sched.c
===================================================================
--- a/kernel/sched.c	2008-02-03 20:27:54.000000000 +0900
+++ b/kernel/sched.c	2008-02-03 20:29:09.000000000 +0900
@@ -4115,9 +4115,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>

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

end of thread, other threads:[~2008-02-09 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-09 15:21 [PATCH 2/8][for -mm] mem_notify v6: introduce wake_up_locked_nr() new API KOSAKI Motohiro
2008-02-09 15:21 ` KOSAKI Motohiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.