[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160121152412.GB16294@hr-amur2>
Date: Thu, 21 Jan 2016 23:24:14 +0800
From: Huang Rui <ray.huang@....com>
To: Peter Zijlstra <peterz@...radead.org>
CC: Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
"Andy Lutomirski" <luto@...capital.net>,
Thomas Gleixner <tglx@...utronix.de>,
Robert Richter <rric@...nel.org>,
Jacob Shin <jacob.w.shin@...il.com>,
"John Stultz" <john.stultz@...aro.org>,
Fr�d�ric Weisbecker <fweisbec@...il.com>,
<linux-kernel@...r.kernel.org>, <spg_linux_kernel@....com>,
<x86@...nel.org>, Guenter Roeck <linux@...ck-us.net>,
Andreas Herrmann <herrmann.der.user@...glemail.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
Borislav Petkov <bp@...en8.de>,
"Fengguang Wu" <fengguang.wu@...el.com>,
Aaron Lu <aaron.lu@...el.com>
Subject: Re: [PATCH v2 5/5] perf/x86/amd/power: Add AMD accumulated power
reporting mechanism
On Thu, Jan 21, 2016 at 04:10:40PM +0100, Peter Zijlstra wrote:
> On Thu, Jan 21, 2016 at 10:42:35PM +0800, Huang Rui wrote:
> > > > @@ -164,14 +171,14 @@ static int pmu_event_add(struct perf_event *event, int mode)
> > > > struct hw_perf_event *hwc = &event->hw;
> > > > unsigned long flags;
> > > >
> > > > - spin_lock_irqsave(&pmu->lock, flags);
> > > > + raw_spin_lock_irqsave(&pmu->lock, flags);
> > > >
> > > > hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
> > > >
> > > > if (mode & PERF_EF_START)
> > > > __pmu_event_start(pmu, event);
> > > >
> > > > - spin_unlock_irqrestore(&pmu->lock, flags);
> > > > + raw_spin_unlock_irqrestore(&pmu->lock, flags);
> > > >
> > > > return 0;
> > > > }
> > >
> > > So for these 4 {start,stop,add,del} you can drop the irqsave/irqrestore
> > > thing as its guaranteed that IRQs will be disabled.
> > >
> >
> > OK, I will remove the lock.
>
> No, the lock seems needed, as the list is global. Just the
> irqsave/irqrestore part is superfluous.
>
But actually, the lock is only used at {start,stop,add,del}. If we
drop irqsave/irqrestore on these 4 things, there won't be any use
cases.
Thanks,
Rui
Powered by blists - more mailing lists