lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 03 Apr 2007 17:29:24 +1000
From:	Nick Piggin <nickpiggin@...oo.com.au>
To:	Christoph Lameter <clameter@....com>
CC:	akpm@...l.org, linux-mm@...ck.org, mpm@...enic.com,
	linux-kernel@...r.kernel.org, Christoph Hellwig <hch@...radead.org>
Subject: Re: [SLUB 1/2] SLUB core

Christoph Lameter wrote:
> SLUB Core patch V6
> 
> This provides basic SLUB functionality and allows a choice of
> slab allocators during kernel configuration. The default is still
> slab. SLUB has been tested in various configurations but I think we
> can be quite sure that there are still remaining issues.
> 
> SLUB is not selectable on platforms that modify the page structs of
> slab memory (i386, FRV) but see the next patch for a i386 fix.
> 
> Signed-off-by: Christoph Lameter <clameter@....com>
> 
> Index: linux-2.6.21-rc5-mm3/include/linux/mm_types.h
> ===================================================================
> --- linux-2.6.21-rc5-mm3.orig/include/linux/mm_types.h	2007-03-30 21:50:18.000000000 -0700
> +++ linux-2.6.21-rc5-mm3/include/linux/mm_types.h	2007-03-30 21:50:42.000000000 -0700
> @@ -19,10 +19,16 @@ struct page {
>  	unsigned long flags;		/* Atomic flags, some possibly
>  					 * updated asynchronously */
>  	atomic_t _count;		/* Usage count, see below. */
> -	atomic_t _mapcount;		/* Count of ptes mapped in mms,
> +	union {
> +		atomic_t _mapcount;	/* Count of ptes mapped in mms,
>  					 * to show when page is mapped
>  					 * & limit reverse map searches.
>  					 */
> +		struct {	/* SLUB uses */
> +			short unsigned int inuse;
> +			short unsigned int offset;
> +		};
> +	};
>  	union {
>  	    struct {
>  		unsigned long private;		/* Mapping-private opaque data:
> @@ -43,8 +49,15 @@ struct page {
>  #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
>  	    spinlock_t ptl;
>  #endif
> +	    struct {			/* SLUB uses */
> +		struct page *first_page;	/* Compound pages */
> +		struct kmem_cache *slab;	/* Pointer to slab */
> +	    };
> +	};
> +	union {
> +		pgoff_t index;		/* Our offset within mapping. */
> +		void *freelist;		/* SLUB: pointer to free object */
>  	};
> -	pgoff_t index;			/* Our offset within mapping. */
>  	struct list_head lru;		/* Pageout list, eg. active_list
>  					 * protected by zone->lru_lock !
>  					 */

I have an alternate suggestion for the struct page overloading issue.

I think anonymous unions are probably better than nothing, because they
make the .c code more readable, but they clutter up the header badly
and don't provide so strong type checking as we could implement.

This is just an incomplete RFC patch, because it actually requires a
fair amount of types in .c code to be changed if we are to implement it
(which I didn't want to do if nobody likes the idea).

(sorry it's an attachment, this mailer is broken)

-- 
SUSE Labs, Novell Inc.

View attachment "mm-multi-page.patch" of type "text/plain" (3339 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ