linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andy Whitcroft <apw@shadowen.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, agl@us.ibm.com,
	wli@holomorphy.com, kenchen@google.com, dwg@au1.ibm.com,
	andi@firstfloor.org, Mel Gorman <mel@csn.ul.ie>,
	dean@arctic.org, abh@cray.com,
	Michael Kerrisk <mtk.manpages@googlemail.com>
Subject: Re: [PATCH 3/3] hugetlb-allow-huge-page-mappings-to-be-created-without-reservations
Date: Wed, 28 May 2008 18:51:21 -0700	[thread overview]
Message-ID: <20080528185121.86805747.akpm@linux-foundation.org> (raw)
In-Reply-To: <1211929806.0@pinky>

On Wed, 28 May 2008 00:10:06 +0100 Andy Whitcroft <apw@shadowen.org> wrote:

> +		unsigned long idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) +
> +				(vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
> +		return region_chg(&inode->i_mapping->private_list,
> +							idx, idx + 1);
> +
> +	} else {
> +		if (!is_vma_resv_set(vma, HPAGE_RESV_OWNER))
> +			return 1;
> +	}
> +
> +	return 0;
> +}
> +static void vma_commit_reservation(struct vm_area_struct *vma,
> +							unsigned long addr)
> +{
> +	struct address_space *mapping = vma->vm_file->f_mapping;
> +	struct inode *inode = mapping->host;
> +
> +	if (vma->vm_flags & VM_SHARED) {
> +		unsigned long idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) +
> +				(vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
> +		region_add(&inode->i_mapping->private_list, idx, idx + 1);

There are a couple more users of the little helper function which I
suggested that Mel add.

They both use ulong too - I do think that pgoff_t has a little
documentary value.

I guess these changes impact the manpages, but the mmap manpage doesn't
seem to know about huge pages at all.

--
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>

  parent reply	other threads:[~2008-05-29  1:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 23:09 [PATCH 0/3] MAP_NORESERVE for hugetlb mappings V3 Andy Whitcroft
2008-05-27 23:09 ` [PATCH 1/3] record MAP_NORESERVE status on vmas and fix small page mprotect reservations Andy Whitcroft
2008-05-27 23:09 ` [PATCH 2/3] hugetlb-move-reservation-region-support-earlier Andy Whitcroft
2008-05-28 20:38   ` Adam Litke
2008-05-27 23:10 ` [PATCH 3/3] hugetlb-allow-huge-page-mappings-to-be-created-without-reservations Andy Whitcroft
2008-05-28 20:53   ` Adam Litke
2008-05-29  1:51   ` Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-20 16:54 [PATCH 0/3] MAP_NORESERVE for hugetlb mappings V2 Andy Whitcroft
2008-05-20 16:55 ` [PATCH 3/3] hugetlb-allow-huge-page-mappings-to-be-created-without-reservations Andy Whitcroft
2008-05-07 20:24 [PATCH 0/3] MAP_NORESERVE for hugetlb mappings V1 Andy Whitcroft
2008-05-07 20:25 ` [PATCH 3/3] hugetlb-allow-huge-page-mappings-to-be-created-without-reservations Andy Whitcroft

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=20080528185121.86805747.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=abh@cray.com \
    --cc=agl@us.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=apw@shadowen.org \
    --cc=dean@arctic.org \
    --cc=dwg@au1.ibm.com \
    --cc=kenchen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mtk.manpages@googlemail.com \
    --cc=wli@holomorphy.com \
    /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;
as well as URLs for NNTP newsgroup(s).