Re: [PATCH] fs: add FD_CLOFORK and O_CLOFORK

From: Eric Dumazet
Date: Sat May 07 2011 - 08:32:45 EST


Le samedi 07 mai 2011 Ã 13:41 +0200, Geert Uytterhoeven a Ãcrit :
> On Sat, May 7, 2011 at 08:29, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> > I am sure the following idea already was discussed in the past :
> >
> > Embed the close_on_exec / close_on_close bits in the low order bits of
> > file pointers.
>
> How many low order bits do you expect to have in file pointers?
> Are files allocated using kmalloc(), or do they just obey the alignment of the
> individual members of a file struct? In the latter case, you'll have onlyv1 low
> order bit to play with on m68k.

We should have two bits at a very minimum.

clone_on_exec & clone_on_fork would fit.

filp are allocated with a kmem_cachep with cache line alignement.

filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);

So in practice we should have more than two bits ;)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/