From: Hugh Dickins <hugh@veritas.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Andrew Morton <akpm@osdl.org>, Nicolas Pitre <nico@cam.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/9] mm: arm ready for split ptlock
Date: Sun, 23 Oct 2005 09:27:55 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0510230900550.19527@goblin.wat.veritas.com> (raw)
In-Reply-To: <20051022170240.GA10631@flint.arm.linux.org.uk>
Many thanks for your rapid response...
On Sat, 22 Oct 2005, Russell King wrote:
> On Sat, Oct 22, 2005 at 05:22:20PM +0100, Hugh Dickins wrote:
> > Signal handling's preserve and restore of iwmmxt context currently
> > involves reading and writing that context to and from user space, while
> > holding page_table_lock to secure the user page(s) against kswapd. If
> > we split the lock, then the structure might span two pages, secured by
> > different locks. That would be manageable; but it seems simpler just
> > to read into and write from a kernel stack buffer, copying that out and
> > in without locking (the structure is 160 bytes in size, and here we're
> > near the top of the kernel stack). Or would the overhead be noticeable?
>
> Please contact Nicolas Pitre about that - that was my suggestion,
> but ISTR apparantly the overhead is too high.
Right, I've CC'ed him, and will forward the original patch in a moment.
It'd be perfectly possible to lock two extents in there, just seems like
over-engineering, and yet more strange mm-dependent code down in the arch
than I'd like to put there.
If Nicolas insists on avoiding the copies, then the simplest answer is
to disable split ptlock in the CONFIG_IWMMXT case too, and replace my
signal.c mods by just a comment highlighting the issue.
ARM is not the architecture (ia64) which prompted this page fault
scalability business. I've no idea of its benefit or otherwise on ARM.
Just didn't want ARM to be the only one not invited to the party.
> > arm_syscall's cmpxchg emulation use pte_offset_map_lock, instead of
> > pte_offset_map and mm-wide page_table_lock; and strictly, it should now
> > also take mmap_sem before descending to pmd, to guard against another
> > thread munmapping, and the page table pulled out beneath this thread.
>
> Now that I look at it, it's probably buggy - if the page isn't already
> dirty, it will modify without the COW action. Again, please contact
> Nicolas about this.
That hadn't crossed my mind, good catch. (Though bad both before and
after my change.) I did wonder about the alignment, the assumption that
*(unsigned long *)addr all fits within the same page - but assumed ARM's
instructions are suitably aligned?
It does look like that cmpxchg emulation needs to be done another way,
quite unrelated to my changes.
> > Updated two comments in fault-armv.c. adjust_pte is interesting, since
> > its modification of a pte in one part of the mm depends on the lock held
> > when calling update_mmu_cache for a pte in some other part of that mm.
> > This can't be done with a split page_table_lock (and we've already taken
> > the lowest lock in the hierarchy here): so we'll have to disable split
> > on arm, unless CONFIG_CPU_CACHE_VIPT to ensures adjust_pte never used.
>
> Well, adjust_pte is extremely critical to ensure correct cache behaviour
> (and therefore data integrity) so if split ptlock is incompatible with
> this, split ptlock loses.
Unquestionably.
> As far as adjust_pte being called, it's only called for VIVT caches,
> which means the configuration has to do if VIVT, disable split ptlock.
Yes, patch 7/9 disables it on ARM unless CPU_CACHE_VIPT
(since in other cases cache_is_vivt may be determined at runtime).
config SPLIT_PTLOCK_CPUS
int
default "4096" if ARM && !CPU_CACHE_VIPT
default "4096" if PARISC && DEBUG_SPINLOCK && !64BIT
default "4"
Please let me know when ARM supports 4096 cpus, I'll change that then!
Hugh
next prev parent reply other threads:[~2005-10-23 8:28 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-22 16:18 [PATCH 0/9] mm: page fault scalability Hugh Dickins
2005-10-22 16:19 ` [PATCH 1/9] mm: i386 sh sh64 ready for split ptlock Hugh Dickins
2005-10-22 18:24 ` Paul Mundt
2005-10-22 16:22 ` [PATCH 2/9] mm: arm " Hugh Dickins
2005-10-22 17:02 ` Russell King
2005-10-23 8:27 ` Hugh Dickins [this message]
2005-10-25 2:45 ` Nicolas Pitre
2005-10-25 6:31 ` Hugh Dickins
2005-10-25 14:55 ` Nicolas Pitre
2005-10-25 7:55 ` Russell King
2005-10-25 15:00 ` Nicolas Pitre
2005-10-26 0:20 ` Russell King
2005-10-26 1:26 ` Nicolas Pitre
2005-10-31 22:19 ` Jesper Juhl
2005-10-31 22:27 ` Russell King
2005-10-31 22:34 ` Jesper Juhl
2005-10-31 22:50 ` Russell King
2005-10-22 16:23 ` [PATCH 3/9] mm: parisc pte atomicity Hugh Dickins
2005-10-22 16:33 ` Matthew Wilcox
2005-10-22 17:08 ` [parisc-linux] " James Bottomley
2005-10-23 9:02 ` Hugh Dickins
2005-10-23 15:05 ` James Bottomley
2005-10-24 4:36 ` Hugh Dickins
2005-10-24 14:56 ` James Bottomley
2005-10-24 16:49 ` Hugh Dickins
2005-10-22 16:24 ` [PATCH 4/9] mm: cris v32 mmu_context_lock Hugh Dickins
2005-10-22 16:25 ` [PATCH 5/9] mm: uml pte atomicity Hugh Dickins
2005-10-22 16:27 ` [PATCH 6/9] mm: uml kill unused Hugh Dickins
2005-10-22 19:23 ` Jeff Dike
2005-10-22 16:29 ` [PATCH 7/9] mm: split page table lock Hugh Dickins
2005-10-23 16:54 ` Nikita Danilov
2005-10-23 21:27 ` Andrew Morton
2005-10-23 22:22 ` Andrew Morton
2005-10-24 3:38 ` Hugh Dickins
2005-10-24 4:16 ` Andrew Morton
2005-10-24 4:58 ` Hugh Dickins
2005-10-24 3:09 ` Hugh Dickins
2005-10-23 21:49 ` Andrew Morton
2005-10-24 3:12 ` Hugh Dickins
2005-10-22 16:30 ` [PATCH 8/9] mm: fix rss and mmlist locking Hugh Dickins
2005-10-22 16:31 ` [PATCH 9/9] mm: update comments to pte lock Hugh Dickins
2005-10-23 7:49 ` [PATCH 6/9 take 2] mm: uml kill unused Hugh Dickins
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=Pine.LNX.4.61.0510230900550.19527@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico@cam.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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
all inboxes | Powered by JetHome®