From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kosaki.motohiro@jp.fujitsu.com,
Michel Lespinasse <walken@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Nick Piggin <npiggin@kernel.dk>, Rik van Riel <riel@redhat.com>,
Michael Rubin <mrubin@google.com>
Subject: Re: [RFC] mlock: release mmap_sem every 256 faulted pages
Date: Tue, 23 Nov 2010 16:49:49 +0900 (JST) [thread overview]
Message-ID: <20101123164107.7BBC.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20101122215746.e847742d.akpm@linux-foundation.org>
> On Mon, 22 Nov 2010 21:00:52 -0800 Michel Lespinasse <walken@google.com> wrote:
>
> > Hi,
> >
> > I'd like to sollicit comments on this proposal:
> >
> > Currently mlock() holds mmap_sem in exclusive mode while the pages get
> > faulted in. In the case of a large mlock, this can potentially take a
> > very long time.
>
> A more compelling description of why this problem needs addressing
> would help things along.
Michel, as far as I know, now Michael Rubin (now I'm ccing him) are trying
to make automatic MM test suit. So if possible, can you please make
test case which reproduce your workload?
http://code.google.com/p/samplergrapher/
I hope to join to solve your issue. and I also hope you help to understand
and reproduce your issue.
Thanks.
>
> > + /*
> > + * Limit batch size to 256 pages in order to reduce
> > + * mmap_sem hold time.
> > + */
> > + nfault = nstart + 256 * PAGE_SIZE;
>
> It would be nicer if there was an rwsem API to ask if anyone is
> currently blocked in down_read() or down_write(). That wouldn't be too
> hard to do. It wouldn't detect people polling down_read_trylock() or
> down_write_trylock() though.
Andrew, yes it is certinally optimal. But I doubt it improve mlock
performance a lot. because mlock is _very_ slooooooow syscall.
lock regrabing may be cheap than it. So, _IF_ you can allow, I hope
we take a simple method at first. personally I think Michel move
forwarding right way. then I don't hope to make a hardest hurdle.
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-11-23 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 5:00 [RFC] mlock: release mmap_sem every 256 faulted pages Michel Lespinasse
2010-11-23 5:57 ` Andrew Morton
2010-11-23 7:49 ` KOSAKI Motohiro [this message]
2010-11-23 20:55 ` Michel Lespinasse
2010-11-23 23:57 ` KOSAKI Motohiro
2010-12-01 0:14 ` KOSAKI Motohiro
2010-12-01 4:42 ` KOSAKI Motohiro
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=20101123164107.7BBC.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mrubin@google.com \
--cc=npiggin@kernel.dk \
--cc=riel@redhat.com \
--cc=walken@google.com \
/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;
as well as URLs for NNTP newsgroup(s).