Thread (55 messages) flat view 55 messages, 6 authors, 2021-01-28

Re: Re: [RFC v3 01/11] eventfd: track eventfd_signal() recursion depth separately in different cases

From: Yongji Xie <hidden>
Date: 2021-01-20 06:54:32
Also in: kvm, linux-fsdevel

On Wed, Jan 20, 2021 at 12:24 PM Jason Wang [off-list ref] wrote:

On 2021/1/19 下午12:59, Xie Yongji wrote:
quoted
Now we have a global percpu counter to limit the recursion depth
of eventfd_signal(). This can avoid deadlock or stack overflow.
But in stack overflow case, it should be OK to increase the
recursion depth if needed. So we add a percpu counter in eventfd_ctx
to limit the recursion depth for deadlock case. Then it could be
fine to increase the global percpu counter later.

I wonder whether or not it's worth to introduce percpu for each eventfd.

How about simply check if eventfd_signal_count() is greater than 2?
It can't avoid deadlock in this way. So we need a percpu counter for
each eventfd to limit the recursion depth for deadlock cases. And
using a global percpu counter to avoid stack overflow.

Thanks,
Yongji
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help