From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: hannes@cmpxchg.org, hannes@saeurebad.de,
kosaki.motohiro@jp.fujitsu.com, npiggin@suse.de, riel@redhat.com
Subject: + mm-more-likely-reclaim-madv_sequential-mappings.patch added to -mm tree
Date: Tue, 11 Nov 2008 16:00:51 -0800 [thread overview]
Message-ID: <200811120000.mAC00pOf030889@imap1.linux-foundation.org> (raw)
The patch titled
mm: more likely reclaim MADV_SEQUENTIAL mappings
has been added to the -mm tree. Its filename is
mm-more-likely-reclaim-madv_sequential-mappings.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: mm: more likely reclaim MADV_SEQUENTIAL mappings
From: Johannes Weiner <hannes@cmpxchg.org>
File pages mapped only in sequentially read mappings are perfect reclaim
canditates.
This patch makes these mappings behave like weak references, their pages
will be reclaimed unless they have a strong reference from a normal
mapping as well.
It changes the reclaim and the unmap path where they check if the page has
been referenced. In both cases, accesses through sequentially read
mappings will be ignored.
Benchmark results from KOSAKI Motohiro:
http://marc.info/?l=linux-mm&m=122485301925098&w=2
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory.c | 3 ++-
mm/rmap.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff -puN mm/memory.c~mm-more-likely-reclaim-madv_sequential-mappings mm/memory.c
--- a/mm/memory.c~mm-more-likely-reclaim-madv_sequential-mappings
+++ a/mm/memory.c
@@ -757,7 +757,8 @@ static unsigned long zap_pte_range(struc
else {
if (pte_dirty(ptent))
set_page_dirty(page);
- if (pte_young(ptent))
+ if (pte_young(ptent) &&
+ likely(!VM_SequentialReadHint(vma)))
mark_page_accessed(page);
file_rss--;
}
diff -puN mm/rmap.c~mm-more-likely-reclaim-madv_sequential-mappings mm/rmap.c
--- a/mm/rmap.c~mm-more-likely-reclaim-madv_sequential-mappings
+++ a/mm/rmap.c
@@ -360,8 +360,17 @@ static int page_referenced_one(struct pa
goto out_unmap;
}
- if (ptep_clear_flush_young_notify(vma, address, pte))
- referenced++;
+ if (ptep_clear_flush_young_notify(vma, address, pte)) {
+ /*
+ * Don't treat a reference through a sequentially read
+ * mapping as such. If the page has been used in
+ * another mapping, we will catch it; if this other
+ * mapping is already gone, the unmap path will have
+ * set PG_referenced or activated the page.
+ */
+ if (likely(!VM_SequentialReadHint(vma)))
+ referenced++;
+ }
/* Pretend the page is referenced if the task has the
swap token and is in the middle of a page fault. */
_
Patches currently in -mm which might be from hannes@cmpxchg.org are
mm-more-likely-reclaim-madv_sequential-mappings.patch
next reply other threads:[~2008-11-12 0:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 0:00 akpm [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-07-21 1:47 + mm-more-likely-reclaim-madv_sequential-mappings.patch added to -mm tree akpm
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=200811120000.mAC00pOf030889@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hannes@saeurebad.de \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=riel@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