[Devel] Re: [RFC][PATCH 1/2] add user namespace [try #2]

Dave Hansen haveblue at us.ibm.com
Mon Aug 28 08:40:47 PDT 2006


On Mon, 2006-08-28 at 17:32 +0200, Cedric Le Goater wrote:
> Dave Hansen wrote:
> > On Mon, 2006-08-28 at 16:56 +0200, Cedric Le Goater wrote:
> >> +#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) 
> > 
> > How about an actual #ifdef here?
> 
> yep. because i moved from a .c to .h and/or to improve readability ?

Just for readability.  Maybe my brain is defective, but I just don't
parse the foo?bar:baz stuff very well.

> > Or, should we just do this one in Kconfig?
> 
> do you mean defining UIDHASH_BITS in KCONFIG ? We would need to that for
> other constant then and a fast grep gives me :

Something like

#define UIDHASH_BITS CONFIG_UID_HASH_BITS

config UID_HASH_BITS
	int
	default 3 if BASE_SMALL
	default 8

But, I guess the incentive is pretty small when there are really only
two values, and the logic is extremely simple.

> include/asm-i386/mach-default/mach_mpspec.h:#if CONFIG_BASE_SMALL == 0
> include/linux/threads.h:#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000
> : 0x8000)
> include/linux/threads.h:#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ?
> PAGE_SIZE * 8 : \
> include/linux/user.h:#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
> include/linux/vt_kern.h:#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 :
> PAGE_SIZE)
> include/linux/autoconf.h:#define CONFIG_BASE_SMALL 0
> include/config/auto.conf:CONFIG_BASE_SMALL=0
> kernel/futex.c:#define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
> kernel/timer.c:#define TVN_BITS (CONFIG_BASE_SMALL ? 4 : 6)
> kernel/timer.c:#define TVR_BITS (CONFIG_BASE_SMALL ? 6 : 8)
> lib/radix-tree.c:#define RADIX_TREE_MAP_SHIFT   (CONFIG_BASE_SMALL ? 4 : 6)
> 
> we should probably keep it that way.

I know, I know. ;)  But, a lot of these definitions were from before we
had our nice, pretty Kconfig language.  I don't think it's much of a
crime to break tradition on these.

Anyway, it's not a big deal either way.

-- Dave

_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list