OpenVZ Forum


Home » Mailing lists » Devel » Re: [RFC][PATCH 1/2] add user namespace [try #2]
Re: [RFC][PATCH 1/2] add user namespace [try #2] [message #16539] Mon, 28 August 2006 15:40 Go to next message
Dave Hansen is currently offline  Dave Hansen
Messages: 240
Registered: October 2005
Senior Member
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@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: [RFC][PATCH 1/2] add user namespace [try #2] [message #16547 is a reply to message #16539] Mon, 28 August 2006 16:16 Go to previous message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
Dave Hansen wrote:

> 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.

limiting the number of users per container could be something useful. we
could use such a configuration variable to define more appropriately the
size of the hash table.

using a hlist_head in user_namespace should also save some space.

C.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Previous Topic: Re: [RFC][PATCH 1/2] add user namespace [try #2]
Next Topic: Re: [RFC][PATCH 1/2] add user namespace [try #2]
Goto Forum:
  


Current Time: Tue Sep 17 17:59:05 GMT 2024

Total time taken to generate the page: 0.05062 seconds