2021-02-09 18:31:42

by Yang Shi

[permalink] [raw]
Subject: [v7 PATCH 01/12] mm: vmscan: use nid from shrink_control for tracepoint

The tracepoint's nid should show what node the shrink happens on, the start tracepoint
uses nid from shrinkctl, but the nid might be set to 0 before end tracepoint if the
shrinker is not NUMA aware, so the traceing log may show the shrink happens on one
node but end up on the other node. It seems confusing. And the following patch
will remove using nid directly in do_shrink_slab(), this patch also helps cleanup
the code.

Acked-by: Vlastimil Babka <[email protected]>
Acked-by: Kirill Tkhai <[email protected]>
Signed-off-by: Yang Shi <[email protected]>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b1b574ad199d..b512dd5e3a1c 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -535,7 +535,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
else
new_nr = atomic_long_read(&shrinker->nr_deferred[nid]);

- trace_mm_shrink_slab_end(shrinker, nid, freed, nr, new_nr, total_scan);
+ trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
return freed;
}

--
2.26.2


2021-02-10 00:43:09

by Shakeel Butt

[permalink] [raw]
Subject: Re: [v7 PATCH 01/12] mm: vmscan: use nid from shrink_control for tracepoint

On Tue, Feb 9, 2021 at 9:47 AM Yang Shi <[email protected]> wrote:
>
> The tracepoint's nid should show what node the shrink happens on, the start tracepoint
> uses nid from shrinkctl, but the nid might be set to 0 before end tracepoint if the
> shrinker is not NUMA aware, so the traceing

tracing

> log may show the shrink happens on one
> node but end up on the other node. It seems confusing. And the following patch
> will remove using nid directly in do_shrink_slab(), this patch also helps cleanup
> the code.
>
> Acked-by: Vlastimil Babka <[email protected]>
> Acked-by: Kirill Tkhai <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>

Reviewed-by: Shakeel Butt <[email protected]>

2021-02-10 01:37:06

by Roman Gushchin

[permalink] [raw]
Subject: Re: [v7 PATCH 01/12] mm: vmscan: use nid from shrink_control for tracepoint

On Tue, Feb 09, 2021 at 09:46:35AM -0800, Yang Shi wrote:
> The tracepoint's nid should show what node the shrink happens on, the start tracepoint
> uses nid from shrinkctl, but the nid might be set to 0 before end tracepoint if the
> shrinker is not NUMA aware, so the traceing log may show the shrink happens on one
> node but end up on the other node. It seems confusing. And the following patch
> will remove using nid directly in do_shrink_slab(), this patch also helps cleanup
> the code.
>
> Acked-by: Vlastimil Babka <[email protected]>
> Acked-by: Kirill Tkhai <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>

Acked-by: Roman Gushchin <[email protected]>

> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index b1b574ad199d..b512dd5e3a1c 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -535,7 +535,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
> else
> new_nr = atomic_long_read(&shrinker->nr_deferred[nid]);
>
> - trace_mm_shrink_slab_end(shrinker, nid, freed, nr, new_nr, total_scan);
> + trace_mm_shrink_slab_end(shrinker, shrinkctl->nid, freed, nr, new_nr, total_scan);
> return freed;
> }
>
> --
> 2.26.2
>

2021-02-10 17:01:43

by Yang Shi

[permalink] [raw]
Subject: Re: [v7 PATCH 01/12] mm: vmscan: use nid from shrink_control for tracepoint

On Tue, Feb 9, 2021 at 11:14 AM Shakeel Butt <[email protected]> wrote:
>
> On Tue, Feb 9, 2021 at 9:47 AM Yang Shi <[email protected]> wrote:
> >
> > The tracepoint's nid should show what node the shrink happens on, the start tracepoint
> > uses nid from shrinkctl, but the nid might be set to 0 before end tracepoint if the
> > shrinker is not NUMA aware, so the traceing
>
> tracing

Fixed. Thanks.

>
> > log may show the shrink happens on one
> > node but end up on the other node. It seems confusing. And the following patch
> > will remove using nid directly in do_shrink_slab(), this patch also helps cleanup
> > the code.
> >
> > Acked-by: Vlastimil Babka <[email protected]>
> > Acked-by: Kirill Tkhai <[email protected]>
> > Signed-off-by: Yang Shi <[email protected]>
>
> Reviewed-by: Shakeel Butt <[email protected]>