login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
23
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user_pages() and fix XIP
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jeff Chua <jeff.chua.linux@...>
To: Linus Torvalds <torvalds@...>
Cc: Hugh Dickins <hugh@...>, Greg KH <gregkh@...>, <linux-kernel@...>, <stable@...>, Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, Willy Tarreau <w@...>, Rodrigo Rubira Branco <rbranco@...>, <akpm@...>, <alan@...>, Oleg Nesterov <oleg@...>, Nick Piggin <npiggin@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>, Ingo Molnar <mingo@...>, Roland McGrath <roland@...>
Subject:
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user_pages() and fix XIP
Date: Monday, June 23, 2008 - 2:15 pm
On Tue, Jun 24, 2008 at 1:27 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
quoted text
> On the other hand, if you add a trace to the "use_zero_page()" function to > print out the vm_flags and other details, that probably would help.
Let me know if you still want me to test this.
quoted text
> That said, since the previous patch _did_ work, I bet that one that does > both VM_LOCKED and VM_SHARED works too. There was a reason I wanted > to do that VM_SHARED test. I think the VM_SHARED test is sane, unlike the > VM_LOCKED test (that is a fairly dubious hack for mlock). > So here's the final version. I bet it works.
Yeh, it works great! Thank you. Jeff.
quoted text
> mm/memory.c | 23 +++++++++++++++++++++-- > 1 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/mm/memory.c b/mm/memory.c > index 9aefaae..423e0e7 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -1045,6 +1045,26 @@ no_page_table: > return page; > } > > +/* Can we do the FOLL_ANON optimization? */ > +static inline int use_zero_page(struct vm_area_struct *vma) > +{ > + /* > + * We don't want to optimize FOLL_ANON for make_pages_present() > + * when it tries to page in a VM_LOCKED region. As to VM_SHARED, > + * we want to get the page from the page tables to make sure > + * that we serialize and update with any other user of that > + * mapping. > + */ > + if (vma->vm_flags & (VM_LOCKED | VM_SHARED)) > + return 0; > + /* > + * And if we have a fault or a nopfn routine, it's not an > + * anonymous region. > + */ > + return !vma->vm_ops || > + (!vma->vm_ops->fault && !vma->vm_ops->nopfn); > +} > + > int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, > unsigned long start, int len, int write, int force, > struct page **pages, struct vm_area_struct **vmas) > @@ -1119,8 +1139,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, > foll_flags = FOLL_TOUCH; > if (pages) > foll_flags |= FOLL_GET; > - if (!write && !(vma->vm_flags & VM_LOCKED) && > - (!vma->vm_ops || !vma->vm_ops->fault)) > + if (!write && use_zero_page(vma)) > foll_flags |= FOLL_ANON; > > do { >
--
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 0/5] 2.6.25-stable review
, Greg KH
, (Sun Jun 22, 3:01 pm)
Re: [patch 0/5] 2.6.25-stable review
, S.Çağlar
, (Mon Jun 23, 7:19 am)
Re: [stable] [patch 0/5] 2.6.25-stable review
, Greg KH
, (Mon Jun 23, 3:30 pm)
[patch 5/5] x86: set PAE PHYSICAL_MASK_SHIFT to 44 bits.
,
, (Sun Jun 22, 3:01 pm)
[patch 1/5] atl1: relax eeprom mac address error check
, Greg KH
, (Sun Jun 22, 3:01 pm)
[patch 2/5] Reinstate ZERO_PAGE optimization in get_user_pag...
, Greg KH
, (Sun Jun 22, 3:01 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Linus Torvalds
, (Sun Jun 22, 3:22 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Greg KH
, (Sun Jun 22, 4:29 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Jeff Chua
, (Mon Jun 23, 11:32 am)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Hugh Dickins
, (Mon Jun 23, 12:04 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Linus Torvalds
, (Mon Jun 23, 12:39 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Jeff Chua
, (Mon Jun 23, 1:05 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Linus Torvalds
, (Mon Jun 23, 1:27 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Jeff Chua
, (Mon Jun 23, 2:15 pm)
Re: [patch 2/5] Reinstate ZERO_PAGE optimization in get_user...
, Linus Torvalds
, (Mon Jun 23, 2:32 pm)
[patch 3/5] sctp: Make sure N * sizeof(union sctp_addr) does...
, Greg KH
, (Sun Jun 22, 3:01 pm)
Re: [patch 3/5] sctp: Make sure N * sizeof(union sctp_addr) ...
, David Miller
, (Sun Jun 22, 3:23 pm)
Re: [patch 3/5] sctp: Make sure N * sizeof(union sctp_addr) ...
, Greg KH
, (Sun Jun 22, 4:28 pm)
Re: [patch 3/5] sctp: Make sure N * sizeof(union sctp_addr) ...
, David Miller
, (Mon Jun 23, 5:36 pm)
Re: [patch 3/5] sctp: Make sure N * sizeof(union sctp_addr) ...
, Greg KH
, (Mon Jun 23, 5:43 pm)
[patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Greg KH
, (Sun Jun 22, 3:01 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Johannes Weiner
, (Sun Jun 22, 4:22 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Greg KH
, (Sun Jun 22, 4:30 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Linus Torvalds
, (Sun Jun 22, 4:36 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Ingo Molnar
, (Mon Jun 23, 4:09 am)
Re: [stable] [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Greg KH
, (Mon Jun 23, 3:20 pm)
Re: [stable] [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Ingo Molnar
, (Mon Jun 23, 3:36 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Bernhard Walle
, (Mon Jun 23, 6:33 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Ingo Molnar
, (Mon Jun 23, 6:53 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Bernhard Walle
, (Mon Jun 23, 9:21 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit
, Adrian Bunk
, (Sun Jun 22, 4:36 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mark Lord
2.6.25-rc8: FTP transfer errors
Kamalesh Babulal
Re: 2.6.23-rc6-mm1
Greg Kroah-Hartman
[PATCH 025/196] paride: Convert from class_device to device for block/paride
Stephen Rothwell
Announce: Linux-next (Or Andrew's dream :-))
git
:
linux-netdev
:
Linus Torvalds
Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
David Miller
Re: [GIT]: Networking
Gerrit Renker
[PATCH 18/37] dccp: Support for Mandatory options
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
13 users
and
1034 guests
online.
Online users
zeekec
andriennmb
cuidarerpoz
wholesaleelect
BonSwi89mld
yamasakinu
fuelcardmiu
houstonseocons
danilokanehlyoa
andriefechtdt
benlas77
eugenek76
jeansmenvtrv
Syndicate