On Fri, Dec 04, 2020 at 06:01:55PM +0100, Thomas Gleixner wrote:
> +void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
> +{
> +     unsigned long flags;
> +     int newcnt;
> +
> +     WARN_ON_ONCE(in_hardirq());
> +
> +     /* First entry of a task into a BH disabled section? */
> +     if (!current->softirq_disable_cnt) {
> +             if (preemptible()) {

This reminds me of that migrate_disable() thing that didn't work, and
has similar problems.

        preempt_disable();
        local_bh_disable();
        preempt_enable();
        spin_lock(&foo);

is valid (albeit daft) code that will now malfunction.

> +                     local_lock(&softirq_ctrl.lock);


Reply via email to