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]
Date:	Wed, 21 Apr 2010 22:24:21 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Don Zickus <dzickus@...hat.com>
Cc:	mingo@...e.hu, peterz@...radead.org, gorcunov@...il.com,
	aris@...hat.com, linux-kernel@...r.kernel.org,
	randy.dunlap@...cle.com
Subject: Re: [PATCH 1/6] [watchdog] combine nmi_watchdog and softlockup

On Wed, Apr 21, 2010 at 01:50:21PM -0400, Don Zickus wrote:
> On Wed, Apr 21, 2010 at 07:27:33PM +0200, Frederic Weisbecker wrote:
> > Some minor things:
> > 
> > 
> > On Tue, Apr 20, 2010 at 11:23:58AM -0400, Don Zickus wrote:
> > > +#ifdef CONFIG_PERF_EVENTS_NMI
> > > +struct perf_event_attr wd_hw_attr = {
> > > +	.type		= PERF_TYPE_HARDWARE,
> > > +	.config		= PERF_COUNT_HW_CPU_CYCLES,
> > > +	.size		= sizeof(struct perf_event_attr),
> > > +	.pinned		= 1,
> > > +	.disabled	= 1,
> > > +};
> > 
> > 
> > 
> > Shouldn't it be static?
> 
> yes.  thanks.
> 
> > 
> > 
> > > +
> > > +/* Callback function for perf event subsystem */
> > > +void watchdog_overflow_callback(struct perf_event *event, int nmi,
> > > +		 struct perf_sample_data *data,
> > > +		 struct pt_regs *regs)
> > > +{
> > > +	int this_cpu = smp_processor_id();
> > > +	unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu);
> > > +	char warn = per_cpu(watchdog_warn, this_cpu);
> > 
> > 
> > 
> > You can use __get_cpu_var() here
> 
> well, I already have this_cpu and need it later, I figured I would just
> use it with per_cpu and save _get_cpu_var the work of re-running
> smp_processor_id().



This is more about code clarity in fact. per_cpu() suggests we are
fetching something from another cpu.

This is a very minor issue though.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ