lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17882dc4-3799-29f0-96ff-09a787f10bcd@virtuozzo.com>
Date:   Fri, 23 Mar 2018 14:26:04 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     kbuild test robot <lkp@...el.com>
Cc:     kbuild-all@...org, viro@...iv.linux.org.uk, hannes@...xchg.org,
        mhocko@...nel.org, vdavydov.dev@...il.com,
        akpm@...ux-foundation.org, tglx@...utronix.de,
        pombredanne@...b.com, stummala@...eaurora.org,
        gregkh@...uxfoundation.org, sfr@...b.auug.org.au, guro@...com,
        mka@...omium.org, penguin-kernel@...ove.SAKURA.ne.jp,
        chris@...is-wilson.co.uk, longman@...hat.com, minchan@...nel.org,
        hillf.zj@...baba-inc.com, ying.huang@...el.com,
        mgorman@...hsingularity.net, shakeelb@...gle.com, jbacik@...com,
        linux@...ck-us.net, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, willy@...radead.org
Subject: Re: [PATCH 03/10] mm: Assign memcg-aware shrinkers bitmap to memcg

On 23.03.2018 12:06, kbuild test robot wrote:
> Hi Kirill,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on mmotm/master]
> [also build test WARNING on v4.16-rc6 next-20180322]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Kirill-Tkhai/Improve-shrink_slab-scalability-old-complexity-was-O-n-2-new-is-O-n/20180323-052754
> base:   git://git.cmpxchg.org/linux-mmotm.git master
> reproduce:
>         # apt-get install sparse
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF=-D__CHECK_ENDIAN__
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:79:1: sparse: incorrect type in argument 3 (different base types) @@    expected unsigned long [unsigned] flags @@    got resunsigned long [unsigned] flags @@
>    include/trace/events/vmscan.h:79:1:    expected unsigned long [unsigned] flags
>    include/trace/events/vmscan.h:79:1:    got restricted gfp_t [usertype] gfp_flags
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:106:1: sparse: incorrect type in argument 3 (different base types) @@    expected unsigned long [unsigned] flags @@    got resunsigned long [unsigned] flags @@
>    include/trace/events/vmscan.h:106:1:    expected unsigned long [unsigned] flags
>    include/trace/events/vmscan.h:106:1:    got restricted gfp_t [usertype] gfp_flags
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: cast from restricted gfp_t
>    include/trace/events/vmscan.h:196:1: sparse: too many warnings
>>> mm/vmscan.c:231:15: sparse: incompatible types in conditional expression (different address spaces)
>>> mm/vmscan.c:231:15: sparse: cast from unknown type
>>> mm/vmscan.c:231:15: sparse: incompatible types in conditional expression (different address spaces)
>>> mm/vmscan.c:231:15: sparse: incompatible types in conditional expression (different address spaces)
>>> mm/vmscan.c:231:15: sparse: cast from unknown type
> 
> vim +231 mm/vmscan.c

Yeah, thanks for report.

> 
>    205	
>    206	static int memcg_expand_maps(struct mem_cgroup *memcg, int size, int old_size)
>    207	{
>    208		struct shrinkers_map *new, *old;
>    209		int i;
>    210	
>    211		new = kvmalloc(sizeof(*new) + nr_node_ids * sizeof(new->map[0]),
>    212				GFP_KERNEL);
>    213		if (!new)
>    214			return -ENOMEM;
>    215	
>    216		for (i = 0; i < nr_node_ids; i++) {
>    217			new->map[i] = kvmalloc_node(size, GFP_KERNEL, i);
>    218			if (!new->map[i]) {
>    219				while (--i >= 0)
>    220					kvfree(new->map[i]);
>    221				kvfree(new);
>    222				return -ENOMEM;
>    223			}
>    224	
>    225			/* Set all old bits, clear all new bits */
>    226			memset(new->map[i], (int)0xff, old_size);
>    227			memset((void *)new->map[i] + old_size, 0, size - old_size);
>    228		}
>    229	
>    230		lockdep_assert_held(&bitmap_rwsem);
>  > 231		old = rcu_dereference_protected(SHRINKERS_MAP(memcg), true);
>    232	
>    233		/*
>    234		 * We don't want to use rcu_read_lock() in shrink_slab().
>    235		 * Since expansion happens rare, we may just take the lock
>    236		 * here.
>    237		 */
>    238		if (old)
>    239			down_write(&shrinker_rwsem);
>    240	
>    241		if (memcg)
>    242			rcu_assign_pointer(memcg->shrinkers_map, new);
>    243		else
>    244			rcu_assign_pointer(root_shrinkers_map, new);
>    245	
>    246		if (old) {
>    247			up_write(&shrinker_rwsem);
>    248			call_rcu(&old->rcu, kvfree_map_rcu);
>    249		}
>    250	
>    251		return 0;
>    252	}
>    253	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ