[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200212041845.25879-3-willy@infradead.org>
Date: Tue, 11 Feb 2020 20:18:22 -0800
From: Matthew Wilcox <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 02/25] mm: Optimise find_subpage for !THP
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
If THP is disabled, find_subpage can become a no-op.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
include/linux/pagemap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 75bdfec49710..0842622cca90 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -340,7 +340,7 @@ static inline struct page *find_subpage(struct page *page, pgoff_t offset)
VM_BUG_ON_PAGE(PageTail(page), page);
- return page + (offset & (compound_nr(page) - 1));
+ return page + (offset & (hpage_nr_pages(page) - 1));
}
struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);
--
2.25.0
Powered by blists - more mailing lists