login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
8
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
view
thread
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Nick Piggin
Subject:
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
Date: Sunday, October 7, 2007 - 11:37 pm
On Tuesday 09 October 2007 02:54, Peter Zijlstra wrote:
quoted text
> It seems that with the recent usage of ->page_mkwrite() a little detail > was overlooked. > > .22-rc1 merged OCFS2 usage of this hook > .23-rc1 merged XFS usage > .24-rc1 will most likely merge NFS usage > > Please consider this for .23 final and maybe even .22.x > > --- > Subject: mm: set_page_dirty_balance() vs ->page_mkwrite() > > All the current page_mkwrite() implementations also set the page dirty. > Which results in the set_page_dirty_balance() call to _not_ call balance, > because the page is already found dirty. > > This allows us to dirty a _lot_ of pages without ever hitting > balance_dirty_pages(). Not good (tm). > > Force a balance call if ->page_mkwrite() was successful.
Would it be better to just have the callers set_page_dirty_balance()?
quoted text
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > --- > include/linux/writeback.h | 2 +- > mm/memory.c | 9 +++++++-- > mm/page-writeback.c | 4 ++-- > 3 files changed, 10 insertions(+), 5 deletions(-) > > Index: linux-2.6/include/linux/writeback.h > =================================================================== > --- linux-2.6.orig/include/linux/writeback.h > +++ linux-2.6/include/linux/writeback.h > @@ -137,7 +137,7 @@ int sync_page_range(struct inode *inode, > loff_t pos, loff_t count); > int sync_page_range_nolock(struct inode *inode, struct address_space > *mapping, loff_t pos, loff_t count); > -void set_page_dirty_balance(struct page *page); > +void set_page_dirty_balance(struct page *page, int page_mkwrite); > void writeback_set_ratelimit(void); > > /* pdflush.c */ > Index: linux-2.6/mm/memory.c > =================================================================== > --- linux-2.6.orig/mm/memory.c > +++ linux-2.6/mm/memory.c > @@ -1559,6 +1559,7 @@ static int do_wp_page(struct mm_struct * > struct page *old_page, *new_page; > pte_t entry; > int reuse = 0, ret = 0; > + int page_mkwrite = 0; > struct page *dirty_page = NULL; > > old_page = vm_normal_page(vma, address, orig_pte); > @@ -1607,6 +1608,8 @@ static int do_wp_page(struct mm_struct * > page_cache_release(old_page); > if (!pte_same(*page_table, orig_pte)) > goto unlock; > + > + page_mkwrite = 1; > } > dirty_page = old_page; > get_page(dirty_page); > @@ -1691,7 +1694,7 @@ unlock: > * do_no_page is protected similarly. > */ > wait_on_page_locked(dirty_page); > - set_page_dirty_balance(dirty_page); > + set_page_dirty_balance(dirty_page, page_mkwrite); > put_page(dirty_page); > } > return ret; > @@ -2238,6 +2241,7 @@ static int __do_fault(struct mm_struct * > struct page *dirty_page = NULL; > struct vm_fault vmf; > int ret; > + int page_mkwrite = 0; > > vmf.virtual_address = (void __user *)(address & PAGE_MASK); > vmf.pgoff = pgoff; > @@ -2315,6 +2319,7 @@ static int __do_fault(struct mm_struct * > anon = 1; /* no anon but release vmf.page */ > goto out; > } > + page_mkwrite = 1; > } > } > > @@ -2375,7 +2380,7 @@ out_unlocked: > if (anon) > page_cache_release(vmf.page); > else if (dirty_page) { > - set_page_dirty_balance(dirty_page); > + set_page_dirty_balance(dirty_page, page_mkwrite); > put_page(dirty_page); > } > > Index: linux-2.6/mm/page-writeback.c > =================================================================== > --- linux-2.6.orig/mm/page-writeback.c > +++ linux-2.6/mm/page-writeback.c > @@ -460,9 +460,9 @@ static void balance_dirty_pages(struct a > pdflush_operation(background_writeout, 0); > } > > -void set_page_dirty_balance(struct page *page) > +void set_page_dirty_balance(struct page *page, int page_mkwrite) > { > - if (set_page_dirty(page)) { > + if (set_page_dirty(page) || page_mkwrite) { > struct address_space *mapping = page_mapping(page); > > if (mapping)
-
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:
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, Nick Piggin
, (Sun Oct 7, 11:37 pm)
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, Nick Piggin
, (Mon Oct 8, 12:47 am)
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, Nick Piggin
, (Mon Oct 8, 7:50 am)
[PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, Peter Zijlstra
, (Mon Oct 8, 9:54 am)
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, David Chinner
, (Mon Oct 8, 4:36 pm)
Re: [PATCH] mm: set_page_dirty_balance() vs ->page_mkwrite()
, Mark Fasheh
, (Mon Oct 8, 7:12 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