From: Matt Mackall <mpm@selenic.com>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] pagemap: early return on unmapped areas
Date: Thu, 14 Jan 2010 11:02:11 -0600 [thread overview]
Message-ID: <1263488531.29868.5151.camel@calx> (raw)
In-Reply-To: <20100114085230.GA12078@localhost>
On Thu, 2010-01-14 at 16:52 +0800, Wu Fengguang wrote:
> On Thu, Jan 14, 2010 at 04:30:48PM +0800, Andi Kleen wrote:
> > > ---
> > > pagemap: early return on unmapped areas
> >
> > Yes seems like a reasonable idea.
>
> Thanks!
>
> I just changed the ">" to ">=", because it happen to make a difference
> for cp/cat, which does 4k sized read:
>
> 4k read buffer = 4k/8 pages = 512 pages = NR_PMD_PAGES
>
> So the change to ">=" makes cp exit immediately (4k buffer matches
> exactly one PMD hole).
>
> before
> dd if=/proc/$$/pagemap of=/dev/null bs=4k
> 512+0 records in
> 512+0 records out
> 2097152 bytes (2.1 MB) copied, 0.0225796 s, 92.9 MB/s
>
> after
> dd if=/proc/$$/pagemap of=/dev/null bs=4k
> 0+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 2.8029e-05 s, 0.0 kB/s
Have you guys lost your minds?
I regularly used the exact standard tool you just broke above to test
pagemap when I was developing it. There's no doubt that this patch (or
any similarly misguided ones) WILL regress existing naive or not
intended to be portable 32-bit users. And if I was some poor future
bastard trying to write a program against pagemap with your patch, odds
of getting a concussion banging my head against the wall trying to
figure out its highly non-file-like behavior would be quite high.
Why are we even still on this. There's no regression. LTP + pagemap +
64-bit has always behaved thus. Nor are large virtual files new. And
LTP's n00b assumption that it can just read all of any file in /proc has
always been wrong. LTP had the exact same problem on 64-bit /proc/kcore
(how long has that existed?) and finally fixed it in 2005.
--
http://selenic.com : development and support for Mercurial and Linux
prev parent reply other threads:[~2010-01-14 17:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 2:09 2.6.33 pagemap endless read loop Andi Kleen
2010-01-10 6:33 ` Américo Wang
2010-01-10 12:37 ` Andi Kleen
2010-01-12 5:59 ` Mike Galbraith
2010-01-12 15:32 ` Américo Wang
2010-01-12 16:28 ` Andi Kleen
2010-01-13 2:08 ` Américo Wang
[not found] ` <20100113141648.42eff724.akpm@linux-foundation.org>
[not found] ` <1263421562.29868.5000.camel@calx>
[not found] ` <20100113143055.7bea30c5.akpm@linux-foundation.org>
[not found] ` <1263423916.29868.5009.camel@calx>
[not found] ` <20100113151502.fa425247.akpm@linux-foundation.org>
[not found] ` <20100114055319.GA17671@localhost>
[not found] ` <20100113221013.b1beecb4.akpm@linux-foundation.org>
2010-01-14 8:06 ` Wu Fengguang
2010-01-14 8:30 ` Andi Kleen
2010-01-14 8:52 ` [PATCH] pagemap: early return on unmapped areas Wu Fengguang
2010-01-14 17:02 ` Matt Mackall [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=1263488531.29868.5151.camel@calx \
--to=mpm@selenic.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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
Powered by JetHome