All of lore.kernel.org
 help / color / mirror / Atom feed
From: 'David Gibson' <david@gibson.dropbear.id.au>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>,
	"Chen, Kenneth W" <kenneth.w.chen@intel.com>,
	Hugh Dickins <hugh@veritas.com>,
	bill.irwin@oracle.com, Adam Litke <agl@us.ibm.com>,
	linux-mm@kvack.org
Subject: Re: [hugepage] Fix unmap_and_free_vma backout path
Date: Mon, 13 Nov 2006 16:57:11 +1100	[thread overview]
Message-ID: <20061113055711.GF27042@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0611122127080.2233@schroedinger.engr.sgi.com>

On Sun, Nov 12, 2006 at 09:29:48PM -0800, Christoph Lameter wrote:
> On Mon, 13 Nov 2006, 'David Gibson' wrote:
> 
> > This may not be all we want.  Even with this patch, performing such a
> > failing map on to of an existing mapping will clobber (unmap) that
> > pre-existing mapping.  This is in contrast to the analogous situation
> > with normal page mappings - mapping on top with a misaligned offset
> > will fail early enough not to clobber the pre-existing mapping.
> 
> Then it is best to check the huge page alignment at the 
> same place as regular alignment.

Probably, yes, although it's yet another "if (hugepage)
specialcase()".  But I still think we want the above patch as well.
It will make sure we correctly back out from any other possible
failure cases in hugetlbfs_file_mmap() - ones I haven't thought of, or
which get added later.

As far as I can tell, there is in general no guarantee that a failing
MAP_FIXED() mmap() *won't* clobber what was there before.  I believe
there are (admittedly rare) possible late failure cases in pure
normalpage paths which will result in a failed mmap() after clobbering
the prior mapping.  Any failure from the filesystem or device's
f_ops->mmap callback will do this, for example.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-11-13  5:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-13  5:13 [hugepage] Fix unmap_and_free_vma backout path 'David Gibson'
2006-11-13  5:29 ` Christoph Lameter
2006-11-13  5:57   ` 'David Gibson' [this message]
2006-11-13  6:03     ` Chen, Kenneth W
2006-11-13  6:22       ` 'David Gibson'
2006-11-13  7:35         ` Chen, Kenneth W
2006-11-13 17:00           ` Hugh Dickins
2006-11-13 17:38             ` Chen, Kenneth W
2006-11-13 20:34             ` Adam Litke
2006-11-13 20:41               ` Hugh Dickins
2006-11-13 22:07                 ` Adam Litke
2006-11-13 23:53                 ` 'David Gibson'
2006-11-14 23:48                 ` Bill Irwin
2006-11-14  0:19           ` 'David Gibson'

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=20061113055711.GF27042@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=agl@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=bill.irwin@oracle.com \
    --cc=clameter@sgi.com \
    --cc=hugh@veritas.com \
    --cc=kenneth.w.chen@intel.com \
    --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 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.