public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Cc: davem@davemloft.net
Subject: [5/10 PATCH] inline __wake_up
Date: Tue, 24 Jun 2008 01:58:34 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0806240158090.27784@engineering.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0806240154140.27784@engineering.redhat.com>

Inline __wake_up and __wake_up_locked.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Index: linux-2.6.26-rc7-devel/include/linux/wait.h
===================================================================
--- linux-2.6.26-rc7-devel.orig/include/linux/wait.h	2008-06-24 07:37:25.000000000 +0200
+++ linux-2.6.26-rc7-devel/include/linux/wait.h	2008-06-24 07:37:31.000000000 +0200
@@ -177,8 +177,7 @@
  	list_del(&old->task_list);
  }

-void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
-extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
+void __wake_up_common(wait_queue_head_t *q, unsigned int mode, int nr_exclusive, int sync, void *key);
  extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
  int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
  int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned);
@@ -186,6 +185,31 @@
  int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned);
  wait_queue_head_t *bit_waitqueue(void *, int);

+/**
+ * __wake_up - wake up threads blocked on a waitqueue.
+ * @q: the waitqueue
+ * @mode: which threads
+ * @nr_exclusive: how many wake-one or wake-many threads to wake up
+ * @key: is directly passed to the wakeup function
+ */
+static __always_inline void __wake_up(wait_queue_head_t *q, unsigned int mode,
+			     int nr_exclusive, void *key)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&q->lock, flags);
+	__wake_up_common(q, mode, nr_exclusive, 0, key);
+	spin_unlock_irqrestore(&q->lock, flags);
+}
+
+/*
+ * Same as __wake_up but called with the spinlock in wait_queue_head_t held.
+ */
+static __always_inline void __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
+{
+	__wake_up_common(q, mode, 1, 0, NULL);
+}
+
  static __always_inline void __wake_up_bit(wait_queue_head_t *wq, void *word, int bit)
  {
  	struct wait_bit_key key = __WAIT_BIT_KEY_INITIALIZER(word, bit);
Index: linux-2.6.26-rc7-devel/kernel/sched.c
===================================================================
--- linux-2.6.26-rc7-devel.orig/kernel/sched.c	2008-06-24 07:28:11.000000000 +0200
+++ linux-2.6.26-rc7-devel/kernel/sched.c	2008-06-24 07:37:31.000000000 +0200
@@ -4284,8 +4284,8 @@
   * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns
   * zero in this (rare) case, and we handle it by continuing to scan the queue.
   */
-static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
-			     int nr_exclusive, int sync, void *key)
+void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
+		      int nr_exclusive, int sync, void *key)
  {
  	wait_queue_t *curr, *next;

@@ -4297,32 +4297,7 @@
  			break;
  	}
  }
-
-/**
- * __wake_up - wake up threads blocked on a waitqueue.
- * @q: the waitqueue
- * @mode: which threads
- * @nr_exclusive: how many wake-one or wake-many threads to wake up
- * @key: is directly passed to the wakeup function
- */
-void __wake_up(wait_queue_head_t *q, unsigned int mode,
-			int nr_exclusive, void *key)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&q->lock, flags);
-	__wake_up_common(q, mode, nr_exclusive, 0, key);
-	spin_unlock_irqrestore(&q->lock, flags);
-}
-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)
-{
-	__wake_up_common(q, mode, 1, 0, NULL);
-}
+EXPORT_SYMBOL(__wake_up_common);

  /**
   * __wake_up_sync - wake up threads blocked on a waitqueue.


  parent reply	other threads:[~2008-06-24  5:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24  5:54 [10 PATCHES] inline functions to avoid stack overflow Mikulas Patocka
2008-06-24  5:55 ` [1/10 PATCH] inline __queue_work Mikulas Patocka
2008-06-24  5:56   ` [2/10 PATCH] inline inline-generic_writepages.patch Mikulas Patocka
2008-06-24  5:57   ` [3/10 PATCH] inline wake_up_bit Mikulas Patocka
2008-06-25 14:17     ` Denys Vlasenko
2008-06-25 14:36       ` Mikulas Patocka
2008-06-25 15:24         ` Denys Vlasenko
2008-06-25 16:01           ` Mikulas Patocka
2008-06-25 20:37             ` Denys Vlasenko
2008-06-26  0:28               ` David Miller
2008-06-26  3:35                 ` Denys Vlasenko
2008-06-26  4:18                   ` David Miller
2008-06-26 18:22                 ` Pavel Machek
2008-06-25 22:23           ` David Miller
2008-06-25 22:30       ` David Miller
2008-06-24  5:57   ` [4/10 PATCH] inline __wake_up_bit Mikulas Patocka
2008-06-24  5:58   ` Mikulas Patocka [this message]
2008-06-24  5:59   ` [6/10 PATCH] inline default_wake_function Mikulas Patocka
2008-06-24  5:59   ` [6/10 PATCH] inline autoremove_wake_function Mikulas Patocka
2008-06-24  6:01   ` [8/10 PATCH] inline filemap_fdatawrite Mikulas Patocka
2008-06-24  6:01   ` [9/10 PATCH] inline dm-kcopyd-inline-wake.patch Mikulas Patocka
2008-06-24  6:03   ` [10/10 PATCH] inline dispatch_job Mikulas Patocka
2008-06-24  6:06 ` [PATCH] limit irq nesting Mikulas Patocka
2008-06-24  7:01 ` [10 PATCHES] inline functions to avoid stack overflow Ingo Molnar
     [not found] ` <486216E7.8000002@aitel.hist.no>
2008-06-25 12:53   ` Mikulas Patocka
2008-06-25 22:09     ` David Miller
2008-06-26  6:32       ` Bart Van Assche
2008-06-26  9:06         ` David Miller
2008-07-02  4:39       ` Mikulas Patocka
2008-07-02  4:45         ` David Miller
2008-07-03 21:12           ` Mikulas Patocka

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=Pine.LNX.4.64.0806240158090.27784@engineering.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /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