lkml.org 
[lkml]   [2004]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Ext2-devel] Re: [PATCH 2/3] ext3 reservation allow turn off for specifed file
Mingming Cao <cmm@us.ibm.com> wrote:
>
> /*
> + * if user passed a seeky-access hint to kernel,
> + * through POSIX_FADV_RANDOM,(file->r_ra.ra_pages is cleared)
> + * turn off reservation for block allocation correspondingly.
> + *
> + * Otherwise, if user switch back to POSIX_FADV_SEQUENTIAL or
> + * POSIX_FADV_NORMAL, re-open the reservation window.
> + */
> + windowsz = atomic_read(&EXT3_I(inode)->i_rsv_window.rsv_goal_size);
> + if ((windowsz > 0) && (!file->f_ra.ra_pages))
> + atomic_set(&EXT3_I(inode)->i_rsv_window.rsv_goal_size, -1);
> + if ((windowsz == -1) && file->f_ra.ra_pages)
> + atomic_set(&EXT3_I(inode)->i_rsv_window.rsv_goal_size,
> + EXT3_DEFAULT_RESERVE_BLOCKS);
> +

It's pretty sad that we add this extra code into ext3_prepare_write() -
it's almost never actually executed.

I wonder how important this optimisation really is? I bet no applications
are using posix_fadvise(POSIX_FADV_RANDOM) anyway.

It we really see that benefits are available from this approach we probably
need to bite the bullet and add file_operations.fadvise()
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.056 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site