linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux-foundation.org>,
	Mel Gorman <mel@csn.ul.ie>,
	Jun'ichi Nomura <j-nomura@ce.jp.nec.com>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/8] hugetlb: rename hugepage allocation functions
Date: Wed, 25 Aug 2010 09:21:31 +0800	[thread overview]
Message-ID: <20100825012131.GC7283@localhost> (raw)
In-Reply-To: <1282694127-14609-4-git-send-email-n-horiguchi@ah.jp.nec.com>

On Wed, Aug 25, 2010 at 07:55:22AM +0800, Naoya Horiguchi wrote:
> The function name alloc_huge_page_no_vma_node() has verbose suffix "_no_vma".
> This patch makes existing alloc_huge_page() and it's family have "_vma" instead,
> which makes it easier to read.
> 
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
>  include/linux/hugetlb.h |    4 ++--
>  mm/hugetlb.c            |   20 ++++++++++----------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git v2.6.36-rc2/include/linux/hugetlb.h v2.6.36-rc2/include/linux/hugetlb.h
> index 142bd4f..0b73c53 100644
> --- v2.6.36-rc2/include/linux/hugetlb.h
> +++ v2.6.36-rc2/include/linux/hugetlb.h
> @@ -228,7 +228,7 @@ struct huge_bootmem_page {
>  	struct hstate *hstate;
>  };
>  
> -struct page *alloc_huge_page_no_vma_node(struct hstate *h, int nid);
> +struct page *alloc_huge_page_node(struct hstate *h, int nid);
>  
>  /* arch callback */
>  int __init alloc_bootmem_huge_page(struct hstate *h);
> @@ -305,7 +305,7 @@ static inline struct hstate *page_hstate(struct page *page)
>  
>  #else
>  struct hstate {};
> -#define alloc_huge_page_no_vma_node(h, nid) NULL
> +#define alloc_huge_page_node(h, nid) NULL
>  #define alloc_bootmem_huge_page(h) NULL
>  #define hstate_file(f) NULL
>  #define hstate_vma(v) NULL
> diff --git v2.6.36-rc2/mm/hugetlb.c v2.6.36-rc2/mm/hugetlb.c
> index 31118d2..674a25e 100644
> --- v2.6.36-rc2/mm/hugetlb.c
> +++ v2.6.36-rc2/mm/hugetlb.c
> @@ -666,7 +666,7 @@ static struct page *alloc_buddy_huge_page_node(struct hstate *h, int nid)
>   * E.g. soft-offlining uses this function because it only cares physical
>   * address of error page.
>   */
> -struct page *alloc_huge_page_no_vma_node(struct hstate *h, int nid)
> +struct page *alloc_huge_page_node(struct hstate *h, int nid)
>  {
>  	struct page *page;
>  
> @@ -818,7 +818,7 @@ static int free_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed,
>  	return ret;
>  }
>  
> -static struct page *alloc_buddy_huge_page(struct hstate *h,
> +static struct page *alloc_buddy_huge_page_vma(struct hstate *h,
>  			struct vm_area_struct *vma, unsigned long address)
>  {
>  	struct page *page;
> @@ -919,7 +919,7 @@ static int gather_surplus_pages(struct hstate *h, int delta)
>  retry:
>  	spin_unlock(&hugetlb_lock);
>  	for (i = 0; i < needed; i++) {
> -		page = alloc_buddy_huge_page(h, NULL, 0);
> +		page = alloc_buddy_huge_page_vma(h, NULL, 0);

alloc_buddy_huge_page() doesn't make use of @vma at all, so the
parameters can be removed.

It looks cleaner to fold the
alloc_huge_page_no_vma_node=>alloc_huge_page_node renames into the
previous patch, from there split out the code refactor chunks into
a standalone patch, and then include this cleanup patch.

Thanks,
Fengguang
---
hugetlb: remove unused alloc_buddy_huge_page() parameters

alloc_buddy_huge_page() doesn't make use of @vma at all, so the
parameters can be removed.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cc5be78..3114b4c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -770,8 +770,7 @@ static int free_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed,
 	return ret;
 }
 
-static struct page *alloc_buddy_huge_page(struct hstate *h,
-			struct vm_area_struct *vma, unsigned long address)
+static struct page *alloc_buddy_huge_page(struct hstate *h)
 {
 	struct page *page;
 	unsigned int nid;
@@ -871,7 +870,7 @@ static int gather_surplus_pages(struct hstate *h, int delta)
 retry:
 	spin_unlock(&hugetlb_lock);
 	for (i = 0; i < needed; i++) {
-		page = alloc_buddy_huge_page(h, NULL, 0);
+		page = alloc_buddy_huge_page(h);
 		if (!page) {
 			/*
 			 * We were not able to allocate enough pages to
@@ -1052,7 +1051,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
 	spin_unlock(&hugetlb_lock);
 
 	if (!page) {
-		page = alloc_buddy_huge_page(h, vma, addr);
+		page = alloc_buddy_huge_page(h);
 		if (!page) {
 			hugetlb_put_quota(inode->i_mapping, chg);
 			return ERR_PTR(-VM_FAULT_SIGBUS);

--
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:[~2010-08-25  1:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 23:55 [PATCH 0/8] Hugepage migration (v3) Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 1/8] hugetlb: fix metadata corruption in hugetlb_fault() Naoya Horiguchi
2010-08-25  0:17   ` Wu Fengguang
2010-08-24 23:55 ` [PATCH 2/8] hugetlb: add allocate function for hugepage migration Naoya Horiguchi
2010-08-25  1:29   ` Wu Fengguang
2010-08-26  8:24     ` Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 3/8] hugetlb: rename hugepage allocation functions Naoya Horiguchi
2010-08-25  1:21   ` Wu Fengguang [this message]
2010-08-26  8:25     ` Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 4/8] hugetlb: redefine hugepage copy functions Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 5/8] hugetlb: hugepage migration core Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 6/8] HWPOISON, hugetlb: soft offlining for hugepage Naoya Horiguchi
2010-08-25  3:02   ` Wu Fengguang
2010-08-24 23:55 ` [PATCH 7/8] HWPOISON, hugetlb: fix unpoison " Naoya Horiguchi
2010-08-25  2:54   ` Wu Fengguang
2010-08-26  8:26     ` Naoya Horiguchi
2010-08-24 23:55 ` [PATCH 8/8] page-types.c: fix name of unpoison interface Naoya Horiguchi

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=20100825012131.GC7283@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=cl@linux-foundation.org \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=n-horiguchi@ah.jp.nec.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).