Hi,I'm trying to use PERCPU macro in application or module.
Thank you for the response.Yes, dynamic_percpu<T> is perfect for my purpose.However, I encountered another issue.If I use dynamic_percpu with preempt-lock (I think it is very common pattern), it abort due to assertion failed.It seems lazy binding prevents preemption lock.So, I had to add -fno-plt option, and it works.
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/07f76c69-0448-4a97-b587-995f7dbafe58%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to osv...@googlegroups.com.
Actually, I used preempt_lock to prevent data races.If two concurrent threads in a core access same per-cpu variable, I think we still need preempt lock.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/6f9dd47a-4f7a-46a8-89c4-fcaf1909dcc8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/6f9dd47a-4f7a-46a8-89c4-fcaf1909dcc8%40googlegroups.com.
Cmdline: /hello
[registers]
RIP: 0x000010000000a8f8 <counter::inc()+12>
RFL: 0x0000000000010286 CS: 0x0000000000000008 SS: 0x0000000000000010
RAX: 0xffff7fffbf81b000 RBX: 0x0000000000000001 RCX: 0x0000000000000000 RDX: 0x0000000000000000
RSI: 0xffff7fffbf81b000 RDI: 0xffff7fffbf81b000 RBP: 0x0000200000200e70 R8: 0x0000000000000001
R9: 0x0000000000000000 R10: 0x000000000000000d R11: 0x0000000000000000 R12: 0xffffa000012bde00
R13: 0x0000000000000000 R14: 0x000000000000000d R15: 0x0000000000000000 RSP: 0x0000200000200e70
general protection fault
[backtrace]
0x00000000403a0e84 <general_protection+116>
0x000000004039e642 <???+1077536322>
0x000010000000a74f <???+42831>
0x000000004035546c <elf::object::run_init_funcs(int, char**)+268>
0x000000004035560a <elf::program::init_library(int, char**)+362>
0x0000000040224b7a <osv::application::main()+58>
0x000000004042a688 <???+1078109832>
0x0000000040462775 <???+1078339445>
0x00000000403faca6 <thread_main_c+38>
0x000000004039f602 <???+1077540354>