Re: [PATCH 1/2] bcache: ignore pending signals in bcache_device_init()

Oleg Nesterov
2020-03-04T12:13:25Z

On 03/04, Michal Hocko wrote:
>
> So what would be a legit usecase to drop all signals while explicitly
> calling allow_signal?

Not sure I understand... Did you mean kthread should use kernel_dequeue
rather than flush?

Yes, they should do the same if kthread allows a single signal, iow if
it calls allow_signal() once.

But currently they differ.

1. flush_signal() is faster but we can optimize kernel_dequeue_signal().

2. kernel_dequeue_signal() does not necessarily clears TIF_SIGPENDING
and I think this needs some fixes. Probably klp_patch_pending() is
the only problem...

Oleg.