All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: Eli Cohen <eli@mellanox.co.il>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT
Date: Thu, 05 Feb 2009 16:24:53 +1100	[thread overview]
Message-ID: <1233811493.4612.69.camel@pasglop> (raw)
In-Reply-To: <ada7i45lb9x.fsf@cisco.com>

On Wed, 2009-02-04 at 21:10 -0800, Roland Dreier wrote:
> > Note that g_u_p() has all sort of shortcommings... we were discussing
>  > some of that recently due to bugs reported from the field.
>  > 
>  > The problem mostly is that you cannot guarantee that the physical page
>  > will remain mapped to that virtual address in the process. For example,
>  > if your code is part of some library used by an application, and that
>  > application somewhere does a fork/exec (for example, a system() call to
>  > run a shell helper), copy-on-write will hit, and you may end up with
>  > the child process getting the original physical page and the original
>  > process getting the copy...
> 
> Believe me, I'm well aware of that.  We added VM_DONTCOPY to allow apps
> to fork() without the child triggering COW, but that means only the
> parent process can use the mapped memory (and the app has to worry about
> page boundaries etc).

Right, but then you need to set that in the VMA's, and thus gone is your
nice fast g_u_p() that doesn't touch VMAs :-)

> Yes, but unfortunately MPI says apps can allocate memory however they
> damn well please... in any case these issues are all-too-well-known in
> the RDMA world for quite a while.

Yup. What do you think of the idea of pre-COWing pages with an elevated
count at fork time ?

Cheers,
Ben.

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Eli Cohen <eli@mellanox.co.il>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: FW: [PATCH] powerpc/mm: Export HPAGE_SHIFT
Date: Thu, 05 Feb 2009 16:24:53 +1100	[thread overview]
Message-ID: <1233811493.4612.69.camel@pasglop> (raw)
In-Reply-To: <ada7i45lb9x.fsf@cisco.com>

On Wed, 2009-02-04 at 21:10 -0800, Roland Dreier wrote:
> > Note that g_u_p() has all sort of shortcommings... we were discussing
>  > some of that recently due to bugs reported from the field.
>  > 
>  > The problem mostly is that you cannot guarantee that the physical page
>  > will remain mapped to that virtual address in the process. For example,
>  > if your code is part of some library used by an application, and that
>  > application somewhere does a fork/exec (for example, a system() call to
>  > run a shell helper), copy-on-write will hit, and you may end up with
>  > the child process getting the original physical page and the original
>  > process getting the copy...
> 
> Believe me, I'm well aware of that.  We added VM_DONTCOPY to allow apps
> to fork() without the child triggering COW, but that means only the
> parent process can use the mapped memory (and the app has to worry about
> page boundaries etc).

Right, but then you need to set that in the VMA's, and thus gone is your
nice fast g_u_p() that doesn't touch VMAs :-)

> Yes, but unfortunately MPI says apps can allocate memory however they
> damn well please... in any case these issues are all-too-well-known in
> the RDMA world for quite a while.

Yup. What do you think of the idea of pre-COWing pages with an elevated
count at fork time ?

Cheers,
Ben.



  reply	other threads:[~2009-02-05  5:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 16:49 [PATCH] powerpc/mm: Export HPAGE_SHIFT Eli Cohen
2009-02-04  1:08 ` FW: " Roland Dreier
2009-02-04  1:08   ` Roland Dreier
2009-02-04  1:50   ` Benjamin Herrenschmidt
2009-02-04  5:13     ` Andrew Morton
2009-02-04  5:13       ` Andrew Morton
2009-02-04  5:31       ` Nick Piggin
2009-02-04  5:31         ` Nick Piggin
2009-02-04  6:17         ` wli
2009-02-04  6:17           ` wli
2009-02-04  6:16       ` Roland Dreier
2009-02-04  6:16         ` Roland Dreier
2009-02-04  6:26         ` Andrew Morton
2009-02-04  6:26           ` Andrew Morton
2009-02-04 19:11           ` Roland Dreier
2009-02-04 19:11             ` Roland Dreier
2009-02-04 21:00             ` wli
2009-02-04 21:00               ` wli
2009-02-04 21:31               ` Roland Dreier
2009-02-04 21:31                 ` Roland Dreier
2009-02-04 21:23             ` Andrew Morton
2009-02-04 21:23               ` Andrew Morton
2009-02-04 23:55             ` Benjamin Herrenschmidt
2009-02-04 23:55               ` Benjamin Herrenschmidt
2009-02-05  5:10               ` Roland Dreier
2009-02-05  5:10                 ` Roland Dreier
2009-02-05  5:24                 ` Benjamin Herrenschmidt [this message]
2009-02-05  5:24                   ` Benjamin Herrenschmidt
2009-02-05  5:33                   ` Roland Dreier
2009-02-05  5:33                     ` Roland Dreier

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=1233811493.4612.69.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=eli@mellanox.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=rdreier@cisco.com \
    --cc=rusty@rustcorp.com.au \
    /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.