mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Ray Lee <ray-lk@madrabbit.org>
Cc: Andrew Morton <akpm@osdl.org>,
	sct@redhat.com, pbadari@us.ibm.com,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	ext2-devel@lists.sourceforge.net
Subject: Re: [Ext2-devel] Re: [PATCH 2/3] ext3 reservation allow turn off for specifed file
Date: 25 Oct 2004 13:33:05 -0700	[thread overview]
Message-ID: <1098736389.9692.7243.camel@w-ming2.beaverton.ibm.com> (raw)
In-Reply-To: <1098294941.18850.4.camel@orca.madrabbit.org>

On Wed, 2004-10-20 at 10:55, Ray Lee wrote:
> On Mon, 2004-10-18 at 18:01 -0700, Mingming Cao wrote:
> > On Mon, 2004-10-18 at 16:42, Andrew Morton wrote:
> > > Applications currently pass a seeky-access hint into the kernel via
> > > posix_fadvise(POSIX_FADV_RANDOM).  It would be nice to hook into that
> 
> [...]
> 
> > Just thought seeky random write application could use the existing ioctl
> > to let the kernel know it does not need reservation at all. Isn't that
> > more straightforward?
> 
> Going the ioctl route seems to imply that userspace would have to do a
> posix_fadvise() call and the ioctl, as opposed to just the fadvise. No?
> I'm betting the fadvise call is a little more portable as well.

Agreed. How about this: add a check in ext3_prepare_write(), if user passed seeky-access hint through posix_fadvise(via check for file->f_ra.ra_pages == 0), if so, close the reservation window.  But we still need previous patch to handle window size 0(no reservation) in reservation code.

Currently the readahead is turned off if the userspace passed a seeky access hint to kernel by POSIX_FADVISE. It would be nice to turn off the block allocation reservation as well for seeky random write.


---

 linux-2.6.9-rc4-mm1-ming/fs/ext3/inode.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -puN fs/ext3/inode.c~ext3_turn_off_reservation_by_fadvise fs/ext3/inode.c
--- linux-2.6.9-rc4-mm1/fs/ext3/inode.c~ext3_turn_off_reservation_by_fadvise	2004-10-25 18:25:44.135751800 -0700
+++ linux-2.6.9-rc4-mm1-ming/fs/ext3/inode.c	2004-10-25 18:34:39.501363856 -0700
@@ -1008,6 +1008,15 @@ retry:
 		ret = PTR_ERR(handle);
 		goto out;
 	}
+
+	/*
+	 * 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.
+	 */
+	if (!file->f_ra.ra_pages)
+		atomic_set(&EXT3_I(inode)->i_rsv_window.rsv_goal_size, 0);
+
 	ret = block_prepare_write(page, from, to, ext3_get_block);
 	if (ret)
 		goto prepare_write_failed;

_


  reply	other threads:[~2004-10-25 20:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-15 13:27 Ext3 -mm reservations code: is this fix really correct? Stephen C. Tweedie
2004-10-15 16:01 ` [Ext2-devel] " mingming cao
2004-10-15 16:40   ` Stephen C. Tweedie
2004-10-15 20:29     ` mingming cao
2004-10-15 22:20       ` Stephen C. Tweedie
2004-10-15 22:34         ` mingming cao
2004-10-18 22:55           ` [PATCH 2/3] ext3 reservation allow turn off for specifed file Mingming Cao
2004-10-18 23:42             ` Andrew Morton
2004-10-19  1:01               ` Mingming Cao
2004-10-20 17:55                 ` Ray Lee
2004-10-25 20:33                   ` Mingming Cao [this message]
2004-10-25 23:05                     ` [Ext2-devel] " Mingming Cao
2004-10-25 23:45                       ` Andrew Morton
2004-10-26 16:53                         ` Mingming Cao
2004-10-26 20:18                           ` Andrew Morton
2004-10-26 23:01                             ` Mingming Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1098736389.9692.7243.camel@w-ming2.beaverton.ibm.com \
    --to=cmm@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=ray-lk@madrabbit.org \
    --cc=sct@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®