summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorWilliam Lee Irwin III <wli@holomorphy.com>2004-10-18 18:00:05 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-18 18:00:05 -0700
commit525b64cdbd0401b8d3cb5642159e5ec8e49290b7 (patch)
treef0cebde6bef06fdc099fad682c7e650482122804 /kernel
parentbaa896b3ded47a7f6a401267f5995dcc09d5d5d4 (diff)
[PATCH] eliminate bh waitqueue hashtable
Eliminate the bh waitqueue hashtable using bit_waitqueue() via wait_on_bit() and wake_up_bit() to locate the waitqueue head associated with a bit. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/wait.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/wait.c b/kernel/wait.c
index 29057f707dbd..e87ae721643c 100644
--- a/kernel/wait.c
+++ b/kernel/wait.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/wait.h>
+#include <linux/hash.h>
void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
{
@@ -187,3 +188,13 @@ void fastcall __wake_up_bit(wait_queue_head_t *wq, void *word, int bit)
__wake_up(wq, TASK_INTERRUPTIBLE|TASK_UNINTERRUPTIBLE, 1, &key);
}
EXPORT_SYMBOL(__wake_up_bit);
+
+fastcall wait_queue_head_t *bit_waitqueue(void *word, int bit)
+{
+ const int shift = BITS_PER_LONG == 32 ? 5 : 6;
+ const struct zone *zone = page_zone(virt_to_page(word));
+ unsigned long val = (unsigned long)word << shift | bit;
+
+ return &zone->wait_table[hash_long(val, zone->wait_table_bits)];
+}
+EXPORT_SYMBOL(bit_waitqueue);