linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: linux-mm@kvack.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH v2 08/15] mm: Pass order to __get_free_page in GFP flags
Date: Fri, 10 May 2019 06:50:31 -0700	[thread overview]
Message-ID: <20190510135038.17129-9-willy@infradead.org> (raw)
In-Reply-To: <20190510135038.17129-1-willy@infradead.org>

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

Switch __get_free_page() to be the implementation and __get_free_pages()
to be the wrapper that calls __get_free_page() with the appropriate
argument.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/gfp.h | 6 +++---
 mm/page_alloc.c     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index faf3586419ce..dac282ac1158 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -536,15 +536,15 @@ extern struct page *alloc_pages_vma(gfp_t gfp, struct vm_area_struct *vma,
 #define alloc_page_vma_node(gfp_mask, vma, addr, node)		\
 	alloc_pages_vma(gfp_mask, vma, addr, node, false)
 
-extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order);
+extern unsigned long __get_free_page(gfp_t gfp_mask);
 extern unsigned long get_zeroed_page(gfp_t gfp_mask);
 
 void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
 void free_pages_exact(void *virt, size_t size);
 void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
 
-#define __get_free_page(gfp_mask) \
-		__get_free_pages((gfp_mask), 0)
+#define __get_free_pages(gfp_mask, order) \
+		__get_free_page(gfp_mask | __GFP_ORDER(order))
 
 #define __get_dma_pages(gfp_mask, order) \
 		__get_free_pages((gfp_mask) | GFP_DMA, (order))
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6e968ab91660..eefe3c81c383 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4693,16 +4693,16 @@ EXPORT_SYMBOL(__alloc_pages_nodemask);
  * address cannot represent highmem pages. Use alloc_pages and then kmap if
  * you need to access high mem.
  */
-unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order)
+unsigned long __get_free_page(gfp_t gfp_mask)
 {
 	struct page *page;
 
-	page = alloc_pages(gfp_mask & ~__GFP_HIGHMEM, order);
+	page = alloc_page(gfp_mask & ~__GFP_HIGHMEM);
 	if (!page)
 		return 0;
 	return (unsigned long) page_address(page);
 }
-EXPORT_SYMBOL(__get_free_pages);
+EXPORT_SYMBOL(__get_free_page);
 
 unsigned long get_zeroed_page(gfp_t gfp_mask)
 {
-- 
2.20.1


  parent reply	other threads:[~2019-05-10 13:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 13:50 [PATCH v2 00/15] Remove 'order' argument from many mm functions Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 01/15] mm: Remove gfp_flags argument from rmqueue_pcplist Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 02/15] mm: Pass order to __alloc_pages_nodemask in GFP flags Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 03/15] mm: Pass order to __alloc_pages " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 04/15] mm: Pass order to alloc_page_interleave " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 05/15] mm: Pass order to alloc_pages_current " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 06/15] mm: Pass order to alloc_pages_vma " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 07/15] mm: Pass order to __alloc_pages_node " Matthew Wilcox
2019-05-10 13:50 ` Matthew Wilcox [this message]
2019-05-10 13:50 ` [PATCH v2 09/15] mm: Pass order to prep_new_page " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 10/15] mm: Pass order to rmqueue " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 11/15] mm: Pass order to get_page_from_freelist " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 12/15] mm: Pass order to __alloc_pages_cpuset_fallback " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 13/15] mm: Pass order to prepare_alloc_pages " Matthew Wilcox
2019-05-10 13:50 ` [PATCH v2 14/15] mm: Pass order to try_to_free_pages " Matthew Wilcox
2019-05-10 23:26   ` Ira Weiny
2019-05-10 13:50 ` [PATCH v2 15/15] mm: Pass order to node_reclaim() " Matthew Wilcox
2019-05-10 23:30 ` [PATCH v2 00/15] Remove 'order' argument from many mm functions Ira Weiny
2019-05-13 10:51 ` Michal Hocko
2019-05-13 11:21   ` Matthew Wilcox
2019-05-13 11:42     ` Michal Hocko

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=20190510135038.17129-9-willy@infradead.org \
    --to=willy@infradead.org \
    --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 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).