lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200212080220.GO14897@hirez.programming.kicks-ass.net>
Date:   Wed, 12 Feb 2020 09:02:20 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     rostedt <rostedt@...dmis.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        "Joel Fernandes, Google" <joel@...lfernandes.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        paulmck <paulmck@...nel.org>,
        Josh Triplett <josh@...htriplett.org>,
        Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: [PATCH v2] tracing/perf: Move rcu_irq_enter/exit_irqson() to
 perf trace point hook

On Tue, Feb 11, 2020 at 12:35:21PM -0500, Mathieu Desnoyers wrote:

> Minor nits:
> 
> Why not make these an enum ?
> 
> > +
> > +#define trace_rcu_enter()					\
> > +({								\
> > +	unsigned long state = 0;				\
> > +	if (!rcu_is_watching())	{				\
> > +		if (in_nmi()) {					\
> > +			state = __TR_NMI;			\
> > +			rcu_nmi_enter();			\
> > +		} else {					\
> > +			state = __TR_IRQ;			\
> > +			rcu_irq_enter_irqson();			\
> > +		}						\
> > +	}							\
> > +	state;							\
> > +})
> > +
> > +#define trace_rcu_exit(state)					\
> > +do {								\
> > +	switch (state) {					\
> > +	case __TR_IRQ:						\
> > +		rcu_irq_exit_irqson();				\
> > +		break;						\
> > +	case __IRQ_NMI:						\
> > +		rcu_nmi_exit();					\
> > +		break;						\
> > +	default:						\
> > +		break;						\
> > +	}							\
> > +} while (0)
> 
> And convert these into static inline functions ?

Probably the same reason the rest of the file is macros; header hell.

Now, I could probably make these inlines, but then I'd have to add more
RCU function declariations to this file (which is outside of
rcupdate.h). Do we want to do that?

The reason these were in this file is because I want to keep the comment
and implementation near to nmi_enter/exit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ