* + mm-simplify-free_highmem_page-and-free_reserved_page.patch added to -mm tree
@ 2021-01-26 19:37 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-01-26 19:37 UTC (permalink / raw)
To: david, gustavoars, mhocko, mm-commits, osalvador, peterz,
richard.weiyang, rppt, sam, tglx
The patch titled
Subject: mm: simplify free_highmem_page() and free_reserved_page()
has been added to the -mm tree. Its filename is
mm-simplify-free_highmem_page-and-free_reserved_page.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-simplify-free_highmem_page-and-free_reserved_page.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-simplify-free_highmem_page-and-free_reserved_page.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: David Hildenbrand <david@redhat.com>
Subject: mm: simplify free_highmem_page() and free_reserved_page()
adjust_managed_page_count() as called by free_reserved_page() properly
handles pages in a highmem zone, so we can reuse it for
free_highmem_page().
We can now get rid of totalhigh_pages_inc() and simplify
free_reserved_page().
Link: https://lkml.kernel.org/r/20210126182113.19892-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/highmem-internal.h | 5 -----
include/linux/mm.h | 16 ++--------------
mm/page_alloc.c | 11 -----------
3 files changed, 2 insertions(+), 30 deletions(-)
--- a/include/linux/highmem-internal.h~mm-simplify-free_highmem_page-and-free_reserved_page
+++ a/include/linux/highmem-internal.h
@@ -127,11 +127,6 @@ static inline unsigned long totalhigh_pa
return (unsigned long)atomic_long_read(&_totalhigh_pages);
}
-static inline void totalhigh_pages_inc(void)
-{
- atomic_long_inc(&_totalhigh_pages);
-}
-
static inline void totalhigh_pages_add(long count)
{
atomic_long_add(count, &_totalhigh_pages);
--- a/include/linux/mm.h~mm-simplify-free_highmem_page-and-free_reserved_page
+++ a/include/linux/mm.h
@@ -2344,32 +2344,20 @@ extern void free_initmem(void);
extern unsigned long free_reserved_area(void *start, void *end,
int poison, const char *s);
-#ifdef CONFIG_HIGHMEM
-/*
- * Free a highmem page into the buddy system, adjusting totalhigh_pages
- * and totalram_pages.
- */
-extern void free_highmem_page(struct page *page);
-#endif
-
extern void adjust_managed_page_count(struct page *page, long count);
extern void mem_init_print_info(const char *str);
extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
/* Free the reserved page into the buddy system, so it gets managed. */
-static inline void __free_reserved_page(struct page *page)
+static inline void free_reserved_page(struct page *page)
{
ClearPageReserved(page);
init_page_count(page);
__free_page(page);
-}
-
-static inline void free_reserved_page(struct page *page)
-{
- __free_reserved_page(page);
adjust_managed_page_count(page, 1);
}
+#define free_highmem_page(page) free_reserved_page(page)
static inline void mark_page_reserved(struct page *page)
{
--- a/mm/page_alloc.c~mm-simplify-free_highmem_page-and-free_reserved_page
+++ a/mm/page_alloc.c
@@ -7705,17 +7705,6 @@ unsigned long free_reserved_area(void *s
return pages;
}
-#ifdef CONFIG_HIGHMEM
-void free_highmem_page(struct page *page)
-{
- __free_reserved_page(page);
- totalram_pages_inc();
- atomic_long_inc(&page_zone(page)->managed_pages);
- totalhigh_pages_inc();
-}
-#endif
-
-
void __init mem_init_print_info(const char *str)
{
unsigned long physpages, codesize, datasize, rosize, bss_size;
_
Patches currently in -mm which might be from david@redhat.com are
video-fbdev-acornfb-remove-free_unused_pages.patch
mm-simplify-free_highmem_page-and-free_reserved_page.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-27 2:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 19:37 + mm-simplify-free_highmem_page-and-free_reserved_page.patch added to -mm tree akpm
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).