linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Miquel van Smoorenburg <miquels@cistron-office.nl>
Cc: linux-kernel@vger.kernel.org, Stephen Tweedie <sct@redhat.com>
Subject: Re: O_DIRECT! or O_DIRECT?
Date: Thu, 5 Jul 2001 16:06:32 +0100	[thread overview]
Message-ID: <20010705160632.A9968@redhat.com> (raw)
In-Reply-To: <E15HWsV-0000lM-00@f12.port.ru> <20010704185230.F28793@redhat.com> <9hvn61$rkb$1@ncc1701.cistron.net> <20010704193402.A6403@redhat.com> <9hvtvd$9o2$1@ncc1701.cistron.net>
In-Reply-To: <9hvtvd$9o2$1@ncc1701.cistron.net>; from miquels@cistron-office.nl on Wed, Jul 04, 2001 at 08:23:10PM +0000

Hi,

On Wed, Jul 04, 2001 at 08:23:10PM +0000, Miquel van Smoorenburg wrote:

> >huge copies.  But what part of the normal handling of sequential files
> >would O_SEQUENTIAL change?  Good handling of sequential files should
> >be the default, not an explicitly-requested feature.
> 
> exactly what I meant, since that is what MADV_SEQUENTIAL seems to do:
> 
> linux/mm/filemap.c:
> 
>  *  MADV_SEQUENTIAL - pages in the given range will probably be accessed
>  *              once, so they can be aggressively read ahead, and
>  *              can be freed soon after they are accessed.

We already have "drop-behind" for sequential reads --- we lower the
priority of recently read-in pages so that if they don't get accessed
again, they can be reclaimed.  This should be, and is, part of the
default kernel behaviour for such things.

The trouble is that you still need the VM to go around and clean up
those pages if you need the memory for something else.  There's a big
difference between "can be freed" and "are forcibly freed".  O_DIRECT
behaves like the latter: the memory is automatically reclaimed after
use so it results in no memory pressure at all, whereas the
MADV_SEQUENTIAL type of behaviour just allows the VM to reclaim those
pages on demand --- the VM still has to do the work.

Cheers,
 Stephen

      reply	other threads:[~2001-07-05 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03 20:34 O_DIRECT! or O_DIRECT? Samium Gromoff
2001-07-03 20:38 ` kernel
2001-07-03 21:12 ` Anton Altaparmakov
2001-07-04 17:52 ` Stephen C. Tweedie
2001-07-04 18:27   ` Miquel van Smoorenburg
2001-07-04 18:34     ` Stephen C. Tweedie
2001-07-04 20:23       ` Miquel van Smoorenburg
2001-07-05 15:06         ` Stephen C. Tweedie [this message]

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=20010705160632.A9968@redhat.com \
    --to=sct@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquels@cistron-office.nl \
    /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;
as well as URLs for NNTP newsgroup(s).