tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 41d66f96d0f15a0a2ad6fa2208f6bac1a66cbd52 commit: 25506bd0b31e4e9d89dc293aba8f4c6e2110dccf [2547/2825] mm/mempolicy: implement the sysfs-based weighted_interleave interface config: loongarch-randconfig-r113-20240129 (https://download.01.org/0day-ci/archive/20240130/202401302054.sXdwijhd-lkp@xxxxxxxxx/config) compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240130/202401302054.sXdwijhd-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202401302054.sXdwijhd-lkp@xxxxxxxxx/ sparse warnings: (new ones prefixed by >>) mm/mempolicy.c:3094:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __rcu *table @@ got unsigned char * @@ mm/mempolicy.c:3094:15: sparse: expected unsigned char [noderef] [usertype] __rcu *table mm/mempolicy.c:3094:15: sparse: got unsigned char * mm/mempolicy.c:3123:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __rcu *new @@ got void * @@ mm/mempolicy.c:3123:13: sparse: expected unsigned char [noderef] [usertype] __rcu *new mm/mempolicy.c:3123:13: sparse: got void * mm/mempolicy.c:3128:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __rcu *old @@ got unsigned char * @@ mm/mempolicy.c:3128:13: sparse: expected unsigned char [noderef] [usertype] __rcu *old mm/mempolicy.c:3128:13: sparse: got unsigned char * >> mm/mempolicy.c:3131:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *__to @@ got unsigned char [noderef] [usertype] __rcu *new @@ mm/mempolicy.c:3131:17: sparse: expected void *__to mm/mempolicy.c:3131:17: sparse: got unsigned char [noderef] [usertype] __rcu *new >> mm/mempolicy.c:3131:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *__from @@ got unsigned char [noderef] [usertype] __rcu *old @@ mm/mempolicy.c:3131:17: sparse: expected void const *__from mm/mempolicy.c:3131:17: sparse: got unsigned char [noderef] [usertype] __rcu *old >> mm/mempolicy.c:3133:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *__s @@ got unsigned char [noderef] [usertype] __rcu *new @@ mm/mempolicy.c:3133:17: sparse: expected void *__s mm/mempolicy.c:3133:17: sparse: got unsigned char [noderef] [usertype] __rcu *new mm/mempolicy.c:3138:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *objp @@ got unsigned char [noderef] [usertype] __rcu *old @@ mm/mempolicy.c:3138:15: sparse: expected void const *objp mm/mempolicy.c:3138:15: sparse: got unsigned char [noderef] [usertype] __rcu *old mm/mempolicy.c:3234:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __rcu *old @@ got unsigned char * @@ mm/mempolicy.c:3234:13: sparse: expected unsigned char [noderef] [usertype] __rcu *old mm/mempolicy.c:3234:13: sparse: got unsigned char * mm/mempolicy.c:3239:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *objp @@ got unsigned char [noderef] [usertype] __rcu *old @@ mm/mempolicy.c:3239:15: sparse: expected void const *objp mm/mempolicy.c:3239:15: sparse: got unsigned char [noderef] [usertype] __rcu *old mm/mempolicy.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...): include/linux/rcupdate.h:781:9: sparse: sparse: context imbalance in 'queue_folios_pte_range' - unexpected unlock mm/mempolicy.c:3095:31: sparse: sparse: dereference of noderef expression mm/mempolicy.c:3134:12: sparse: sparse: dereference of noderef expression vim +3131 mm/mempolicy.c 3100 3101 static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, 3102 const char *buf, size_t count) 3103 { 3104 struct iw_node_attr *node_attr; 3105 u8 __rcu *new; 3106 u8 __rcu *old; 3107 u8 weight = 0; 3108 3109 node_attr = container_of(attr, struct iw_node_attr, kobj_attr); 3110 if (count == 0 || sysfs_streq(buf, "")) 3111 weight = 0; 3112 else if (kstrtou8(buf, 0, &weight)) 3113 return -EINVAL; 3114 3115 /* 3116 * The default weight is 1, for now. When the kernel-internal 3117 * default weight array is implemented, 0 will be a directive to 3118 * the allocators to use the system-default weight instead. 3119 */ 3120 if (!weight) 3121 weight = 1; 3122 3123 new = kmalloc(nr_node_ids, GFP_KERNEL); 3124 if (!new) 3125 return -ENOMEM; 3126 3127 mutex_lock(&iw_table_lock); 3128 old = rcu_dereference_protected(iw_table, 3129 lockdep_is_held(&iw_table_lock)); 3130 if (old) > 3131 memcpy(new, old, nr_node_ids); 3132 else > 3133 memset(new, 1, nr_node_ids); 3134 new[node_attr->nid] = weight; 3135 rcu_assign_pointer(iw_table, new); 3136 mutex_unlock(&iw_table_lock); 3137 synchronize_rcu(); 3138 kfree(old); 3139 return count; 3140 } 3141 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki