lkml.org 
[lkml]   [2018]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 05/30] softirq: Convert softirq_pending_set() to softirq_pending_nand()
    Date
    The vector pending bits will soon need to be opposed to the vector
    enabled bits. As such, plain reset of new pending mask is not going to
    be needed anymore. Instead we'll need to be able to clear specific bits.
    Update the relevant API to allow that.

    Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    ---
    arch/s390/include/asm/hardirq.h | 2 +-
    include/linux/interrupt.h | 3 ++-
    kernel/softirq.c | 2 +-
    3 files changed, 4 insertions(+), 3 deletions(-)

    diff --git a/arch/s390/include/asm/hardirq.h b/arch/s390/include/asm/hardirq.h
    index 3103680..84ad789 100644
    --- a/arch/s390/include/asm/hardirq.h
    +++ b/arch/s390/include/asm/hardirq.h
    @@ -14,7 +14,7 @@
    #include <asm/lowcore.h>

    #define local_softirq_pending() (S390_lowcore.softirq_data)
    -#define softirq_pending_set(x) (S390_lowcore.softirq_data = (x))
    +#define softirq_pending_nand(x) (S390_lowcore.softirq_data &= ~(x))
    #define softirq_pending_or(x) (S390_lowcore.softirq_data |= (x))

    #define __ARCH_IRQ_STAT
    diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
    index fc88f0d..a577a54 100644
    --- a/include/linux/interrupt.h
    +++ b/include/linux/interrupt.h
    @@ -466,6 +466,7 @@ enum
    };

    #define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ))
    +#define SOFTIRQ_ALL_MASK (BIT(NR_SOFTIRQS) - 1)

    #ifndef local_softirq_pending

    @@ -474,7 +475,7 @@ enum
    #endif

    #define local_softirq_pending() (__this_cpu_read(local_softirq_data_ref))
    -#define softirq_pending_set(x) (__this_cpu_write(local_softirq_data_ref, (x)))
    +#define softirq_pending_nand(x) (__this_cpu_and(local_softirq_data_ref, ~(x)))
    #define softirq_pending_or(x) (__this_cpu_or(local_softirq_data_ref, (x)))

    #endif /* local_softirq_pending */
    diff --git a/kernel/softirq.c b/kernel/softirq.c
    index c39af4a..288e007 100644
    --- a/kernel/softirq.c
    +++ b/kernel/softirq.c
    @@ -271,7 +271,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)

    restart:
    /* Reset the pending bitmask before enabling irqs */
    - softirq_pending_set(0);
    + softirq_pending_nand(SOFTIRQ_ALL_MASK);

    local_irq_enable();

    --
    2.7.4
    \
     
     \ /
      Last update: 2018-10-11 01:15    [W:4.804 / U:1.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site