2020-10-01 19:21:49

by Linus Torvalds

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

Adding Vlastimil, Roman and the kernel mailing list to the cc.

Vlastimil, Roman - this looks like a slab regression. And while others
have touched slab in this merge window, you guys did so more than
most.. Comments?

On Wed, Sep 30, 2020 at 11:55 PM Bastian Bittorf <[email protected]> wrote:
>
> Since 5.9-rc1 i can see false values, booting with qemu (128mb RAM):
>
> / # free
> total used free shared buff/cache available
> Mem: 122176 18014398506028288 114848 0 3461024 3568096

that looks like a negative 64-bit number shifted down by 10 bits (bytes -> kB).

> / # cat /proc/meminfo | grep ^V
> VmallocTotal: 34359738367 kB

.. but this part is normal. VMALLOC_TOTAL is the VM space for vmalloc
areas, and it's large on a 64-bit machine.

And afaik, it hasn't changed in a long time.

So I think there's something else confusing 'free'.

I think it's this:

> / # cat /proc/meminfo
> MemAvailable: 3617184 kB
..
> Slab: 10321920 kB
> SReclaimable: 3506176 kB
> SUnreclaim: 6815744 kB

because those slab reclaimable/unreclaimable numbers look completely
bogus. You have more unreclaimable slab space than you have memory.

Hmm. I'm not seeing anything similar. And your config looks sane, with
the main difference I see wrt SLAB being that you have

# CONFIG_SLAB_MERGE_DEFAULT is not set

but there's nothing wrong with that either.

It would be lovely if you could bisect it, but maybe Vlastimil or
Roman will go "Ahh, obviously.."

Linus


2020-10-01 20:00:50

by Roman Gushchin

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

On Thu, Oct 01, 2020 at 12:19:57PM -0700, Linus Torvalds wrote:
> Adding Vlastimil, Roman and the kernel mailing list to the cc.
>
> Vlastimil, Roman - this looks like a slab regression. And while others
> have touched slab in this merge window, you guys did so more than
> most.. Comments?

Thank you, Linus!

I think it's a regression from my slab controller changes, and I have a theory.
Bastian, can you, please, share your config?

I will come up with a patch soon.

Thanks!

>
> On Wed, Sep 30, 2020 at 11:55 PM Bastian Bittorf <[email protected]> wrote:
> >
> > Since 5.9-rc1 i can see false values, booting with qemu (128mb RAM):
> >
> > / # free
> > total used free shared buff/cache available
> > Mem: 122176 18014398506028288 114848 0 3461024 3568096
>
> that looks like a negative 64-bit number shifted down by 10 bits (bytes -> kB).
>
> > / # cat /proc/meminfo | grep ^V
> > VmallocTotal: 34359738367 kB
>
> .. but this part is normal. VMALLOC_TOTAL is the VM space for vmalloc
> areas, and it's large on a 64-bit machine.
>
> And afaik, it hasn't changed in a long time.
>
> So I think there's something else confusing 'free'.
>
> I think it's this:
>
> > / # cat /proc/meminfo
> > MemAvailable: 3617184 kB
> ..
> > Slab: 10321920 kB
> > SReclaimable: 3506176 kB
> > SUnreclaim: 6815744 kB
>
> because those slab reclaimable/unreclaimable numbers look completely
> bogus. You have more unreclaimable slab space than you have memory.
>
> Hmm. I'm not seeing anything similar. And your config looks sane, with
> the main difference I see wrt SLAB being that you have
>
> # CONFIG_SLAB_MERGE_DEFAULT is not set
>
> but there's nothing wrong with that either.
>
> It would be lovely if you could bisect it, but maybe Vlastimil or
> Roman will go "Ahh, obviously.."
>
> Linus

2020-10-01 20:00:50

by Linus Torvalds

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

On Thu, Oct 1, 2020 at 12:56 PM Roman Gushchin <[email protected]> wrote:
>
> Bastian, can you, please, share your config?

Bastian actually did that in the original email, but that was only
sent to me and Andrew in private.

Here's that config replicated for your pleasure,

Linus


Attachments:
config.txt (34.56 kB)

2020-10-01 20:41:46

by Roman Gushchin

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

On Thu, Oct 01, 2020 at 12:58:36PM -0700, Linus Torvalds wrote:
> On Thu, Oct 1, 2020 at 12:56 PM Roman Gushchin <[email protected]> wrote:
> >
> > Bastian, can you, please, share your config?
>
> Bastian actually did that in the original email, but that was only
> sent to me and Andrew in private.
>
> Here's that config replicated for your pleasure,

Thank you!

>
> #
> # Processor type and features
> #
> # CONFIG_ZONE_DMA is not set
> # CONFIG_SMP is not set

Yes, here is the deal.

The SMP-version of __mod_node_page_state() converts a passed value from bytes
to pages, but the non-SMP doesn't.

Thanks!


--

From 3d0233b37340c78012b991d3570b92f91cf5ebd2 Mon Sep 17 00:00:00 2001
From: Roman Gushchin <[email protected]>
Date: Thu, 1 Oct 2020 13:07:49 -0700
Subject: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

Since ea426c2a7de8 ("mm: memcg: prepare for byte-sized vmstat items")
the write side of slab counters accepts a value in bytes and converts
it to pages. It happens in __mod_node_page_state().

However a non-SMP version of __mod_node_page_state() doesn't perform
this conversion. It leads to incorrect (unrealistically high) slab
counters values. Fix this by adding a similar conversion to the
non-SMP version of __mod_node_page_state().

Signed-off-by: Roman Gushchin <[email protected]>
Reported-by: Bastian Bittorf <[email protected]>
Fixes: ea426c2a7de8 ("mm: memcg: prepare for byte-sized vmstat items")
---
include/linux/vmstat.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index d5431c1bf6e5..322dcbfcc933 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -312,6 +312,11 @@ static inline void __mod_zone_page_state(struct zone *zone,
static inline void __mod_node_page_state(struct pglist_data *pgdat,
enum node_stat_item item, int delta)
{
+ if (vmstat_item_in_bytes(item)) {
+ VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
+ delta >>= PAGE_SHIFT;
+ }
+
node_page_state_add(delta, pgdat, item);
}

--
2.26.2

2020-10-02 00:11:08

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

Hi Roman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mmotm/master]

url: https://github.com/0day-ci/linux/commits/Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
base: git://git.cmpxchg.org/linux-mmotm.git master
config: i386-randconfig-s002-20200930 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-201-g24bdaac6-dirty
# https://github.com/0day-ci/linux/commit/3e4248734433fea1624e4971258042af2f231e02
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
git checkout 3e4248734433fea1624e4971258042af2f231e02
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from include/linux/mm.h:1317,
from include/linux/memcontrol.h:20,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/vmstat.h: In function '__mod_node_page_state':
>> include/linux/vmstat.h:295:6: error: implicit declaration of function 'vmstat_item_in_bytes' [-Werror=implicit-function-declaration]
295 | if (vmstat_item_in_bytes(item)) {
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:99: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1139: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:179: sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +/vmstat_item_in_bytes +295 include/linux/vmstat.h

291
292 static inline void __mod_node_page_state(struct pglist_data *pgdat,
293 enum node_stat_item item, int delta)
294 {
> 295 if (vmstat_item_in_bytes(item)) {
296 VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
297 delta >>= PAGE_SHIFT;
298 }
299
300 node_page_state_add(delta, pgdat, item);
301 }
302

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (2.58 kB)
.config.gz (32.50 kB)
Download all attachments

2020-10-02 00:58:00

by Roman Gushchin

[permalink] [raw]
Subject: Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

On Fri, Oct 02, 2020 at 08:08:40AM +0800, kbuild test robot wrote:
> Hi Roman,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on mmotm/master]

It's a bogus error, the patch was applied onto mmotm/master, which doesn't
contain necessary slab controller patches.

Thanks!

>
> url: https://github.com/0day-ci/linux/commits/Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
> base: git://git.cmpxchg.org/linux-mmotm.git master
> config: i386-randconfig-s002-20200930 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.2-201-g24bdaac6-dirty
> # https://github.com/0day-ci/linux/commit/3e4248734433fea1624e4971258042af2f231e02
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
> git checkout 3e4248734433fea1624e4971258042af2f231e02
> # save the attached .config to linux build tree
> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/mm.h:1317,
> from include/linux/memcontrol.h:20,
> from include/linux/swap.h:9,
> from include/linux/suspend.h:5,
> from arch/x86/kernel/asm-offsets.c:13:
> include/linux/vmstat.h: In function '__mod_node_page_state':
> >> include/linux/vmstat.h:295:6: error: implicit declaration of function 'vmstat_item_in_bytes' [-Werror=implicit-function-declaration]
> 295 | if (vmstat_item_in_bytes(item)) {
> | ^~~~~~~~~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> make[2]: *** [scripts/Makefile.build:99: arch/x86/kernel/asm-offsets.s] Error 1
> make[2]: Target '__build' not remade because of errors.
> make[1]: *** [Makefile:1139: prepare0] Error 2
> make[1]: Target 'prepare' not remade because of errors.
> make: *** [Makefile:179: sub-make] Error 2
> make: Target 'prepare' not remade because of errors.
>
> vim +/vmstat_item_in_bytes +295 include/linux/vmstat.h
>
> 291
> 292 static inline void __mod_node_page_state(struct pglist_data *pgdat,
> 293 enum node_stat_item item, int delta)
> 294 {
> > 295 if (vmstat_item_in_bytes(item)) {
> 296 VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
> 297 delta >>= PAGE_SHIFT;
> 298 }
> 299
> 300 node_page_state_add(delta, pgdat, item);
> 301 }
> 302
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_hyperkitty_list_kbuild-2Dall-40lists.01.org&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=jJYgtDM7QT-W-Fz_d29HYQ&m=a91mqnAqjcA0iLpnhkpBXCmVqE_BuOIny-YmkB8jp2U&s=4EiiISKLS8YORtIb2rqP7oxVeqhBmKzMHqJzWhDAuMw&e=


2020-10-02 05:39:52

by Philip Li

[permalink] [raw]
Subject: Re: [kbuild-all] Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

On Thu, Oct 01, 2020 at 05:55:59PM -0700, Roman Gushchin wrote:
> On Fri, Oct 02, 2020 at 08:08:40AM +0800, kbuild test robot wrote:
> > Hi Roman,
> >
> > Thank you for the patch! Yet something to improve:
> >
> > [auto build test ERROR on mmotm/master]
>
> It's a bogus error, the patch was applied onto mmotm/master, which doesn't
> contain necessary slab controller patches.
sorry for the wrong report, and thanks for the input, we will check
this to see whether we can find an appropriate base for this case.
Meanwhile, you can give a try to use --base option when git format patch, which
helps us to have more clue when looking for base info.

>
> Thanks!
>
> >
> > url: https://github.com/0day-ci/linux/commits/Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
> > base: git://git.cmpxchg.org/linux-mmotm.git master
> > config: i386-randconfig-s002-20200930 (attached as .config)
> > compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> > reproduce:
> > # apt-get install sparse
> > # sparse version: v0.6.2-201-g24bdaac6-dirty
> > # https://github.com/0day-ci/linux/commit/3e4248734433fea1624e4971258042af2f231e02
> > git remote add linux-review https://github.com/0day-ci/linux
> > git fetch --no-tags linux-review Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
> > git checkout 3e4248734433fea1624e4971258042af2f231e02
> > # save the attached .config to linux build tree
> > make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <[email protected]>
> >
> > All errors (new ones prefixed by >>):
> >
> > In file included from include/linux/mm.h:1317,
> > from include/linux/memcontrol.h:20,
> > from include/linux/swap.h:9,
> > from include/linux/suspend.h:5,
> > from arch/x86/kernel/asm-offsets.c:13:
> > include/linux/vmstat.h: In function '__mod_node_page_state':
> > >> include/linux/vmstat.h:295:6: error: implicit declaration of function 'vmstat_item_in_bytes' [-Werror=implicit-function-declaration]
> > 295 | if (vmstat_item_in_bytes(item)) {
> > | ^~~~~~~~~~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> > make[2]: *** [scripts/Makefile.build:99: arch/x86/kernel/asm-offsets.s] Error 1
> > make[2]: Target '__build' not remade because of errors.
> > make[1]: *** [Makefile:1139: prepare0] Error 2
> > make[1]: Target 'prepare' not remade because of errors.
> > make: *** [Makefile:179: sub-make] Error 2
> > make: Target 'prepare' not remade because of errors.
> >
> > vim +/vmstat_item_in_bytes +295 include/linux/vmstat.h
> >
> > 291
> > 292 static inline void __mod_node_page_state(struct pglist_data *pgdat,
> > 293 enum node_stat_item item, int delta)
> > 294 {
> > > 295 if (vmstat_item_in_bytes(item)) {
> > 296 VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
> > 297 delta >>= PAGE_SHIFT;
> > 298 }
> > 299
> > 300 node_page_state_add(delta, pgdat, item);
> > 301 }
> > 302
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_hyperkitty_list_kbuild-2Dall-40lists.01.org&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=jJYgtDM7QT-W-Fz_d29HYQ&m=a91mqnAqjcA0iLpnhkpBXCmVqE_BuOIny-YmkB8jp2U&s=4EiiISKLS8YORtIb2rqP7oxVeqhBmKzMHqJzWhDAuMw&e=
>
> _______________________________________________
> kbuild-all mailing list -- [email protected]
> To unsubscribe send an email to [email protected]

2020-10-02 07:10:00

by Bastian Bittorf

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported | Patch OK

On Thu, Oct 01, 2020 at 01:39:31PM -0700, Roman Gushchin wrote:
> > # Processor type and features
> > #
> > # CONFIG_ZONE_DMA is not set
> > # CONFIG_SMP is not set
>
> Yes, here is the deal.
>
> The SMP-version of __mod_node_page_state() converts a passed value from bytes
> to pages, but the non-SMP doesn't.
>
> Thanks!
>
> --
>
> From 3d0233b37340c78012b991d3570b92f91cf5ebd2 Mon Sep 17 00:00:00 2001
> From: Roman Gushchin <[email protected]>
> Date: Thu, 1 Oct 2020 13:07:49 -0700
> Subject: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration


I manually applied your patch and
this fixes to issue on my side too:

/ # free
total used free shared buff/cache available
Mem: 122176 2484 114848 0 4844
113228
Swap: 0 0 0

/ # uname -a
Linux (none) 5.9.0-rc7 #1 Fri Oct 2 08:50:59 CEST 2020 x86_64 GNU/Linux
/ #

Thanks a lot and sorry for the delay (my bisecting was too slow),
bye Bastian Bittorf

2020-10-02 08:54:56

by Vlastimil Babka

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

On 10/1/20 10:39 PM, Roman Gushchin wrote:
> On Thu, Oct 01, 2020 at 12:58:36PM -0700, Linus Torvalds wrote:
>> On Thu, Oct 1, 2020 at 12:56 PM Roman Gushchin <[email protected]> wrote:
>> >
>> > Bastian, can you, please, share your config?
>>
>> Bastian actually did that in the original email, but that was only
>> sent to me and Andrew in private.
>>
>> Here's that config replicated for your pleasure,
>
> Thank you!
>
>>
>> #
>> # Processor type and features
>> #
>> # CONFIG_ZONE_DMA is not set
>> # CONFIG_SMP is not set
>
> Yes, here is the deal.
>
> The SMP-version of __mod_node_page_state() converts a passed value from bytes
> to pages, but the non-SMP doesn't.
>
> Thanks!
>
>
> --
>
> From 3d0233b37340c78012b991d3570b92f91cf5ebd2 Mon Sep 17 00:00:00 2001
> From: Roman Gushchin <[email protected]>
> Date: Thu, 1 Oct 2020 13:07:49 -0700
> Subject: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration
>
> Since ea426c2a7de8 ("mm: memcg: prepare for byte-sized vmstat items")
> the write side of slab counters accepts a value in bytes and converts
> it to pages. It happens in __mod_node_page_state().
>
> However a non-SMP version of __mod_node_page_state() doesn't perform
> this conversion. It leads to incorrect (unrealistically high) slab
> counters values. Fix this by adding a similar conversion to the
> non-SMP version of __mod_node_page_state().
>
> Signed-off-by: Roman Gushchin <[email protected]>
> Reported-by: Bastian Bittorf <[email protected]>
> Fixes: ea426c2a7de8 ("mm: memcg: prepare for byte-sized vmstat items")

Acked-by: Vlastimil Babka <[email protected]>

For consistency we could also duplicate the
"VM_WARN_ON_ONCE(vmstat_item_in_bytes(item));" in !SMP variants of
__inc_node_state() and __dec_node_state(), but that's not urgent, and perhaps
SMP configs are enough to catch any bugs introduced in the future in this area...

> ---
> include/linux/vmstat.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
> index d5431c1bf6e5..322dcbfcc933 100644
> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -312,6 +312,11 @@ static inline void __mod_zone_page_state(struct zone *zone,
> static inline void __mod_node_page_state(struct pglist_data *pgdat,
> enum node_stat_item item, int delta)
> {
> + if (vmstat_item_in_bytes(item)) {
> + VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
> + delta >>= PAGE_SHIFT;
> + }
> +
> node_page_state_add(delta, pgdat, item);
> }
>
>

2020-10-02 17:57:02

by Roman Gushchin

[permalink] [raw]
Subject: Re: Linux 5.9-rc7 / VmallocTotal wrongly reported | Patch OK

On Fri, Oct 02, 2020 at 09:01:14AM +0200, Bastian Bittorf wrote:
> On Thu, Oct 01, 2020 at 01:39:31PM -0700, Roman Gushchin wrote:
> > > # Processor type and features
> > > #
> > > # CONFIG_ZONE_DMA is not set
> > > # CONFIG_SMP is not set
> >
> > Yes, here is the deal.
> >
> > The SMP-version of __mod_node_page_state() converts a passed value from bytes
> > to pages, but the non-SMP doesn't.
> >
> > Thanks!
> >
> > --
> >
> > From 3d0233b37340c78012b991d3570b92f91cf5ebd2 Mon Sep 17 00:00:00 2001
> > From: Roman Gushchin <[email protected]>
> > Date: Thu, 1 Oct 2020 13:07:49 -0700
> > Subject: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration
>
>
> I manually applied your patch and
> this fixes to issue on my side too:

Thank you for testing!

And sorry for the hassle.

Roman

2020-10-02 17:58:08

by Roman Gushchin

[permalink] [raw]
Subject: Re: [kbuild-all] Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

On Fri, Oct 02, 2020 at 01:34:06PM +0800, Philip Li wrote:
> On Thu, Oct 01, 2020 at 05:55:59PM -0700, Roman Gushchin wrote:
> > On Fri, Oct 02, 2020 at 08:08:40AM +0800, kbuild test robot wrote:
> > > Hi Roman,
> > >
> > > Thank you for the patch! Yet something to improve:
> > >
> > > [auto build test ERROR on mmotm/master]
> >
> > It's a bogus error, the patch was applied onto mmotm/master, which doesn't
> > contain necessary slab controller patches.
> sorry for the wrong report, and thanks for the input, we will check
> this to see whether we can find an appropriate base for this case.

I wonder if you can look at the "Fixes" tag if the patch contains one?

> Meanwhile, you can give a try to use --base option when git format patch, which
> helps us to have more clue when looking for base info.

Will do.

Thanks!

2020-10-02 21:45:16

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

Hi Roman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mmotm/master]

url: https://github.com/0day-ci/linux/commits/Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
base: git://git.cmpxchg.org/linux-mmotm.git master
config: x86_64-randconfig-a004-20201003 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bcd05599d0e53977a963799d6ee4f6e0bc21331b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/3e4248734433fea1624e4971258042af2f231e02
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Roman-Gushchin/mm-memcg-slab-fix-slab-statistics-in-SMP-configuration/20201002-044114
git checkout 3e4248734433fea1624e4971258042af2f231e02
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:20:
include/linux/mm.h:162:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 72:
^
include/linux/mm.h:162:2: note: insert '__attribute__((fallthrough));' to silence this warning
case 72:
^
__attribute__((fallthrough));
include/linux/mm.h:162:2: note: insert 'break;' to avoid fall-through
case 72:
^
break;
include/linux/mm.h:164:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 64:
^
include/linux/mm.h:164:2: note: insert '__attribute__((fallthrough));' to silence this warning
case 64:
^
__attribute__((fallthrough));
include/linux/mm.h:164:2: note: insert 'break;' to avoid fall-through
case 64:
^
break;
include/linux/mm.h:166:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 56:
^
include/linux/mm.h:166:2: note: insert '__attribute__((fallthrough));' to silence this warning
case 56:
^
__attribute__((fallthrough));
include/linux/mm.h:166:2: note: insert 'break;' to avoid fall-through
case 56:
^
break;
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:20:
In file included from include/linux/mm.h:1317:
>> include/linux/vmstat.h:295:6: error: implicit declaration of function 'vmstat_item_in_bytes' [-Werror,-Wimplicit-function-declaration]
if (vmstat_item_in_bytes(item)) {
^
3 warnings and 1 error generated.
make[2]: *** [scripts/Makefile.build:99: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1139: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:179: sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +/vmstat_item_in_bytes +295 include/linux/vmstat.h

291
292 static inline void __mod_node_page_state(struct pglist_data *pgdat,
293 enum node_stat_item item, int delta)
294 {
> 295 if (vmstat_item_in_bytes(item)) {
296 VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
297 delta >>= PAGE_SHIFT;
298 }
299
300 node_page_state_add(delta, pgdat, item);
301 }
302

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (4.29 kB)
.config.gz (28.34 kB)
Download all attachments

2020-10-13 11:13:04

by Philip Li

[permalink] [raw]
Subject: Re: [kbuild-all] Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

On Fri, Oct 02, 2020 at 10:55:06AM -0700, Roman Gushchin wrote:
> On Fri, Oct 02, 2020 at 01:34:06PM +0800, Philip Li wrote:
> > On Thu, Oct 01, 2020 at 05:55:59PM -0700, Roman Gushchin wrote:
> > > On Fri, Oct 02, 2020 at 08:08:40AM +0800, kbuild test robot wrote:
> > > > Hi Roman,
> > > >
> > > > Thank you for the patch! Yet something to improve:
> > > >
> > > > [auto build test ERROR on mmotm/master]
> > >
> > > It's a bogus error, the patch was applied onto mmotm/master, which doesn't
> > > contain necessary slab controller patches.
> > sorry for the wrong report, and thanks for the input, we will check
> > this to see whether we can find an appropriate base for this case.
>
> I wonder if you can look at the "Fixes" tag if the patch contains one?
Thanks for the advice. Yes, we have Fixes tag as part of hint for us
to analzye the possible base. For this case, "Fixes: ea426c2", the commit sha
is a little short than we expected, thus ignored. We have updated matching
rule now to handle such situation.

>
> > Meanwhile, you can give a try to use --base option when git format patch, which
> > helps us to have more clue when looking for base info.
>
> Will do.
>
> Thanks!

2020-10-13 11:17:02

by Roman Gushchin

[permalink] [raw]
Subject: Re: [kbuild-all] Re: [PATCH] mm: memcg/slab: fix slab statistics in !SMP configuration

On Tue, Oct 13, 2020 at 07:05:50AM +0800, Philip Li wrote:
> On Fri, Oct 02, 2020 at 10:55:06AM -0700, Roman Gushchin wrote:
> > On Fri, Oct 02, 2020 at 01:34:06PM +0800, Philip Li wrote:
> > > On Thu, Oct 01, 2020 at 05:55:59PM -0700, Roman Gushchin wrote:
> > > > On Fri, Oct 02, 2020 at 08:08:40AM +0800, kbuild test robot wrote:
> > > > > Hi Roman,
> > > > >
> > > > > Thank you for the patch! Yet something to improve:
> > > > >
> > > > > [auto build test ERROR on mmotm/master]
> > > >
> > > > It's a bogus error, the patch was applied onto mmotm/master, which doesn't
> > > > contain necessary slab controller patches.
> > > sorry for the wrong report, and thanks for the input, we will check
> > > this to see whether we can find an appropriate base for this case.
> >
> > I wonder if you can look at the "Fixes" tag if the patch contains one?
> Thanks for the advice. Yes, we have Fixes tag as part of hint for us
> to analzye the possible base. For this case, "Fixes: ea426c2", the commit sha
> is a little short than we expected, thus ignored. We have updated matching
> rule now to handle such situation.

Hm, but the patch contains the full 12 chars long sha?

Anyway, thank you for looking into it! It's really great to have
the kernel test robot working.

Thanks!