public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@MIT.EDU>
To: Valdis.Kletnieks@vt.edu, David Chinner <dgc@sgi.com>,
	Valerie Henson <val@vahconsulting.com>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Andreas Dilger <adilger@clusterfs.com>, Ric Wheeler <ric@emc.com>
Subject: Re: [RFC] Parallelize IO for e2fsck
Date: Tue, 22 Jan 2008 09:40:52 -0500	[thread overview]
Message-ID: <20080122144052.GC17804@mit.edu> (raw)
In-Reply-To: <20080122070050.GM3180@webber.adilger.int>

On Tue, Jan 22, 2008 at 12:00:50AM -0700, Andreas Dilger wrote:
> > AIX had SIGDANGER some 15 years ago.  Admittedly, that was sent when
> > the system was about to hit OOM, not when it was about to start swapping.
> 
> I'd tried to advocate SIGDANGER some years ago as well, but none of
> the kernel maintainers were interested.  It definitely makes sense
> to have some sort of mechanism like this.  At the time I first brought
> it up it was in conjunction with Netscape using too much cache on some
> system, but it would be just as useful for all kinds of other memory-
> hungry applications.

It's been discussed before, but I suspect the main reason why it was
never done is no one submitted a patch.  Also, the problem is actually
a pretty complex one.  There are a couple of different stages where
you might want to send an alert to processes:

    * Data is starting to get ejected from page/buffer cache
    * System is starting to swap
    * System is starting to really struggle to find memory
    * System is starting an out-of-memory killer

AIX's SIGDANGER really did the last two, where the OOM killer would
tend to avoid processes that had a SIGDANGER handler in favor of
processes that were SIGDANGER unaware.

Then there is the additional complexity in Linux that you have
multiple zones of memory, which at least on the historically more
popular x86 was highly, highly important.  You could say that whenever
there is sufficient memory pressure in any zone that you start
ejecting data from caches or start to swap that you start sending the
signals --- but on x86 systems with lowmem, that could happen quite
frequently, and since a user process has no idea whether its resources
are in lowmem or highmem, there's not much you can do about this.

Hopefully this is less of an issue today, since the 2.6 VM is much
more better behaved, and people are gradually moving over to x86_64
anyway.  (Sorry SGI and Intel, unfortunately they're not moving over
to the Itanic :-).   So maybe this would be better received now.

Bringing us back to the main topic at hand, one of the tradeoffs in
Val's current approach is that by relying on the kernel's buffer
cache, we don't have to worry about locking and coherency at the
userspace level.  OTOH, we give up low-level control about when memory
gets thrown out, and it also means that simply getting notified when
the system starts to swap isn't good enough.  We need to know much
earlier, when the system starts ejecting data from the buffer and page
caches.

Does this matter?  Well, there are a couple of use cases:

     * The restricted boot environment
     * The background "once a month" take a snapshot and check
     * The oh-my-gosh we-lost-a-filesystem -- repair it while the 
       IMAP server is still on-line serving data from the other 
       mounted filesystems.

It's the last case where things get really tricky....

     	      	   	 	    - Ted

  parent reply	other threads:[~2008-01-22 14:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <70b6f0bf0801161322k2740a8dch6a0d6e6e112cd2d0@mail.gmail.com>
2008-01-16 21:30 ` [RFC] Parallelize IO for e2fsck Valerie Henson
2008-01-18  1:15   ` David Chinner
2008-01-18  1:43     ` Valerie Henson
2008-01-21 23:00   ` Andreas Dilger
2008-01-22  3:38     ` David Chinner
2008-01-22  4:17       ` Valdis.Kletnieks
2008-01-22  7:00         ` Andreas Dilger
2008-01-22 13:05           ` Alan Cox
2008-01-22 14:40           ` Theodore Tso [this message]
2008-01-22 14:57             ` Arnaldo Carvalho de Melo
2008-01-28 19:30             ` Pavel Machek
2008-01-28 19:56               ` Theodore Tso
2008-01-28 20:01                 ` Pavel Machek
2008-02-03 13:51                   ` KOSAKI Motohiro
2008-01-29  8:29                 ` david
2008-01-22  7:05       ` Andreas Dilger
2008-01-22  8:16         ` David Chinner
2008-01-22 17:42       ` Bryan Henderson
     [not found] <9Mo9w-7Ws-25@gated-at.bofh.it>
     [not found] ` <9Mo9w-7Ws-23@gated-at.bofh.it>
     [not found]   ` <9OdWm-7uN-25@gated-at.bofh.it>
     [not found]     ` <9Oi9A-5EJ-3@gated-at.bofh.it>
     [not found]       ` <9OiMg-6IC-1@gated-at.bofh.it>
     [not found]         ` <9OlqL-2xG-3@gated-at.bofh.it>
     [not found]           ` <9Orda-3ub-45@gated-at.bofh.it>
2008-01-24 17:32             ` Bodo Eggert
2008-01-24 22:07               ` Andreas Dilger
2008-01-24 23:08               ` Adrian Bunk
2008-01-24 23:40                 ` Theodore Tso
2008-01-25  0:25                   ` Zan Lynx
2008-01-25 11:09                     ` Andreas Dilger
2008-01-26  0:55                       ` Zan Lynx
2008-01-26 11:56                         ` KOSAKI Motohiro
2008-01-26 12:32                   ` KOSAKI Motohiro
     [not found] <alpine.LSU.0.999.0801252338460.26260@be1.lrz>
2008-01-26  1:55 ` Bryan Henderson
2008-01-26 13:21   ` Theodore Tso

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=20080122144052.GC17804@mit.edu \
    --to=tytso@mit.edu \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=adilger@clusterfs.com \
    --cc=dgc@sgi.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ric@emc.com \
    --cc=val@vahconsulting.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