lkml.org 
[lkml]   [2020]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 10/19] preempt: Cleanup the macro maze a bit
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() (!(in_nmi() | in_hardirq() | in_serving_softirq()))
> -#define in_task() (!(preempt_count() & \
> - (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))

How horrible is the code-gen? Because preempt_count() is
raw_cpu_read_4() and at least some old compilers will refuse to CSE it
(consider the this_cpu_read_stable mess).

\
 
 \ /
  Last update: 2020-11-16 13:20    [W:0.205 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site