簡體   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