Thread (42 messages) 42 messages, 9 authors, 2020-02-21

Re: [RFC patch 14/19] bpf: Use migrate_disable() in hashtab code

From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: 2020-02-19 15:17:33
Also in: bpf, lkml

----- On Feb 18, 2020, at 6:36 PM, Alexei Starovoitov alexei.starovoitov@gmail.com wrote:

[...]
If I can use migrate_disable() without RT it will help my work on sleepable
BPF programs. I would only have to worry about rcu_read_lock() since
preempt_disable() is nicely addressed.
Hi Alexei,

You may want to consider using SRCU rather than RCU if you need to sleep while
holding a RCU read-side lock.

This is the synchronization approach I consider for adding the ability to take page
faults when doing syscall tracing.

Then you'll be able to replace preempt_disable() by combining SRCU and
migrate_disable():

AFAIU eBPF currently uses preempt_disable() for two reasons:

- Ensure the thread is not migrated,
  -> can be replaced by migrate_disable() in RT
- Provide RCU existence guarantee through sched-RCU
  -> can be replaced by SRCU, which allows sleeping and taking page faults.

I wonder if it would be acceptable to take a page fault while migration is
disabled though ?

Thanks,

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help