From: "David S. Miller" <davem@redhat.com>
To: Jens Axboe <axboe@suse.de>
Cc: linux-kernel@vger.kernel.org, akpm@digeo.com
Subject: Re: [patch][cft] zero-copy dma cd writing and ripping
Date: 28 Oct 2002 08:03:37 -0800 [thread overview]
Message-ID: <1035821017.9282.7.camel@rth.ninka.net> (raw)
In-Reply-To: <20021028150832.GF2937@suse.de>
On Mon, 2002-10-28 at 07:08, Jens Axboe wrote:
> Ok what I make of this is that from bio_map_user() (which does a
> get_user_pages() I need to do a
>
> if (write_to_vm)
> flush_dcache_page(page);
>
> and in bio_unmap_user() I do
>
> if (!write_to_vm)
> flush_dcache_page(page);
>
> is that correct?
Ho hum, it is tricky :-)))
At bio_map_user() you need to see the user's most recent write
to the page if you are going "user --> device". So if "user
--> device" bio_map_user() must flush_dcache_page().
I find the write_to_vm condition confusion which is probably why
I am sitting here spelling this out :-)
At bio_unmap_user(), if we are going "device --> user" you have
to flush_dcache_page(). And actually, this flush could just as
legitimately occur at bio_map_user() time.
Therefore, the easiest thing to do is always flush_dcache_page()
at bio_map_user().
All the other cases are going to be like this, so we might as
well cut to the chase and flush_dcache_page() for all the pages
inside of get_user_pages().
Whoever made get_user_pages() and didn't carry over the
flush_dcache_page calls from the mechanism it is meant to replace
should be spanked :-)
next prev parent reply other threads:[~2002-10-28 15:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-18 15:56 Jens Axboe
2002-10-28 12:35 ` David S. Miller
2002-10-28 12:42 ` Jens Axboe
2002-10-28 14:40 ` David S. Miller
2002-10-28 14:55 ` Jens Axboe
2002-10-28 15:08 ` Jens Axboe
2002-10-28 16:03 ` David S. Miller [this message]
2002-10-28 15:54 ` Jens Axboe
2002-10-28 16:25 ` David S. Miller
2002-10-28 16:18 ` Jens Axboe
2002-10-29 2:27 ` David S. Miller
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=1035821017.9282.7.camel@rth.ninka.net \
--to=davem@redhat.com \
--cc=akpm@digeo.com \
--cc=axboe@suse.de \
--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®