From: "Stephen C. Tweedie" <sct@redhat.com>
To: Rik van Riel <H.H.vanRiel@phys.uu.nl>
Cc: Andrea Arcangeli <arcangeli@mbox.queen.it>,
Linux MM <linux-mm@kvack.org>,
Linux Kernel <linux-kernel@vger.rutgers.edu>
Subject: Re: cp file /dev/zero <-> cache [was Re: increasing page size]
Date: Mon, 6 Jul 1998 11:24:25 +0100 [thread overview]
Message-ID: <199807061024.LAA00796@dax.dcs.ed.ac.uk> (raw)
In-Reply-To: <Pine.LNX.3.96.980705185219.1574D-100000@mirkwood.dummy.home>
Hi,
On Sun, 5 Jul 1998 19:00:04 +0200 (CEST), Rik van Riel
<H.H.vanRiel@phys.uu.nl> said:
> On Sun, 5 Jul 1998, Andrea Arcangeli wrote:
>> Where does the cache is allocated? Is it allocated in the inode? If so
>> kswapd should shrink the inode before start swapping out!
> The cache is also mapped into a process'es address space.
> Currently we would have to walk all pagetables to find a
> specific page ;(
Not in this case, where the file is just being copied. For a copy, the
reads exist unmapped in the page cache; only mmap() creates mapped
pages.
> When Stephen and Ben have merged their PTE stuff, we can
> do the freeing much easier though...
In this case, it's not an issue, so we need to fix it for 2.2.
>> I had to ask "2.0.34 has balancing code implemented and
>> running?". The
> 2.0 has no balancing code at all. At least, not AFAIK...
It does: the Duff's device in try_to_free_page does it, and seems to
work well enough. It was certainly tuned tightly enough: all of the
hard part of getting the kswap stuff working well in try_to_swap_out()
was to do with tuning the aggressiveness of swap relative to the buffer
and cache reclaim mechanisms so that the try_to_free_page loop works
well. That's why the recent policies of adding little rules here and
there all over the mm layer have disturbed the balance so much, I think.
>> Is there a function call (such us shrink_mmap for mmap or
>> kmem_cache_reap() for slab or shrink_dcache_memory() for dcache) that
>> is able to shrink the cache allocated by cp file /dev/zero?
> shrink_mmap() can only shrink unlocked and clean buffer pages
> and unmapped cache pages. We need to go through either bdflush
> (for buffer) or try_to_swap_out() first, in order to make some
> easy victims for shrink_mmap()...
Only for mapped files, not files copied through the standard read/write
calls.
--Stephen
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1998-07-06 11:08 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.96.980705072829.17879D-100000@mirkwood.dummy.home>
1998-07-05 11:32 ` Andrea Arcangeli
1998-07-05 17:00 ` Rik van Riel
1998-07-05 18:38 ` Andrea Arcangeli
1998-07-05 19:31 ` Rik van Riel
1998-07-06 10:38 ` Stephen C. Tweedie
1998-07-06 11:42 ` Rik van Riel
1998-07-06 14:20 ` Andrea Arcangeli
1998-07-06 10:31 ` Stephen C. Tweedie
1998-07-06 12:34 ` Andrea Arcangeli
1998-07-06 14:36 ` Stephen C. Tweedie
1998-07-06 19:28 ` Andrea Arcangeli
1998-07-07 12:01 ` Stephen C. Tweedie
1998-07-07 15:54 ` Rik van Riel
1998-07-07 17:32 ` Benjamin C.R. LaHaise
1998-07-08 13:54 ` Stephen C. Tweedie
1998-07-08 21:19 ` Andrea Arcangeli
1998-07-11 11:18 ` Rik van Riel
1998-07-11 21:11 ` Stephen C. Tweedie
1998-07-08 13:45 ` Stephen C. Tweedie
1998-07-08 18:57 ` Rik van Riel
1998-07-08 22:11 ` Stephen C. Tweedie
1998-07-09 7:43 ` Rik van Riel
1998-07-09 20:39 ` Rik van Riel
1998-07-13 11:54 ` Stephen C. Tweedie
1998-07-05 18:57 ` MOLNAR Ingo
1998-07-06 10:24 ` Stephen C. Tweedie [this message]
1998-07-06 13:37 ` Eric W. Biederman
1998-07-07 12:35 ` Stephen C. Tweedie
1998-07-09 13:01 Zachary Amsden
[not found] <199807091442.PAA01020@dax.dcs.ed.ac.uk>
1998-07-09 18:59 ` Rik van Riel
1998-07-09 23:37 ` Stephen C. Tweedie
1998-07-10 5:57 ` Rik van Riel
1998-07-11 14:14 ` Rik van Riel
1998-07-11 21:23 ` Stephen C. Tweedie
1998-07-11 22:25 ` Rik van Riel
1998-07-13 13:23 ` Stephen C. Tweedie
1998-07-12 1:47 ` Benjamin C.R. LaHaise
1998-07-13 13:42 ` Stephen C. Tweedie
1998-07-18 22:10 ` Rik van Riel
1998-07-20 16:04 ` Stephen C. Tweedie
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=199807061024.LAA00796@dax.dcs.ed.ac.uk \
--to=sct@redhat.com \
--cc=H.H.vanRiel@phys.uu.nl \
--cc=arcangeli@mbox.queen.it \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
/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