* [PATCH] [RSDL-mm 4/6] sched: implement 180 bit sched bitmap
@ 2007-03-07 1:27 Con Kolivas
0 siblings, 0 replies; 2+ messages in thread
From: Con Kolivas @ 2007-03-07 1:27 UTC (permalink / raw)
To: linux-kernel, ck
Modify the sched_find_first_bit function to work on a 180bit long bitmap.
Signed-off-by: Con Kolivas <kernel@kolivas.org>
---
include/asm-generic/bitops/sched.h | 10 ++++++----
include/asm-s390/bitops.h | 12 +-----------
2 files changed, 7 insertions(+), 15 deletions(-)
Index: linux-2.6.21-rc2-mm2/include/asm-generic/bitops/sched.h
===================================================================
--- linux-2.6.21-rc2-mm2.orig/include/asm-generic/bitops/sched.h 2007-03-07 11:57:51.000000000 +1100
+++ linux-2.6.21-rc2-mm2/include/asm-generic/bitops/sched.h 2007-03-07 11:58:22.000000000 +1100
@@ -6,8 +6,8 @@
/*
* Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
+ * way of searching a 180-bit bitmap where the first 100 bits are
+ * unlikely to be set. It's guaranteed that at least one of the 180
* bits is cleared.
*/
static inline int sched_find_first_bit(const unsigned long *b)
@@ -15,7 +15,7 @@ static inline int sched_find_first_bit(c
#if BITS_PER_LONG == 64
if (unlikely(b[0]))
return __ffs(b[0]);
- if (likely(b[1]))
+ if (b[1])
return __ffs(b[1]) + 64;
return __ffs(b[2]) + 128;
#elif BITS_PER_LONG == 32
@@ -27,7 +27,9 @@ static inline int sched_find_first_bit(c
return __ffs(b[2]) + 64;
if (b[3])
return __ffs(b[3]) + 96;
- return __ffs(b[4]) + 128;
+ if (b[4])
+ return __ffs(b[4]) + 128;
+ return __ffs(b[5]) + 160;
#else
#error BITS_PER_LONG not defined
#endif
Index: linux-2.6.21-rc2-mm2/include/asm-s390/bitops.h
===================================================================
--- linux-2.6.21-rc2-mm2.orig/include/asm-s390/bitops.h 2007-03-07 11:57:51.000000000 +1100
+++ linux-2.6.21-rc2-mm2/include/asm-s390/bitops.h 2007-03-07 11:58:22.000000000 +1100
@@ -729,17 +729,7 @@ find_next_bit (const unsigned long * add
return offset + find_first_bit(p, size);
}
-/*
- * Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
- * bits is cleared.
- */
-static inline int sched_find_first_bit(unsigned long *b)
-{
- return find_first_bit(b, 140);
-}
-
+#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/fls.h>
--
-ck
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH][RSDL-mm 4/6] sched implement 180 bit sched bitmap
@ 2007-03-10 7:26 Con Kolivas
0 siblings, 0 replies; 2+ messages in thread
From: Con Kolivas @ 2007-03-10 7:26 UTC (permalink / raw)
To: linux kernel mailing list, ck list, Andrew Morton, Ingo Molnar
From: Con Kolivas <kernel@kolivas.org>
Modify the sched_find_first_bit function to work on a 180bit long bitmap.
Signed-off-by: Con Kolivas <kernel@kolivas.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/asm-generic/bitops/sched.h | 10 ++++++----
include/asm-s390/bitops.h | 12 +-----------
2 files changed, 7 insertions(+), 15 deletions(-)
Index: linux-2.6.21-rc3-mm2/include/asm-generic/bitops/sched.h
===================================================================
--- linux-2.6.21-rc3-mm2.orig/include/asm-generic/bitops/sched.h 2006-11-30 11:30:41.000000000 +1100
+++ linux-2.6.21-rc3-mm2/include/asm-generic/bitops/sched.h 2007-03-10 13:54:18.000000000 +1100
@@ -6,8 +6,8 @@
/*
* Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
+ * way of searching a 180-bit bitmap where the first 100 bits are
+ * unlikely to be set. It's guaranteed that at least one of the 180
* bits is cleared.
*/
static inline int sched_find_first_bit(const unsigned long *b)
@@ -15,7 +15,7 @@ static inline int sched_find_first_bit(c
#if BITS_PER_LONG == 64
if (unlikely(b[0]))
return __ffs(b[0]);
- if (likely(b[1]))
+ if (b[1])
return __ffs(b[1]) + 64;
return __ffs(b[2]) + 128;
#elif BITS_PER_LONG == 32
@@ -27,7 +27,9 @@ static inline int sched_find_first_bit(c
return __ffs(b[2]) + 64;
if (b[3])
return __ffs(b[3]) + 96;
- return __ffs(b[4]) + 128;
+ if (b[4])
+ return __ffs(b[4]) + 128;
+ return __ffs(b[5]) + 160;
#else
#error BITS_PER_LONG not defined
#endif
Index: linux-2.6.21-rc3-mm2/include/asm-s390/bitops.h
===================================================================
--- linux-2.6.21-rc3-mm2.orig/include/asm-s390/bitops.h 2006-11-30 11:30:41.000000000 +1100
+++ linux-2.6.21-rc3-mm2/include/asm-s390/bitops.h 2007-03-10 13:54:18.000000000 +1100
@@ -729,17 +729,7 @@ find_next_bit (const unsigned long * add
return offset + find_first_bit(p, size);
}
-/*
- * Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
- * bits is cleared.
- */
-static inline int sched_find_first_bit(unsigned long *b)
-{
- return find_first_bit(b, 140);
-}
-
+#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/fls.h>
--
-ck
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-10 7:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-10 7:26 [PATCH][RSDL-mm 4/6] sched implement 180 bit sched bitmap Con Kolivas
-- strict thread matches above, loose matches on Subject: below --
2007-03-07 1:27 [PATCH] [RSDL-mm 4/6] sched: " Con Kolivas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox