From: Steve VanDeBogart <vandebo-lkml@NerdBox.Net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Frost <frost@cs.ucla.edu>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Benny Halevy <bhalevy@panasas.com>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: add fincore(2) (mincore(2) for file descriptors)
Date: Wed, 27 Jan 2010 23:42:35 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.1.00.1001272319530.2909@abydos.NerdBox.Net> (raw)
In-Reply-To: <20100126141229.e1a81b29.akpm@linux-foundation.org>
On Tue, 26 Jan 2010, Andrew Morton wrote:
> On Wed, 20 Jan 2010 13:57:12 -0800
> Chris Frost <frost@cs.ucla.edu> wrote:
>
>> In this patch find_get_page() is called for each page, which in turn
>> calls rcu_read_lock(), for each page. We have found that amortizing
>> these RCU calls, e.g., by introducing a variant of find_get_pages_contig()
>> that does not skip missing pages, can speedup the above microbenchmark
>> by 260x when querying many pages per system call. But we have not observed
>> noticeable improvements to our macrobenchmarks. I'd be happy to also post
>> this change or look further into it, but this seems like a reasonable
>> first patch, at least.
>
> I must say, the syscall appeals to my inner geek. Lot of applications
> are leaving a lot of time on the floor due to bad disk access patterns.
> A really smart library which uses this facility could help all over
> the place.
>
> Is it likely that these changes to SQLite and Gimp would be merged into
> the upstream applications?
Changes to the GIMP fit nicely into the code structure, so it's feasible
to push this kind of optimization upstream. The changes in SQLite are
a bit more focused on the benchmark, but a more general approach is not
conceptually difficult. SQLite may not want the added complexity, but
other database may be interested in the performance improvement.
Of course, these kernel changes are needed before any application can
optimize its IO as we did with libprefetch.
>> + if (pgoff >= file_npages || pgend > file_npages) {
>> + retval = -EINVAL;
>> + goto done;
>> + }
>
> Should this return -EINVAL, or should it just return "0": nothing there?
>
> Bear in mind that this code is racy against truncate (I think?), and
> this is "by design". If that race does occur, we want to return
> something graceful to userspace and I suggest that "nope, nothing
> there" is a more graceful result that "erk, you screwed up". Because
> the application _didn't_ screw up: the pages were there when the
> syscall was first performed.
That's a good point. Not in core seems like the right answer for
pgoff >= file_npages.
--
Steve
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-01-28 7:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 21:57 Chris Frost
2010-01-21 1:11 ` Andi Kleen
2010-02-16 18:13 ` Chris Frost
2010-02-21 3:02 ` Andy Isaacson
2010-02-21 3:25 ` Wu Fengguang
2010-02-23 16:39 ` Andy Isaacson
2010-05-07 22:46 ` Cédric Villemain
2010-01-22 1:17 ` Wu Fengguang
2010-01-22 1:29 ` Paul E. McKenney
2010-01-26 22:12 ` Andrew Morton
2010-01-28 7:42 ` Steve VanDeBogart [this message]
2010-01-28 8:23 ` Andrew Morton
2010-01-28 8:32 ` Steve VanDeBogart
2010-01-28 23:54 ` Andres Freund
2010-01-27 18:14 ` Jamie Lokier
2010-01-28 8:23 ` Steve VanDeBogart
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=alpine.DEB.1.00.1001272319530.2909@abydos.NerdBox.Net \
--to=vandebo-lkml@nerdbox.net \
--cc=akpm@linux-foundation.org \
--cc=bhalevy@panasas.com \
--cc=frost@cs.ucla.edu \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=viro@zeniv.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