diff options
author | 2009-07-22 05:54:03 +0000 | |
---|---|---|
committer | 2009-07-22 05:54:03 +0000 | |
commit | e63ab9ed2622eeb853636d75fede26febebbff3b (patch) | |
tree | 7365ed79a2e2d48604d1204e198139069b2d45a7 /sys-kernel | |
parent | Stable for HPPA (bug #278583). (diff) | |
download | gentoo-2-e63ab9ed2622eeb853636d75fede26febebbff3b.tar.gz gentoo-2-e63ab9ed2622eeb853636d75fede26febebbff3b.tar.bz2 gentoo-2-e63ab9ed2622eeb853636d75fede26febebbff3b.zip |
Backported patch to make kernel buildable with SLAB, bug #275965 thank Daniel Beckham for report and Tom Hendrikx for work with upstream. SLUB is better choice and few people want it thus added without revision bump.
(Portage version: 2.2_rc33/cvs/Linux i686)
Diffstat (limited to 'sys-kernel')
3 files changed, 128 insertions, 3 deletions
diff --git a/sys-kernel/openvz-sources/ChangeLog b/sys-kernel/openvz-sources/ChangeLog index edc83d25cfd2..0d72b8cd7ff2 100644 --- a/sys-kernel/openvz-sources/ChangeLog +++ b/sys-kernel/openvz-sources/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-kernel/openvz-sources # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/openvz-sources/ChangeLog,v 1.113 2009/07/21 12:38:18 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/openvz-sources/ChangeLog,v 1.114 2009/07/22 05:54:03 pva Exp $ + + 22 Jul 2009; Peter Volkov <pva@gentoo.org> + openvz-sources-2.6.27.2.1-r2.ebuild, + +files/openvz-sources-2.6.27.2.1-SLAB.patch: + Backported patch to make kernel buildable with SLAB, bug #275965 thank + Daniel Beckham for report and Tom Hendrikx for work with upstream. SLUB is + better choice and few people want it thus added without revision bump. 21 Jul 2009; Peter Volkov <pva@gentoo.org> openvz-sources-2.6.27.2.1-r2.ebuild: diff --git a/sys-kernel/openvz-sources/files/openvz-sources-2.6.27.2.1-SLAB.patch b/sys-kernel/openvz-sources/files/openvz-sources-2.6.27.2.1-SLAB.patch new file mode 100644 index 000000000000..818425498bc8 --- /dev/null +++ b/sys-kernel/openvz-sources/files/openvz-sources-2.6.27.2.1-SLAB.patch @@ -0,0 +1,117 @@ +From: Cyrill Gorcunov <gorcunov@openvz.org> +Date: Thu, 16 Jul 2009 15:22:21 +0000 (+0400) +Subject: lab: kmem_cache - fixup members and use helpers +X-Git-Url: http://git.openvz.org/?p=linux-2.6.27-openvz;a=commitdiff_plain;h=36d3fafb956540b300aa12218bcb7e9db3c5e656 + +lab: kmem_cache - fixup members and use helpers + +In a sake of SLAB memory manager usability we need +to add beancounter members and use proper helpers. + +[ bug http://bugzilla.openvz.org/show_bug.cgi?id=1232 ] + +Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> +--- + +diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h +index de03bd0..1da5551 100644 +--- a/include/linux/slab_def.h ++++ b/include/linux/slab_def.h +@@ -15,6 +15,8 @@ + #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ + #include <linux/compiler.h> + ++struct kmem_cache; ++ + /* + * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON. + * 0 for faster, smaller code (especially in the critical paths). +diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c +index 3f004b7..46a1726 100644 +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -184,8 +184,8 @@ static int __pid_ns_attach_task(struct pid_namespace *ns, + for (type = 0; type < PIDTYPE_MAX; ++type) + INIT_HLIST_HEAD(&pid->tasks[type]); + +- old_size = pid->numbers[pid->level - 1].ns->pid_cachep->objuse; +- new_size = pid->numbers[pid->level].ns->pid_cachep->objuse; ++ old_size = kmem_cache_objuse(pid->numbers[pid->level - 1].ns->pid_cachep); ++ new_size = kmem_cache_objuse(pid->numbers[pid->level].ns->pid_cachep); + local_irq_disable(); + /* + * Depending on sizeof(struct foo), cache flags (redzoning, etc) +diff --git a/mm/slab.c b/mm/slab.c +index 8d27032..730fe63 100644 +--- a/mm/slab.c ++++ b/mm/slab.c +@@ -399,12 +399,13 @@ struct kmem_cache { + struct list_head next; + + /* 6) statistics */ +-#if STATS ++#if SLAB_STATS + unsigned long num_active; + unsigned long num_allocations; + unsigned long high_mark; + unsigned long grown; + unsigned long reaped; ++ unsigned long shrunk; + unsigned long errors; + unsigned long max_freeable; + unsigned long node_allocs; +@@ -415,7 +416,7 @@ struct kmem_cache { + atomic_t freehit; + atomic_t freemiss; + #endif +-#if DEBUG ++#if SLAB_DEBUG + /* + * If debugging is enabled, then the allocator can add additional + * fields and/or padding to every object. buffer_size contains the total +@@ -425,6 +426,9 @@ struct kmem_cache { + int obj_offset; + int obj_size; + #endif ++#ifdef CONFIG_BEANCOUNTERS ++ int objuse; ++#endif + /* + * We put nodelists[] at the end of kmem_cache, because we want to size + * this array to nr_node_ids slots instead of MAX_NUMNODES +@@ -452,11 +456,11 @@ struct kmem_cache { + #define REAPTIMEOUT_CPUC (2*HZ) + #define REAPTIMEOUT_LIST3 (4*HZ) + ++#if SLAB_STATS + #define STATS_INC_GROWN(x) ((x)->grown++) + #define STATS_ADD_REAPED(x,y) ((x)->reaped += (y)) + #define STATS_INC_SHRUNK(x) ((x)->shrunk++) + +-#if SLAB_STATS + #define STATS_INC_ACTIVE(x) ((x)->num_active++) + #define STATS_DEC_ACTIVE(x) ((x)->num_active--) + #define STATS_INC_ALLOCED(x) ((x)->num_allocations++) +@@ -479,6 +483,9 @@ struct kmem_cache { + #define STATS_INC_FREEHIT(x) atomic_inc(&(x)->freehit) + #define STATS_INC_FREEMISS(x) atomic_inc(&(x)->freemiss) + #else ++#define STATS_INC_GROWN(x) do { } while (0) ++#define STATS_ADD_REAPED(x,y) do { } while (0) ++#define STATS_INC_SHRUNK(x) do { } while (0) + #define STATS_INC_ACTIVE(x) do { } while (0) + #define STATS_DEC_ACTIVE(x) do { } while (0) + #define STATS_INC_ALLOCED(x) do { } while (0) +@@ -841,8 +848,12 @@ int kmem_dname_objuse(void *obj) + + unsigned long ub_cache_growth(struct kmem_cache *cachep) + { ++#if SLAB_STATS + return (cachep->grown - cachep->reaped - cachep->shrunk) + << cachep->gfporder; ++#else ++ return 0; ++#endif + } + + #define slab_ubcs(cachep, slabp) ((struct user_beancounter **)\ diff --git a/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild b/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild index 50dbecdeae60..dcda3b2f5246 100644 --- a/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild +++ b/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild,v 1.2 2009/07/21 12:38:18 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/openvz-sources/openvz-sources-2.6.27.2.1-r2.ebuild,v 1.3 2009/07/22 05:54:03 pva Exp $ inherit versionator @@ -54,7 +54,8 @@ ${FILESDIR}/${PN}-2.6.27.2.1-bridge-process-skbs.patch ${FILESDIR}/${PN}-2.6.27.2.1-bridge-set_via_phys_dev_state.patch ${FILESDIR}/${PN}-2.6.27.2.1-avoid-double-free.patch ${FILESDIR}/${PN}-2.6.27.2.1-check-for-no-mmaps.patch -${FILESDIR}/${PN}-2.6.27.2.1-pi-futex-pid-check-fixup.patch" +${FILESDIR}/${PN}-2.6.27.2.1-pi-futex-pid-check-fixup.patch +${FILESDIR}/${PN}-2.6.27.2.1-SLAB.patch" K_EXTRAEINFO="For more information about this kernel take a look at: http://wiki.openvz.org/Download/kernel/${CKV}/${CKV}-${OVZ_KV}" |