[PATCH v2 01/07] cpuset cleanup not not operators

From: Paul Jackson
Date: Thu Feb 09 2006 - 13:52:57 EST


From: Paul Jackson <pj@xxxxxxx>

Since the test_bit() bit operator is boolean (return 0 or 1),
the double not "!!" operations needed to convert a scalar
(zero or not zero) to a boolean are not needed.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

---

Andrew,

Please drop the patches:

cpuset-memory-spread-basic-implementation.patch
cpuset-memory-spread-basic-implementation-fix.patch
cpuset-memory-spread-page-cache-implementation-and-hooks.patch
cpuset-memory-spread-slab-cache-implementation.patch
cpuset-memory-spread-slab-cache-optimizations.patch
cpuset-memory-spread-slab-cache-optimizations-tidy.patch
cpuset-memory-spread-slab-cache-hooks.patch

and replace with this patch set:

[PATCH v2 01/07] cpuset_cleanup_not_not_ops
[PATCH v2 02/07] cpuset_combine_atomic_inc_calls
[PATCH v2 03/07] cpuset_mem_spread_new
[PATCH v2 04/07] cpuset_mem_spread_page_cache
[PATCH v2 05/07] cpuset_mem_spread_slab_cache
[PATCH v2 06/07] cpuset_mem_spread_slab_optimize
[PATCH v2 07/07] cpuset_mem_spread_mark_some_slab_caches

Changes in patch set from first version to this version v2:
* dropped double not (!!) operators on cpuset flag bit tests
* use more optimal atomic_inc_return() calls
* change from one flag for all spreading to two
flags, one for page cache, one for slab cache
* change name of easily misused mpol_set_task_struct_flag()
to less inviting mpol_fix_fork_child_flag(), to minimize
risk someone will call on another task unsafely.
* a tidy fix and a missing EXPORT_SYMBOL, thanks to Andrew
* added xfs slab cache hooks for slab cache memory spreading
* comment anticipating other file systems may need same hooks
* further optimize kernel text size, for both NUMA and non-NUMA
cases of the page_cache_alloc*() memory spreading hooks
* comment why !in_interrupt() test needed to use memory spreading
* comment why we dont need to check that node returned from the
cpuset_mem_spread_node() is online

kernel/cpuset.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

--- 2.6.16-rc1-mm5.orig/kernel/cpuset.c 2006-02-06 23:17:44.536051878 -0800
+++ 2.6.16-rc1-mm5/kernel/cpuset.c 2006-02-06 23:37:02.709481506 -0800
@@ -114,27 +114,27 @@ typedef enum {
/* convenient tests for these bits */
static inline int is_cpu_exclusive(const struct cpuset *cs)
{
- return !!test_bit(CS_CPU_EXCLUSIVE, &cs->flags);
+ return test_bit(CS_CPU_EXCLUSIVE, &cs->flags);
}

static inline int is_mem_exclusive(const struct cpuset *cs)
{
- return !!test_bit(CS_MEM_EXCLUSIVE, &cs->flags);
+ return test_bit(CS_MEM_EXCLUSIVE, &cs->flags);
}

static inline int is_removed(const struct cpuset *cs)
{
- return !!test_bit(CS_REMOVED, &cs->flags);
+ return test_bit(CS_REMOVED, &cs->flags);
}

static inline int notify_on_release(const struct cpuset *cs)
{
- return !!test_bit(CS_NOTIFY_ON_RELEASE, &cs->flags);
+ return test_bit(CS_NOTIFY_ON_RELEASE, &cs->flags);
}

static inline int is_memory_migrate(const struct cpuset *cs)
{
- return !!test_bit(CS_MEMORY_MIGRATE, &cs->flags);
+ return test_bit(CS_MEMORY_MIGRATE, &cs->flags);
}

/*

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/