LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Tobias Ringstrom <tori@ringstrom.mine.nu>
Cc: Simon Kirby <sim@netnation.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.4.11pre4 swapping out all over the place
Date: Sun, 7 Oct 2001 10:39:26 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.33.0110071031160.7151-100000@penguin.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0110070906020.30872-100000@boris.prodako.se>
On Sun, 7 Oct 2001, Tobias Ringstrom wrote:
>
> On Sat, 6 Oct 2001, Linus Torvalds wrote:
> >
> > Ok, can you try this slightly more involved patch instead? It basically
> > keeps the old try_to_free_pages() (it _looks_ different, but the logic is
> > the same), but also should honour the OOM-killer.
>
> Yes, this patch also solves the problem.
Good.
> I just noticed that when reading from an umounted block device, the pages
> are not cached between runs, i.e. the cache is dropped on close(). If the
> block device contains a mounted filesystem, the pages are not dropped.
> Is this intentional?
It's intentional, although something that can probably be discussed. The
reasons for it are:
- devices with broken or unreliable disk change mechanisms
- the current dynamic [de-]allocation of block device data structures.
- historical coherency reasons.
None of the reasons for it are very strong - the block device data
structure one is a _current_ implementation detail that has a lot of
reasons going for it, but it's not something that is inherent in any real
major design (we could reasonably easily delay the block device data
structure release for some time).
> I was also thinking about Simon's CD-burning case, and the fact that the
> used-once logic really does not work very well for such cases. You
> usually first run mkisofs to create the image, and then read the image
> when writing the CD. This is similar to running
>
> dd if=/dev/zero of=/tmp/cd bs=1M count=300
> dd if=/tmp/cd of=/dev/null
Well, I actually champion not considering writes accesses _at_all_, but I
was overruled by Marcelo Tosatti. However, I bet that a good example would
change his mind - and a benchmark.
This is easy to test: remove the "SetPageReferenced(page);" from the
generic_file_write() function (note how the current code is a mix between
my "writes aren't references" and Marcelo's "writes are accesses like
reads" - it only marks a page referenced, it never actually activates it).
Are there other valid points in this discussion? I'd love to have a strong
reason for doing what we're doing (which we don't have right now).
> In this case, the pages are activated. That is not too bad, since the
> system now seems to be able to free even active cache pages before paging
> out stuff. (BTW, does it always free all cache before paging out?
> That would most likely be very bad for many scenarios.)
No, activating the pages only makes them slightly harder to get rid of,
they don't become "pinned".
Linus
next prev parent reply other threads:[~2001-10-07 17:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-06 8:06 Simon Kirby
2001-10-06 8:59 ` Tobias Ringstrom
2001-10-06 16:09 ` Linus Torvalds
2001-10-06 17:49 ` Tobias Ringstrom
2001-10-06 21:59 ` Linus Torvalds
2001-10-07 4:59 ` Simon Kirby
2001-10-07 7:43 ` Tobias Ringstrom
2001-10-07 17:39 ` Linus Torvalds [this message]
2001-10-07 17:56 ` Alexander Viro
2001-10-07 4:57 ` David S. Miller
2001-10-06 22:52 ` Andrea Arcangeli
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=Pine.LNX.4.33.0110071031160.7151-100000@penguin.transmeta.com \
--to=torvalds@transmeta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sim@netnation.com \
--cc=tori@ringstrom.mine.nu \
--subject='Re: 2.4.11pre4 swapping out all over the place' \
/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
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).