Re: [patch 10/19] preempt: Cleanup the macro maze a bit

2020-11-17 Thread Peter Zijlstra
On Mon, Nov 16, 2020 at 06:42:19PM +0100, Thomas Gleixner wrote: > On Mon, Nov 16 2020 at 13:17, Peter Zijlstra wrote: > > On Fri, Nov 13, 2020 at 03:02:17PM +0100, Thomas Gleixner wrote: > > > >> -#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK > >> \ > >> -

Re: [patch 10/19] preempt: Cleanup the macro maze a bit

2020-11-16 Thread Thomas Gleixner
On Mon, Nov 16 2020 at 13:17, Peter Zijlstra wrote: > On Fri, Nov 13, 2020 at 03:02:17PM +0100, Thomas Gleixner wrote: > >> -#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \ >> - | NMI_MASK)) >> +#define irq_count() (nmi_count() | hardirq_count() |

Re: [patch 10/19] preempt: Cleanup the macro maze a bit

2020-11-16 Thread Peter Zijlstra
On Fri, Nov 13, 2020 at 03:02:17PM +0100, Thomas Gleixner wrote: > -#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \ > - | NMI_MASK)) > +#define irq_count() (nmi_count() | hardirq_count() | softirq_count()) > +#define in_task()

[patch 10/19] preempt: Cleanup the macro maze a bit

2020-11-13 Thread Thomas Gleixner
Make the macro maze consistent and prepare it for adding the RT variant for BH accounting. - Use nmi_count() for the NMI portion of preempt count - Introduce in_hardirq() to make the naming consistent and non-ambiguos - Use the macros to create combined checks (e.g. in_task()) so the