login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
30
Re: [PATCH 2/3] Reclaim invalidated page ASAP
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Minchan Kim
Subject:
Re: [PATCH 2/3] Reclaim invalidated page ASAP
Date: Tuesday, November 30, 2010 - 7:03 am
On Tue, Nov 30, 2010 at 12:20:41PM +0100, Johannes Weiner wrote:
quoted text
> On Tue, Nov 30, 2010 at 07:41:30AM +0900, Minchan Kim wrote: > > > diff --git a/mm/swap.c b/mm/swap.c > > index 19e0812..1f1f435 100644 > > --- a/mm/swap.c > > +++ b/mm/swap.c > > @@ -275,28 +275,51 @@ void add_page_to_unevictable_list(struct page *page) > > * into inative list's head. Because the VM expects the page would > > * be writeout by flusher. The flusher's writeout is much effective > > * than reclaimer's random writeout. > > + * > > + * If the page isn't page_mapped and dirty/writeback, the page > > + * could reclaim asap using PG_reclaim. > > + * > > + * 1. active, mapped page -> none > > + * 2. active, dirty/writeback page -> inactive, head, PG_reclaim > > + * 3. inactive, mapped page -> none > > + * 4. inactive, dirty/writeback page -> inactive, head, PG_reclaim > > + * 5. Others -> none > > + * > > + * In 4, why it moves inactive's head, the VM expects the page would > > + * be writeout by flusher. The flusher's writeout is much effective than > > + * reclaimer's random writeout. > > */ > > static void __lru_deactivate(struct page *page, struct zone *zone) > > { > > int lru, file; > > - unsigned long vm_flags; > > + int active = 0; > > vm_flags is never used in this series.
It's garbage in my old version which is used page_referenced.
quoted text
> > > - if (!PageLRU(page) || !PageActive(page)) > > + if (!PageLRU(page)) > > return; > > - > > /* Some processes are using the page */ > > if (page_mapped(page)) > > return; > > - > > - file = page_is_file_cache(page); > > - lru = page_lru_base_type(page); > > - del_page_from_lru_list(zone, page, lru + LRU_ACTIVE); > > - ClearPageActive(page); > > - ClearPageReferenced(page); > > - add_page_to_lru_list(zone, page, lru); > > - __count_vm_event(PGDEACTIVATE); > > - > > - update_page_reclaim_stat(zone, page, file, 0); > > + if (PageActive(page)) > > + active = 1; > > active = PageActive(page)
Will fix.
quoted text
> > > + if (PageWriteback(page) || PageDirty(page)) { > > + /* > > + * PG_reclaim could be raced with end_page_writeback > > + * It can make readahead confusing. But race window > > + * is _really_ small and it's non-critical problem. > > + */ > > + SetPageReclaim(page); > > + > > + file = page_is_file_cache(page); > > + lru = page_lru_base_type(page); > > + del_page_from_lru_list(zone, page, lru + active); > > + ClearPageActive(page); > > + ClearPageReferenced(page); > > + add_page_to_lru_list(zone, page, lru); > > + if (active) > > + __count_vm_event(PGDEACTIVATE); > > + update_page_reclaim_stat(zone, page, file, 0); > > + } > > If we lose the race with writeback, the completion handler won't see > PG_reclaim, won't move the page, and we have an unwanted clean cache > page on the active list. Given the pagevec caching of those pages it > could be rather likely that IO completes before the above executes. > > Shouldn't this be > > if (PageWriteback() || PageDirty()) { > SetPageReclaim() > move_to_inactive_head() > } else { > move_to_inactive_tail() > } > > instead?
Fair enough. Thanks, Hannes.
quoted text
> > Hannes
-- Kind regards, Minchan Kim --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH v3 0/3] f/madivse(DONTNEED) support
, Minchan Kim
, (Mon Nov 29, 8:23 am)
[PATCH v3 1/3] deactivate invalidated pages
, Minchan Kim
, (Mon Nov 29, 8:23 am)
[PATCH 2/3] Reclaim invalidated page ASAP
, Minchan Kim
, (Mon Nov 29, 8:23 am)
[PATCH v3 3/3] Prevent activation of page in madvise_dontneed
, Minchan Kim
, (Mon Nov 29, 8:23 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Mel Gorman
, (Mon Nov 29, 9:57 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Minchan Kim
, (Mon Nov 29, 3:41 pm)
Re: [PATCH v3 1/3] deactivate invalidated pages
, KOSAKI Motohiro
, (Mon Nov 29, 6:01 pm)
Re: [PATCH v3 3/3] Prevent activation of page in madvise_d ...
, KOSAKI Motohiro
, (Mon Nov 29, 6:08 pm)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, KOSAKI Motohiro
, (Mon Nov 29, 6:10 pm)
Re: [PATCH v3 1/3] deactivate invalidated pages
, Johannes Weiner
, (Mon Nov 29, 10:22 pm)
Re: [PATCH v3 1/3] deactivate invalidated pages
, Minchan Kim
, (Mon Nov 29, 11:18 pm)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Mel Gorman
, (Tue Nov 30, 2:16 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Mel Gorman
, (Tue Nov 30, 2:18 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Johannes Weiner
, (Tue Nov 30, 4:20 am)
Re: [PATCH v3 3/3] Prevent activation of page in madvise_d ...
, Johannes Weiner
, (Tue Nov 30, 4:35 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Minchan Kim
, (Tue Nov 30, 7:01 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Minchan Kim
, (Tue Nov 30, 7:03 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Minchan Kim
, (Tue Nov 30, 7:04 am)
Re: [PATCH 2/3] Reclaim invalidated page ASAP
, Ben Gamari
, (Tue Nov 30, 7:11 am)
Re: [PATCH v3 3/3] Prevent activation of page in madvise_d ...
, Hugh Dickins
, (Tue Nov 30, 11:34 am)
Re: [PATCH v3 3/3] Prevent activation of page in madvise_d ...
, Minchan Kim
, (Tue Nov 30, 5:49 pm)
Re: [PATCH v3 3/3] Prevent activation of page in madvise_d ...
, Minchan Kim
, (Tue Nov 30, 5:50 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate