Re: [PATCH] mm/list_lru: replace spinlock with RCU in __list_lru_count_one

From: kbuild test robot
Date: Wed Mar 28 2018 - 04:00:51 EST


Hi Li,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc7]
[cannot apply to next-20180327]
[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/Li-RongQing/mm-list_lru-replace-spinlock-with-RCU-in-__list_lru_count_one/20180328-042620
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)
>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)
>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)
>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)
>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)
>> mm/list_lru.c:59:15: sparse: incompatible types in comparison expression (different address spaces)
mm/list_lru.c:61:24: sparse: incompatible types in comparison expression (different address spaces)

vim +59 mm/list_lru.c

51
52 static inline struct list_lru_one *
53 list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx)
54 {
55 struct list_lru_memcg *tmp;
56
57 WARN_ON_ONCE(!rcu_read_lock_held());
58
> 59 tmp = rcu_dereference(nlru->memcg_lrus);
60 if (tmp && idx >= 0)
61 return rcu_dereference(tmp->lru[idx]);
62
63 return &nlru->lru;
64 }
65

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation