From: Andrea Arcangeli <andrea@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: hugh@veritas.com, torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: anon-vma (and now filebacked-mappings too) mprotect vma merging [Re: 2.6.5-rc2-aa vma merging]
Date: Sun, 4 Apr 2004 03:55:59 +0200 [thread overview]
Message-ID: <20040404015559.GU2307@dualathlon.random> (raw)
In-Reply-To: <20040403174312.16e4537d.akpm@osdl.org>
On Sat, Apr 03, 2004 at 05:43:12PM -0800, Andrew Morton wrote:
> Andrea Arcangeli <andrea@suse.de> wrote:
> >
> > On Sat, Apr 03, 2004 at 05:13:58PM -0800, Andrew Morton wrote:
> > > That change was made for scheduling latency reasons, mainly due to huge
> > > pagetable walks in zap_page_range():
> > >
> > > i_shared_lock is held for a very long time during vmtruncate() and
> > > causes high scheduling latencies when truncating a file which is
> > > mmapped. I've seen 100 milliseconds.
> > >
> > > So turn it into a semaphore. It nests inside mmap_sem. This
> > > change is also needed by the shared pagetable patch, which needs to
> > > unshare pte's on the vmtruncate path - lots of pagetable pages need to
> > > be allocated and they are using __GFP_WAIT.
> > >
> > > If we no longer hold that lock during pte takedown then sure, it would
> > > be better if we had a spinlock in there.
> >
> > agreed, vmtruncate may still be very costly due the pte scan, so
> > I was probably wrong about not needing the semaphore anymore with
> > prio-tree (I was too objrmap centric, and after all objrmap with the
> > trylocks threats it like a spinlock anyways), though the semaphore
> > cannot help the latency of the non-contention case (I mean with preempt
> > disabled), that seem to have room for improvements with a cond_sched()
> > before returning from invalidate_mmap_range_list not present yet.
>
> <looks>
ok so it's implemented already, actually w/o prio-tree you'd waste some
cpu w/o schedule points if all vmas are out of range, with prio-tree
that's fixed.
>
> Actually I was a bit harsh to the !CONFIG_PREEMPT case in unmap_vmas():
>
> /* No preempt: go for the best straight-line efficiency */
> #if !defined(CONFIG_PREEMPT)
> #define ZAP_BLOCK_SIZE (~(0UL))
> #endif
>
> We should probably make that 1024*PAGE_SIZE or something like that.
agreed, more specifically we shouldn't differentiate the preempt from
non-preempt case, I'd suggest removing those CONFIG_PREEMPT there, it's
a misconception to think people disabling preempt cares about worst case
latencies less than people enabling preempt, infact the people disabling
preempt _only_ cares about the worst case latency ;)
prev parent reply other threads:[~2004-04-04 1:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0403291957240.19124-100000@localhost.localdomain>
2004-03-29 19:45 ` 2.6.5-rc2-aa vma merging Hugh Dickins
2004-04-02 11:34 ` Hugh Dickins
2004-04-02 15:35 ` Andrea Arcangeli
2004-04-03 1:26 ` anon-vma (and now filebacked-mappings too) mprotect vma merging [Re: 2.6.5-rc2-aa vma merging] Andrea Arcangeli
2004-04-03 17:06 ` Hugh Dickins
2004-04-03 17:24 ` Andrea Arcangeli
2004-04-03 18:46 ` Andrea Arcangeli
2004-04-03 19:29 ` Hugh Dickins
2004-04-04 1:01 ` Andrea Arcangeli
2004-04-04 1:13 ` Andrew Morton
2004-04-04 1:32 ` Andrea Arcangeli
2004-04-04 1:43 ` Andrew Morton
2004-04-04 1:55 ` Andrea Arcangeli [this message]
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=20040404015559.GU2307@dualathlon.random \
--to=andrea@suse.de \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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