linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: try_to_unmap() is now void
@ 2021-07-04 23:01 Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-07-04 23:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Yang Shi, Hugh Dickins, Andrew Morton

Fix the "CONFIG_MMU is not set" case of converting
try_to_unmap() from bool to void.

In file included from ../mm/vmscan.c:33:
../mm/vmscan.c: In function 'shrink_page_list':
../include/linux/rmap.h:294:34: warning: statement with no effect [-Wunused-value]
  294 | #define try_to_unmap(page, refs) false
      |                                  ^~~~~
../mm/vmscan.c:1508:4: note: in expansion of macro 'try_to_unmap'
 1508 |    try_to_unmap(page, flags);
      |    ^~~~~~~~~~~~

Fixes: 1fb08ac63bee ("mm: rmap: make try_to_unmap() void function")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 include/linux/rmap.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20210701.orig/include/linux/rmap.h
+++ linux-next-20210701/include/linux/rmap.h
@@ -291,7 +291,7 @@ static inline int page_referenced(struct
 	return 0;
 }
 
-#define try_to_unmap(page, refs) false
+#define try_to_unmap(page, refs) do {} while (0)
 
 static inline int page_mkclean(struct page *page)
 {

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

* Re: [PATCH] mm: try_to_unmap() is now void
  2021-07-07 16:16 Randy Dunlap
  2021-07-07 17:05 ` Matthew Wilcox
@ 2021-07-07 17:25 ` Yang Shi
  1 sibling, 0 replies; 4+ messages in thread
From: Yang Shi @ 2021-07-07 17:25 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Kernel Mailing List, Hugh Dickins, Andrew Morton, Linux MM,
	Greg Ungerer, linux-m68k, uclinux-dev

On Wed, Jul 7, 2021 at 9:16 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Fix the "CONFIG_MMU is not set" case of converting
> try_to_unmap() from bool to void.
> (as seen on m68k/coldfire)
>
> In file included from ../mm/vmscan.c:33:
> ../mm/vmscan.c: In function 'shrink_page_list':
> ../include/linux/rmap.h:294:34: warning: statement with no effect [-Wunused-value]
>   294 | #define try_to_unmap(page, refs) false
>       |                                  ^~~~~
> ../mm/vmscan.c:1508:4: note: in expansion of macro 'try_to_unmap'
>  1508 |    try_to_unmap(page, flags);
>       |    ^~~~~~~~~~~~
>

Thanks for the patch. hch sent a similar patch
(https://lore.kernel.org/linux-mm/20210705053944.885828-1-hch@lst.de/)
and it has been in -mm tree.

> Fixes: 1fb08ac63bee ("mm: rmap: make try_to_unmap() void function")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Yang Shi <shy828301@gmail.com>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-mm@kvack.org
> Cc: Greg Ungerer <gerg@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: uclinux-dev@uclinux.org
> ---
> v2: add linux-mm m.l.
>     add M68K/Coldfire Cc's
>     change to static inline function.
>
>  include/linux/rmap.h |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- linux-next-20210701.orig/include/linux/rmap.h
> +++ linux-next-20210701/include/linux/rmap.h
> @@ -291,7 +291,8 @@ static inline int page_referenced(struct
>         return 0;
>  }
>
> -#define try_to_unmap(page, refs) false
> +static inline void try_to_unmap(struct page *page, enum ttu_flags flags)
> +{}
>
>  static inline int page_mkclean(struct page *page)
>  {

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

* Re: [PATCH] mm: try_to_unmap() is now void
  2021-07-07 16:16 Randy Dunlap
@ 2021-07-07 17:05 ` Matthew Wilcox
  2021-07-07 17:25 ` Yang Shi
  1 sibling, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2021-07-07 17:05 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Yang Shi, Hugh Dickins, Andrew Morton, linux-mm,
	Greg Ungerer, linux-m68k, uclinux-dev

On Wed, Jul 07, 2021 at 09:16:14AM -0700, Randy Dunlap wrote:
> Fix the "CONFIG_MMU is not set" case of converting
> try_to_unmap() from bool to void.
> (as seen on m68k/coldfire)

hch sent basically the same patch on Monday

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

* [PATCH] mm: try_to_unmap() is now void
@ 2021-07-07 16:16 Randy Dunlap
  2021-07-07 17:05 ` Matthew Wilcox
  2021-07-07 17:25 ` Yang Shi
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-07-07 16:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Yang Shi, Hugh Dickins, Andrew Morton, linux-mm,
	Greg Ungerer, linux-m68k, uclinux-dev

Fix the "CONFIG_MMU is not set" case of converting
try_to_unmap() from bool to void.
(as seen on m68k/coldfire)

In file included from ../mm/vmscan.c:33:
../mm/vmscan.c: In function 'shrink_page_list':
../include/linux/rmap.h:294:34: warning: statement with no effect [-Wunused-value]
  294 | #define try_to_unmap(page, refs) false
      |                                  ^~~~~
../mm/vmscan.c:1508:4: note: in expansion of macro 'try_to_unmap'
 1508 |    try_to_unmap(page, flags);
      |    ^~~~~~~~~~~~

Fixes: 1fb08ac63bee ("mm: rmap: make try_to_unmap() void function")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: uclinux-dev@uclinux.org
---
v2: add linux-mm m.l.
    add M68K/Coldfire Cc's
    change to static inline function.

 include/linux/rmap.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-next-20210701.orig/include/linux/rmap.h
+++ linux-next-20210701/include/linux/rmap.h
@@ -291,7 +291,8 @@ static inline int page_referenced(struct
 	return 0;
 }
 
-#define try_to_unmap(page, refs) false
+static inline void try_to_unmap(struct page *page, enum ttu_flags flags)
+{}
 
 static inline int page_mkclean(struct page *page)
 {

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

end of thread, other threads:[~2021-07-07 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04 23:01 [PATCH] mm: try_to_unmap() is now void Randy Dunlap
2021-07-07 16:16 Randy Dunlap
2021-07-07 17:05 ` Matthew Wilcox
2021-07-07 17:25 ` Yang Shi

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).