* [merged mm-stable] mm-reimplement-folio_order-and-folio_nr_pages.patch removed from -mm tree
@ 2022-10-03 21:04 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-10-03 21:04 UTC (permalink / raw)
To: mm-commits, willy, akpm
The quilt patch titled
Subject: mm: reimplement folio_order() and folio_nr_pages()
has been removed from the -mm tree. Its filename was
mm-reimplement-folio_order-and-folio_nr_pages.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: mm: reimplement folio_order() and folio_nr_pages()
Date: Fri, 2 Sep 2022 20:45:59 +0100
Instead of calling compound_order() and compound_nr_pages(), use the folio
directly. Saves 1905 bytes from mm/filemap.o due to folio_test_large()
now being a cheaper check than PageHead().
Link: https://lkml.kernel.org/r/20220902194653.1739778-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/mm.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/include/linux/mm.h~mm-reimplement-folio_order-and-folio_nr_pages
+++ a/include/linux/mm.h
@@ -729,7 +729,9 @@ static inline unsigned int compound_orde
*/
static inline unsigned int folio_order(struct folio *folio)
{
- return compound_order(&folio->page);
+ if (!folio_test_large(folio))
+ return 0;
+ return folio->_folio_order;
}
#include <linux/huge_mm.h>
@@ -1659,7 +1661,13 @@ static inline void set_page_links(struct
*/
static inline long folio_nr_pages(struct folio *folio)
{
- return compound_nr(&folio->page);
+ if (!folio_test_large(folio))
+ return 1;
+#ifdef CONFIG_64BIT
+ return folio->_folio_nr_pages;
+#else
+ return 1L << folio->_folio_order;
+#endif
}
/**
_
Patches currently in -mm which might be from willy@infradead.org are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-03 21:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03 21:04 [merged mm-stable] mm-reimplement-folio_order-and-folio_nr_pages.patch removed from -mm tree Andrew Morton
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.