* Re: [PATCH] mm/page: Drop has_unaccepted_memory() helper
[not found] <20240909081930.748708-1-kirill.shutemov@linux.intel.com>
@ 2024-09-09 8:25 ` Mike Rapoport
2024-09-09 8:43 ` David Hildenbrand
2024-09-09 19:25 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Mike Rapoport @ 2024-09-09 8:25 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Andrew Morton, Vlastimil Babka, Matthew Wilcox (Oracle),
David Hildenbrand, linux-mm, linux-kernel, kernel test robot
On Mon, Sep 09, 2024 at 11:19:30AM +0300, Kirill A. Shutemov wrote:
> has_unaccepted_memory() has the only caller -- cond_accept_memory().
>
> Remove the helper and check zones_with_unaccepted_pages directly in
> cond_accept_memory().
>
> It also fixes warning with clang 18 when kernel is compiled without
> unaccepted memory support:
>
> mm/page_alloc.c:7043:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function]
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409061101.Jlx5z2fI-lkp@intel.com/
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> mm/page_alloc.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 91ace8ca97e2..7fc5af7cb387 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -288,7 +288,6 @@ EXPORT_SYMBOL(nr_online_nodes);
> static bool page_contains_unaccepted(struct page *page, unsigned int order);
> static void accept_page(struct page *page, unsigned int order);
> static bool cond_accept_memory(struct zone *zone, unsigned int order);
> -static inline bool has_unaccepted_memory(void);
> static bool __free_unaccepted(struct page *page);
>
> int page_group_by_mobility_disabled __read_mostly;
> @@ -6975,7 +6974,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order)
> long to_accept;
> bool ret = false;
>
> - if (!has_unaccepted_memory())
> + if (!static_branch_unlikely(&zones_with_unaccepted_pages))
> return false;
>
> if (list_empty(&zone->unaccepted_pages))
> @@ -6997,11 +6996,6 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order)
> return ret;
> }
>
> -static inline bool has_unaccepted_memory(void)
> -{
> - return static_branch_unlikely(&zones_with_unaccepted_pages);
> -}
> -
> static bool __free_unaccepted(struct page *page)
> {
> struct zone *zone = page_zone(page);
> @@ -7040,11 +7034,6 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order)
> return false;
> }
>
> -static inline bool has_unaccepted_memory(void)
> -{
> - return false;
> -}
> -
> static bool __free_unaccepted(struct page *page)
> {
> BUILD_BUG();
> --
> 2.45.2
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/page: Drop has_unaccepted_memory() helper
[not found] <20240909081930.748708-1-kirill.shutemov@linux.intel.com>
2024-09-09 8:25 ` [PATCH] mm/page: Drop has_unaccepted_memory() helper Mike Rapoport
@ 2024-09-09 8:43 ` David Hildenbrand
2024-09-09 19:25 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2024-09-09 8:43 UTC (permalink / raw)
To: Kirill A. Shutemov, Andrew Morton, Vlastimil Babka
Cc: Mike Rapoport, Matthew Wilcox (Oracle),
linux-mm, linux-kernel, kernel test robot
On 09.09.24 10:19, Kirill A. Shutemov wrote:
> has_unaccepted_memory() has the only caller -- cond_accept_memory().
>
> Remove the helper and check zones_with_unaccepted_pages directly in
> cond_accept_memory().
>
> It also fixes warning with clang 18 when kernel is compiled without
> unaccepted memory support:
>
> mm/page_alloc.c:7043:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function]
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409061101.Jlx5z2fI-lkp@intel.com/
> ---
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/page: Drop has_unaccepted_memory() helper
[not found] <20240909081930.748708-1-kirill.shutemov@linux.intel.com>
2024-09-09 8:25 ` [PATCH] mm/page: Drop has_unaccepted_memory() helper Mike Rapoport
2024-09-09 8:43 ` David Hildenbrand
@ 2024-09-09 19:25 ` Andrew Morton
2024-09-09 22:00 ` Kirill A. Shutemov
2 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2024-09-09 19:25 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Vlastimil Babka, Mike Rapoport, Matthew Wilcox (Oracle),
David Hildenbrand, linux-mm, linux-kernel, kernel test robot
On Mon, 9 Sep 2024 11:19:30 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> has_unaccepted_memory() has the only caller -- cond_accept_memory().
>
> Remove the helper and check zones_with_unaccepted_pages directly in
> cond_accept_memory().
>
> It also fixes warning with clang 18 when kernel is compiled without
> unaccepted memory support:
>
> mm/page_alloc.c:7043:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function]
>
Thanks, mm-unstable has a similar fix:
--- a/mm/page_alloc.c~mm-page_alloc-fix-build-with-config_unaccepted_memory=n
+++ a/mm/page_alloc.c
@@ -287,7 +287,6 @@ EXPORT_SYMBOL(nr_online_nodes);
static bool page_contains_unaccepted(struct page *page, unsigned int order);
static bool cond_accept_memory(struct zone *zone, unsigned int order);
-static inline bool has_unaccepted_memory(void);
static bool __free_unaccepted(struct page *page);
int page_group_by_mobility_disabled __read_mostly;
@@ -7068,6 +7067,11 @@ static bool try_to_accept_memory_one(str
return true;
}
+static inline bool has_unaccepted_memory(void)
+{
+ return static_branch_unlikely(&zones_with_unaccepted_pages);
+}
+
static bool cond_accept_memory(struct zone *zone, unsigned int order)
{
long to_accept;
@@ -7095,11 +7099,6 @@ static bool cond_accept_memory(struct zo
return ret;
}
-static inline bool has_unaccepted_memory(void)
-{
- return static_branch_unlikely(&zones_with_unaccepted_pages);
-}
-
static bool __free_unaccepted(struct page *page)
{
struct zone *zone = page_zone(page);
@@ -7134,11 +7133,6 @@ static bool cond_accept_memory(struct zo
{
return false;
}
-
-static inline bool has_unaccepted_memory(void)
-{
- return false;
-}
static bool __free_unaccepted(struct page *page)
{
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/page: Drop has_unaccepted_memory() helper
2024-09-09 19:25 ` Andrew Morton
@ 2024-09-09 22:00 ` Kirill A. Shutemov
0 siblings, 0 replies; 4+ messages in thread
From: Kirill A. Shutemov @ 2024-09-09 22:00 UTC (permalink / raw)
To: Andrew Morton
Cc: Vlastimil Babka, Mike Rapoport, Matthew Wilcox (Oracle),
David Hildenbrand, linux-mm, linux-kernel, kernel test robot
On Mon, Sep 09, 2024 at 12:25:58PM -0700, Andrew Morton wrote:
> On Mon, 9 Sep 2024 11:19:30 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
>
> > has_unaccepted_memory() has the only caller -- cond_accept_memory().
> >
> > Remove the helper and check zones_with_unaccepted_pages directly in
> > cond_accept_memory().
> >
> > It also fixes warning with clang 18 when kernel is compiled without
> > unaccepted memory support:
> >
> > mm/page_alloc.c:7043:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function]
> >
>
> Thanks, mm-unstable has a similar fix:
Works for me.
--
Kiryl Shutsemau / Kirill A. Shutemov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-09 22:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20240909081930.748708-1-kirill.shutemov@linux.intel.com>
2024-09-09 8:25 ` [PATCH] mm/page: Drop has_unaccepted_memory() helper Mike Rapoport
2024-09-09 8:43 ` David Hildenbrand
2024-09-09 19:25 ` Andrew Morton
2024-09-09 22:00 ` Kirill A. Shutemov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox