login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
22
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Anton Salikhmetov <salikhmetov@...>
To: Linus Torvalds <torvalds@...>
Cc: <linux-mm@...>, <jakob@...>, Linux Kernel Mailing List <linux-kernel@...>, <valdis.kletnieks@...>, <riel@...>, <ksm@...>, <staubach@...>, <jesper.juhl@...>, <a.p.zijlstra@...>, Andrew Morton <akpm@...>, <protasnb@...>, <miklos@...>, <r.e.wolff@...>, <hidave.darkstar@...>, <hch@...>
Subject:
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files
Date: Monday, January 21, 2008 - 10:39 pm
2008/1/22, Linus Torvalds <torvalds@linux-foundation.org>:
quoted text
> > > On Tue, 22 Jan 2008, Anton Salikhmetov wrote: > > > > /* > > + * Scan the PTEs for pages belonging to the VMA and mark them read-only. > > + * It will force a pagefault on the next write access. > > + */ > > +static void vma_wrprotect(struct vm_area_struct *vma) > > +{ > > + unsigned long addr; > > + > > + for (addr = vma->vm_start; addr < vma->vm_end; addr += PAGE_SIZE) { > > + spinlock_t *ptl; > > + pgd_t *pgd = pgd_offset(vma->vm_mm, addr); > > + pud_t *pud = pud_offset(pgd, addr); > > + pmd_t *pmd = pmd_offset(pud, addr); > > + pte_t *pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); > > This is extremely expensive over bigger areas, especially sparsely mapped > ones (it does all the lookups for all four levels over and over and over > again for eachg page). > > I think Peter Zijlstra posted a version that uses the regular kind of > nested loop (with inline functions to keep the thing nice and clean), > which gets rid of that.
Thanks for your feedback, Linus! I will use Peter Zijlstra's version of such an operation in my next patch series.
quoted text
> > [ The sad/funny part is that this is all how we *used* to do msync(), back > in the days: we're literally going back to the "pre-cleanup" logic. See > commit 204ec841fbea3e5138168edbc3a76d46747cc987: "mm: msync() cleanup" > for details ] > > Quite frankly, I really think you might be better off just doing a > > git revert 204ec841fbea3e5138168edbc3a76d46747cc987 > > and working from there! I just checked, and it still reverts cleanly, and > you'd end up with a nice code-base that (a) has gotten years of testing > and (b) already has the looping-over-the-pagetables code. > > Linus >
--
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 -v7 0/2] Fixing the issue with memory-mapped file times
, Anton Salikhmetov
, (Mon Jan 21, 8:32 pm)
Re: [PATCH -v7 0/2] Fixing the issue with memory-mapped file...
, Jesper Juhl
, (Mon Jan 21, 9:34 pm)
Re: [PATCH -v7 0/2] Fixing the issue with memory-mapped file...
, Anton Salikhmetov
, (Mon Jan 21, 9:40 pm)
[PATCH -v7 2/2] Update ctime and mtime for memory-mapped files
, Anton Salikhmetov
, (Mon Jan 21, 8:32 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Andi Kleen
, (Tue Jan 22, 12:39 am)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Linus Torvalds
, (Mon Jan 21, 10:16 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Anton Salikhmetov
, (Mon Jan 21, 10:39 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Miklos Szeredi
, (Tue Jan 22, 4:52 am)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Jesper Juhl
, (Mon Jan 21, 9:40 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Anton Salikhmetov
, (Mon Jan 21, 9:51 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Jesper Juhl
, (Mon Jan 21, 9:54 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Anton Salikhmetov
, (Mon Jan 21, 9:57 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Jesper Juhl
, (Mon Jan 21, 10:18 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Anton Salikhmetov
, (Mon Jan 21, 10:07 pm)
Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped...
, Jesper Juhl
, (Mon Jan 21, 10:16 pm)
[PATCH -v7 1/2] Massive code cleanup of sys_msync()
, Anton Salikhmetov
, (Mon Jan 21, 8:32 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 004/196] Chinese: add translation of SubmittingPatches
James Bottomley
Re: Announce: Linux-next (Or Andrew's dream :-))
David Miller
[GIT]: Networking
linux-netdev
:
Antonio Almeida
HTB accuracy for high speed
Ingo Molnar
iwlwifi: fix build bug in "iwlwifi: fix LED stall"
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Avi Kivity
Re: [RFC PATCH 14/17] kvm: add a reset capability
git
:
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
2 users
and
777 guests
online.
Online users
cbelgrant78
wendy44iza
Syndicate