All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Nick's core remove PageReserved broke vmware...
Date: Thu, 03 Nov 2005 08:04:14 +1100	[thread overview]
Message-ID: <1130965454.20136.50.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.61.0511021208070.7300@goblin.wat.veritas.com>

On Wed, 2005-11-02 at 12:26 +0000, Hugh Dickins wrote:

> Well, beware.  That "page_count() != page_mapcount() + 2" check in rmap.c
> went away in 2.6.13: the problem it was there to solve being solved
> instead by a can_share_swap_page based on page_mapcount instead of
> page_count (partly to fix a page migration progress problem).

Not completely related to this thread, but ... I have been working on
the radeon DRI driver to add some non-AGP DMA functionality. That needs
to pin some userpages for DMA. It's currently doing get_user_pages(),
and later on, page_cache_release() when the DMA is done. In between
however, it returns to userland.

I haven't been able to find a firm grasp on what is needed to make sure
those pages won't be mucked with by rmap or others during that proc ess.
Should I set PG_locked ? if yes why and if not why not ? (you may figure
out at this point that I have a poor understanding of this part of the
VM subsystem). Will get_user_pages() increase page_mapcount or only
page_count (relative to your quote above) ?

Also, I'm not too sure how to handle dirtyness. It _seems_ to be that
for a DMA transfer from device to memory, I will have to call
get_user_pages() for write, thus setting dirty at that moment. However,
this is not very optimal. I want X to be able to "prepare" pixmaps for
DMA (keeping the user pages locked and the DMA sglists ready) (up to a
given threshold of memory of course) and later on, kick DMA operations.
In that context, X doesn't know in advance what direction the DMA will
take. Pixmaps can be migrated to/from vram at any time depending on the
type of rendering operation.

But I'm not sure I have a proper way to set those pages dirty after the
call to get_user_pages(), do I have a guarantee that they haven't been
unmapped from the user process for example ?

Ben.



  parent reply	other threads:[~2005-11-02 21:07 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-01 19:30 Nick's core remove PageReserved broke vmware Petr Vandrovec
2005-11-02  0:34 ` Nick Piggin
2005-11-02  1:17   ` Petr Vandrovec
2005-11-02  2:09     ` Nick Piggin
2005-11-02 12:26     ` Hugh Dickins
2005-11-02 18:06       ` Petr Vandrovec
2005-11-02 21:04       ` Benjamin Herrenschmidt [this message]
2005-11-02 21:41         ` Hugh Dickins
2005-11-02 21:45           ` Benjamin Herrenschmidt
2005-11-02 22:02             ` Hugh Dickins
2005-11-02 22:22               ` Benjamin Herrenschmidt
2005-11-03  8:03                 ` Gleb Natapov
2005-11-03 13:32                   ` Hugh Dickins
2005-11-03 13:55                     ` Gleb Natapov
2005-11-03 21:21                       ` Benjamin Herrenschmidt
2005-11-02 22:39               ` Petr Vandrovec
2005-11-03  8:12               ` Gleb Natapov
2005-11-03 14:11                 ` Hugh Dickins
2005-11-03 14:22                   ` Gleb Natapov
2005-11-03 14:37                   ` Michael S. Tsirkin
2005-11-03 14:59                     ` Hugh Dickins
2005-11-03 15:09                       ` Gleb Natapov
2005-11-03 15:14                       ` Michael S. Tsirkin
2005-11-03 15:37                         ` Hugh Dickins
2005-11-03 15:53                           ` Gleb Natapov
2005-11-03 15:56                           ` Michael S. Tsirkin
2005-11-08 21:34                   ` Michael S. Tsirkin
2005-11-10 12:35                     ` Gleb Natapov
2005-11-10 12:48                       ` Michael S. Tsirkin
2005-11-10 12:49                         ` Gleb Natapov
2005-11-10 13:16                           ` Michael S. Tsirkin
2005-11-10 13:16                             ` Gleb Natapov
2005-11-10 13:21                             ` Hugh Dickins
2005-11-10 13:26                               ` Gleb Natapov
2005-11-10 13:15                         ` Hugh Dickins
2005-11-10 13:10                     ` Hugh Dickins
2005-11-10 13:37                       ` Michael S. Tsirkin
2005-11-10 13:55                         ` Hugh Dickins
2005-11-10 14:12                           ` Michael S. Tsirkin
2005-11-14 12:25                       ` Michael S. Tsirkin
2005-11-14 12:27                         ` Gleb Natapov
2005-11-14 12:34                           ` Michael S. Tsirkin
2005-11-14 12:40                             ` Hugh Dickins
2005-11-14 14:57                               ` Michael S. Tsirkin
2005-11-14 15:07                                 ` Gleb Natapov
2005-11-14 12:41                             ` Gleb Natapov
2005-11-14 14:52                       ` Michael S. Tsirkin
2005-11-14 15:00                         ` Gleb Natapov
2005-11-14 20:23                           ` Michael S. Tsirkin
2005-11-15  9:26                             ` Gleb Natapov
2005-11-14 15:58                         ` Hugh Dickins
2005-11-14 21:17                           ` Michael S. Tsirkin

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=1130965454.20136.50.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=vandrove@vc.cvut.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.