[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1107121046000.2530@router.home>
Date: Tue, 12 Jul 2011 10:55:22 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Pekka Enberg <penberg@...nel.org>
cc: Eric Dumazet <eric.dumazet@...il.com>,
Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH next/mmotm] slub: partly fix freeze in __slab_free
I wish there would be some easier way to overlay fields. The counters
field exists to allow an easier reference to the bitfield structure in
order to pass it to cmpxchg_double_slab.
In 64 bit the counters field needs to overlay the bitfields and _count
since we can only pass 64 bits integers to cmpxchg_double_slab.
On 32 bit counters field only covers the bitfields.
The "new" page struct in __slab_free is only partially populated and the
overlays are used for conversion between structs and words in order to be
able to pass the struct contents by value.
Signed-off-by: Christoph Lameter <cl@...ux.com>
---
include/linux/mm_types.h | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
Index: linux-2.6/include/linux/mm_types.h
===================================================================
--- linux-2.6.orig/include/linux/mm_types.h 2011-07-12 10:14:08.057706223 -0500
+++ linux-2.6/include/linux/mm_types.h 2011-07-12 10:14:14.117706184 -0500
@@ -56,20 +56,26 @@ struct page {
};
union {
- atomic_t _mapcount; /* Count of ptes mapped in mms,
+ /* Used for cmpxchg_double in slub */
+ unsigned long counters;
+
+ struct {
+
+ union {
+ atomic_t _mapcount; /* Count of ptes mapped in mms,
* to show when page is mapped
* & limit reverse map searches.
*/
- /* Used for cmpxchg_double in slub */
- unsigned long counters;
- struct {
- unsigned inuse:16;
- unsigned objects:15;
- unsigned frozen:1;
+ struct {
+ unsigned inuse:16;
+ unsigned objects:15;
+ unsigned frozen:1;
+ };
+ };
+ atomic_t _count; /* Usage count, see below. */
};
};
- atomic_t _count; /* Usage count, see below. */
};
/* Third double word block */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists