Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-18 Thread David S. Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Thu, 18 Aug 2005 09:14:47 +0200 > After reading your suggestions, I understand we still need two slabs. > One (filp_cachep) without the readahead data, the other one > (filp_ra_cachep) with it. Correct. > static inline struct file_ra_state *get_ra_sta

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-18 Thread Eric Dumazet
David S. Miller a écrit : From: Andi Kleen <[EMAIL PROTECTED]> Date: Thu, 18 Aug 2005 03:05:25 +0200 I would just set the ra pointer to a single global structure if the allocation fails. Then you can avoid all the other checks. It will slow down things and trash some state, but not fail and no

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Eric Dumazet
object size is 10*sizeof(long), so alignment would loose 6*sizeof(long) bytes for each object. [PATCH] * struct file cleanup : the very large file_ra_state is now allocated only on demand, using a dedicated "file_ra" slab. 64bits machines handling lot of sockets can sa

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Nick Piggin
Andi Kleen wrote: You don't want to always have bad performance though, so you could attempt to allocate if either the pointer is null _or_ it points to the global structure? Remember it's after a GFP_KERNEL OOM. If that fails most likely you have deadlocked somewhere else already because Lin

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Andi Kleen
> You don't want to always have bad performance though, so you > could attempt to allocate if either the pointer is null _or_ it > points to the global structure? Remember it's after a GFP_KERNEL OOM. If that fails most likely you have deadlocked somewhere else already because Linux's handling of

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Nick Piggin
Andi Kleen wrote: I would just set the ra pointer to a single global structure if the allocation fails. Then you can avoid all the other checks. It will slow down things and trash some state, but not fail and nobody should expect good performance after out of memory anyways. The only check sti

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread David S. Miller
From: Andi Kleen <[EMAIL PROTECTED]> Date: Thu, 18 Aug 2005 03:05:25 +0200 > I would just set the ra pointer to a single global structure if the > allocation fails. Then you can avoid all the other checks. It will > slow down things and trash some state, but not fail and nobody > should expect goo

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Coywolf Qi Hunt
ood. > > I also chose not to align "file_ra" slab on SLAB_HWCACHE_ALIGN because the > object size is 10*sizeof(long), so alignment would loose > 6*sizeof(long) bytes for each object. > > > [PATCH] > > * struct file cleanup : the very large file_ra_state is

Re: [PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Andi Kleen
On Thu, Aug 18, 2005 at 02:40:46AM +0200, Eric Dumazet wrote: > Andi Kleen a ?crit : > > > > >>(because of the insane struct file_ra_state f_ra. I wish this structure > >>were dynamically allocated only for files that really use it) > > > > > >How about you submit a patch for that instead? > > >

[PATCH] struct file cleanup : the very large file_ra_state is now allocated only on demand.

2005-08-17 Thread Eric Dumazet
s for each object. [PATCH] * struct file cleanup : the very large file_ra_state is now allocated only on demand, using a dedicated "file_ra" slab. 64bits machines handling lot of sockets can save about 72 bytes per file. * private_data : The field is moved close to f_count and f_