2022-05-11 19:24:08

by Vasily Averin

[permalink] [raw]
Subject: [PATCH mm] tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate

Fixes following sparse warnings:

CHECK mm/vmscan.c
mm/vmscan.c: note: in included file (through
include/trace/trace_events.h, include/trace/define_trace.h,
include/trace/events/vmscan.h):
./include/trace/events/vmscan.h:281:1: sparse: warning:
cast to restricted isolate_mode_t
./include/trace/events/vmscan.h:281:1: sparse: warning:
restricted isolate_mode_t degrades to integer

Signed-off-by: Vasily Averin <[email protected]>
---
include/trace/events/vmscan.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 408c86244d64..d2123dd960d5 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -297,7 +297,7 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
__field(unsigned long, nr_scanned)
__field(unsigned long, nr_skipped)
__field(unsigned long, nr_taken)
- __field(isolate_mode_t, isolate_mode)
+ __field(unsigned int, isolate_mode)
__field(int, lru)
),

@@ -308,7 +308,7 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
__entry->nr_scanned = nr_scanned;
__entry->nr_skipped = nr_skipped;
__entry->nr_taken = nr_taken;
- __entry->isolate_mode = isolate_mode;
+ __entry->isolate_mode = (__force unsigned int)isolate_mode;
__entry->lru = lru;
),

--
2.31.1



2022-05-16 15:25:43

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH mm] tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate

On Wed, 11 May 2022 12:46:53 +0300
Vasily Averin <[email protected]> wrote:

> Fixes following sparse warnings:
>
> CHECK mm/vmscan.c
> mm/vmscan.c: note: in included file (through
> include/trace/trace_events.h, include/trace/define_trace.h,
> include/trace/events/vmscan.h):
> ./include/trace/events/vmscan.h:281:1: sparse: warning:
> cast to restricted isolate_mode_t
> ./include/trace/events/vmscan.h:281:1: sparse: warning:
> restricted isolate_mode_t degrades to integer
>
> Signed-off-by: Vasily Averin <[email protected]>

Acked-by: Steven Rostedt (Google) <[email protected]>

-- Steve