Oh, it is not a OSv-specific problem.
It is because constructor function called before class initialization.
2020년 6월 2일 화요일 오후 11시 54분 26초 UTC+9, Wonsup Yoon 님의 말:
>
> I tested the dynamic_percpu and it seems mostly works fine.
>
> However, I found using dynamic_percpu in a constructor function
I tested the dynamic_percpu and it seems mostly works fine.
However, I found using dynamic_percpu in a constructor function leads to
general protection fault.
ex)
#include
#include
#include
#include
#include
#include
struct counter {
int x = 0;
void inc(){
x += 1;
}
int get(){
return
Great! OSV_ELF_MLOCK_OBJECT seems very useful.
Thanks.
2020년 5월 26일 화요일 오후 4시 25분 57초 UTC+9, Nadav Har'El 님의 말:
>
> On Tue, May 26, 2020 at 9:41 AM Wonsup Yoon > wrote:
>
>> Actually, I used preempt_lock to prevent data races.
>> If two concurrent threads in a core access same per-cpu variabl
On Tue, May 26, 2020 at 9:41 AM Wonsup Yoon wrote:
> 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.
>
This is true - if you have two threads in the same core that access the
same per-c
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.
example)
counter's initial value: 0
CPU 0
Thread AA_local = counter + 1 (A_local = 1)
Th
On Tue, May 26, 2020 at 4:22 AM Wonsup Yoon wrote:
> Thank you for the response.
>
> Yes, dynamic_percpu 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
Thank you for the response.
Yes, dynamic_percpu 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
On Sat, May 23, 2020 at 6:35 PM Wonsup Yoon wrote:
> Hi,
>
> I'm trying to use PERCPU macro in application or module.
>
Hi,
The PERCPU macro does not support this. What it does is to add information
about this variable in a special section of the executable (".percpu"),
then arch/x64/loader.ld
Hi,
I'm trying to use PERCPU macro in application or module.
I tried using cpu::notifier, but it seems a_init is not called.
class A {
public:
A() { printf("init: %p\n", this); }
void test() { printf("test: %d\n", x); }
int x = 123;
};
PERCPU(A *, a);
static sched::cpu::notifier a_init([]() { *