linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Gerd Knorr <kraxel@bytesex.org>
Cc: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>,
	Kai Makisara <Kai.Makisara@kolumbus.fi>,
	Douglas Gilbert <dougg@torque.net>,
	linux-mm@kvack.org
Subject: Re: [PATCH] Really start using the page walking API
Date: Tue, 26 Nov 2002 00:40:28 -0800	[thread overview]
Message-ID: <3DE3337C.5814C370@digeo.com> (raw)
In-Reply-To: <20021125131004.GA5725@bytesex.org>

Gerd Knorr wrote:
> 
> ...
> videobuf_dma_pci_map():
>         lock pages for DMA      [videobuf_lock()]
>         build scatter list      [videobuf_pages_to_sg()]
>         pci_map_sg()
> 

There is no need to lock these pages.   None of the other direct-IO
code will lock them, and you don't need to either.

The pages are pinned in place via elevated ->count and that is
sufficient.

What you _do_ need to do is to run set_page_dirty() against each
page, before running page_cache_release().  This is only needed
for a read (writing to userspace memory) to tell the VM that the
contents of the page have been altered.

If you don't do this, the VM may steal the page away without writing
it anywhere, and it will be subsequently restored from swap, minus
the changes which are supposed to be there.
--
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/

  reply	other threads:[~2002-11-26  8:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-24 22:34 Ingo Oeser
2002-11-25  7:37 ` Ingo Oeser
2002-11-25 13:10 ` Gerd Knorr
2002-11-26  8:40   ` Andrew Morton [this message]
2002-11-27 12:33 ` Douglas Gilbert

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=3DE3337C.5814C370@digeo.com \
    --to=akpm@digeo.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=dougg@torque.net \
    --cc=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=kraxel@bytesex.org \
    --cc=linux-mm@kvack.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