linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] mm: Remove unused stub for can_swapin_thp()
@ 2024-10-08 19:13 Andy Shevchenko
  2024-10-09  2:09 ` Barry Song
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2024-10-08 19:13 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel, llvm
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	Chuanhua Han, Barry Song, Andy Shevchenko

When can_swapin_thp() is unused, it prevents kernel builds
with clang, `make W=1` and CONFIG_WERROR=y:

mm/memory.c:4184:20: error: unused function 'can_swapin_thp' [-Werror,-Wunused-function]

Fix this by removing the unused stub.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 mm/memory.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 2366578015ad..c0869a962ddd 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4181,11 +4181,6 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf)
 	return __alloc_swap_folio(vmf);
 }
 #else /* !CONFIG_TRANSPARENT_HUGEPAGE */
-static inline bool can_swapin_thp(struct vm_fault *vmf, pte_t *ptep, int nr_pages)
-{
-	return false;
-}
-
 static struct folio *alloc_swap_folio(struct vm_fault *vmf)
 {
 	return __alloc_swap_folio(vmf);
-- 
2.43.0.rc1.1336.g36b5255a03ac



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] mm: Remove unused stub for can_swapin_thp()
  2024-10-08 19:13 [PATCH v1 1/1] mm: Remove unused stub for can_swapin_thp() Andy Shevchenko
@ 2024-10-09  2:09 ` Barry Song
  0 siblings, 0 replies; 2+ messages in thread
From: Barry Song @ 2024-10-09  2:09 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Andrew Morton, linux-mm, linux-kernel, llvm, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Chuanhua Han,
	Barry Song

On Wed, Oct 9, 2024 at 3:13 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> When can_swapin_thp() is unused, it prevents kernel builds
> with clang, `make W=1` and CONFIG_WERROR=y:
>
> mm/memory.c:4184:20: error: unused function 'can_swapin_thp' [-Werror,-Wunused-function]
>
> Fix this by removing the unused stub.
>
> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> inline functions for W=1 build").
>
> Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Barry Song <baohua@kernel.org>

> ---
>  mm/memory.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 2366578015ad..c0869a962ddd 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -4181,11 +4181,6 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf)
>         return __alloc_swap_folio(vmf);
>  }
>  #else /* !CONFIG_TRANSPARENT_HUGEPAGE */
> -static inline bool can_swapin_thp(struct vm_fault *vmf, pte_t *ptep, int nr_pages)
> -{
> -       return false;
> -}
> -
>  static struct folio *alloc_swap_folio(struct vm_fault *vmf)
>  {
>         return __alloc_swap_folio(vmf);
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-09  2:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-08 19:13 [PATCH v1 1/1] mm: Remove unused stub for can_swapin_thp() Andy Shevchenko
2024-10-09  2:09 ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox