diff options
author | Paul Jackson <pj@sgi.com> | 2006-03-24 06:16:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:23 -0500 |
commit | c61afb181c649754ea221f104e268cbacfc993e3 (patch) | |
tree | 870917b3f9175cf1663a2620d989856913cfb5f8 /include/linux/sched.h | |
parent | 101a50019ae5e370d73984ee05d56dd3b08f330a (diff) |
[PATCH] cpuset memory spread slab cache optimizations
The hooks in the slab cache allocator code path for support of NUMA
mempolicies and cpuset memory spreading are in an important code path. Many
systems will use neither feature.
This patch optimizes those hooks down to a single check of some bits in the
current tasks task_struct flags. For non NUMA systems, this hook and related
code is already ifdef'd out.
The optimization is done by using another task flag, set if the task is using
a non-default NUMA mempolicy. Taking this flag bit along with the
PF_SPREAD_PAGE and PF_SPREAD_SLAB flag bits added earlier in this 'cpuset
memory spreading' patch set, one can check for the combination of any of these
special case memory placement mechanisms with a single test of the current
tasks task_struct flags.
This patch also tightens up the code, to save a few bytes of kernel text
space, and moves some of it out of line. Due to the nested inlines called
from multiple places, we were ending up with three copies of this code, which
once we get off the main code path (for local node allocation) seems a bit
wasteful of instruction memory.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index b0e37cfa09f5..2cda439ece43 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -932,6 +932,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
932 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | 932 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ |
933 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ | 933 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ |
934 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ | 934 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ |
935 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | ||
935 | 936 | ||
936 | /* | 937 | /* |
937 | * Only the _current_ task can read/write to tsk->flags, but other | 938 | * Only the _current_ task can read/write to tsk->flags, but other |