From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: linux-kernel@vger.kernel.org
Subject: Dirty words on linux-kernel
Date: Sat, 10 Aug 2002 20:30:04 +0100 [thread overview]
Message-ID: <20020810203004.A666@kushida.apsleyroad.org> (raw)
Sorry folks, but I found this bounce from a message I sent to
linux-kernel both funny and slightly disturbing. Note that the bounce
comes from a subscriber to linux-kernel, not the mailing list
management! (:-)
Subject: ScanMail Message: To Sender, sensitive content found and action taken.
From: System Attendant <WLVEXC01-SA@digitalinsight.com>
Trend SMEX Content Filter has detected sensitive content.
Place = Linus Torvalds; Andrew Morton; lkml;
Sender = Jamie Lokier
Subject = Re: [patch 6/12] hold atomic kmaps across generic_file_read
Delivery Time = August 10, 2002 (Saturday) 10:59:18
Policy = Dirty Words
Action on this mail = Quarantine message
Warning message from administrator:
Sender, Content filter has detected a sensitive e-mail.
I wonder if anyone can spot "Dirty Words" in the text below! (I don't
see any). The bounce doesn't say which message; it must be one of the
two below.
enjoy,
-- Jamie
----------------- possible dirty talk #1 --------------------
Linus Torvalds wrote:
> Imagine doing a
>
> fstat(fd..)
> buf = aligned_malloc(st->st_size)
> read(fd, buf, st->st_size);
>
> and having it magically populate the VM directly with the whole file
> mapping, with _one_ failed page fault. And the above is actually a fairly
> common thing. See how many people have tried to optimize using mmap vs
> read, and what they _all_ really wanted was this "populate the pages in
> one go" thing.
This will only provide the performance benefic when `aligned_malloc'
return "fresh" memory, i.e. memory that has never been written to.
Assuming most programs use plain old `malloc', which could be taught to
align nicely, then the optimisation might occur when a program starts
up, but later on it's more likely to return memory which has been
written to and previously freed. So the performance becomes
unpredictable.
But it's a nice way to optimise if you are _deliberately_ optimising a
user space program. First call mmap() to get some fresh pages, then
call read() to fill them. Slower on kernels without the optimisation,
fast on kernels with it. :-)
-- Jamie
----------------- possible dirty talk #2 --------------------
Linus Torvalds wrote:
> For people like that, wouldn't it be nice to just be able to tell them: if
> you do X, we guarantee that you'll get optimal zero-copy performance for
> reading a file.
Don't forget to include the need for mmap(... MAP_ANON ...) prior to the
read.
Given the user will need to establish a new mapping anyway, why pussy
foot around with subtleties? Just add a MAP_PREFAULT flag to mmap(),
which reads the whole file and maps it before returning.
-- Jamie
next reply other threads:[~2002-08-10 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 19:30 Jamie Lokier [this message]
2002-08-10 19:58 ` Jon Portnoy
2002-08-10 20:21 ` Heinz Diehl
2002-08-10 20:25 ` DervishD
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=20020810203004.A666@kushida.apsleyroad.org \
--to=lk@tantalophile.demon.co.uk \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®