繁体   English   中英

gcc显示“需要原子大小的存储/加载以实现原子性”,用于调用`hlist_nulls_add_head_rcu`

[英]gcc show “Need native word sized stores/loads for atomicity” for calling `hlist_nulls_add_head_rcu`

我想致电hlist_nulls_add_head_rcu来管理我的列表,但是gcc给出了许多错误消息,如下所示:

|| ./include/linux/rculist_nulls.h: In function ‘hlist_nulls_add_head_rcu’:
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|518 col 38| error: call to ‘__compiletime_assert_97’ declared with attribute error: Need native word sized stores/loads for atomicity.
||   _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
||                                       ^
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|501 col 4| note: in definition of macro ‘__compiletime_assert’
||     prefix ## suffix();    \
||     ^~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|518 col 2| note: in expansion of macro ‘_compiletime_assert’
||   _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
||   ^~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/compiler.h|521 col 2| note: in expansion of macro ‘compiletime_assert’
||   compiletime_assert(__native_word(t),    \
||   ^~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./arch/x86/include/asm/barrier.h|92 col 2| note: in expansion of macro ‘compiletime_assert_atomic_type’
||   compiletime_assert_atomic_type(*p);    \
||   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/asm-generic/barrier.h|157 col 33| note: in expansion of macro ‘__smp_store_release’
||  #define smp_store_release(p, v) __smp_store_release(p, v)
||                                  ^~~~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/rcupdate.h|672 col 3| note: in expansion of macro ‘smp_store_release’
||    smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
||    ^~~~~~~~~~~~~~~~~
/home/river/Desktop/kernel/linux-4.9.82/./include/linux/rculist_nulls.h|97 col 2| note: in expansion of macro ‘rcu_assign_pointer’
||   rcu_assign_pointer(hlist_nulls_first_rcu(h), n);
||   ^~~~~~~~~~~~~~~~~~

我认为最有用的信息是第一个:

/include/linux/compiler.h|518 col 38| error: call to ‘__compiletime_assert_97’ declared with attribute error: Need native word sized stores/loads for atomicity.

然后在我的模块中调用hlist_nulls_add_head_rcu句子是:

hlist_nulls_add_head_rcu( &kcnew->hnnode,
        &kp_sock_lists[kp_hash(kcnew->sock)] );

参数类型正确,因此调用方式可能是错误的。 有谁知道如何使用hlist_nulls_add_head_rcu吗?

删除ccflags -y的'-O0'RCU的编译需要编译优化。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM