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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1771156780.158.1581520460744.JavaMail.zimbra@efficios.com>
Date:   Wed, 12 Feb 2020 10:14:20 -0500 (EST)
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Peter Zijlstra <peterz@...radead.org>
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 Feb 12, 2020, at 3:02 AM, Peter Zijlstra peterz@...radead.org wrote:

> 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?

Probably not :) I was just wondering why.

Thanks,

Mathieu

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

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ