Re: [request for stable inclusion][3.10.x] patches to avoid interrupt storm when perf sampling is too slow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 27, 2014 at 10:00:12AM +0800, Weng Meiling wrote:
> 
> Hi Dave, Stephane, Knut, Peter or Will,
> 
> 14c63f17b1fde5a575a28e96547a22b451c71fb5
> perf: Drop sample rate when sampling is too slow
> 
> e5302920da9ef23f9d19d4e9ac85704cc25bee7a
> perf: Fix interrupt handler timing harness
> 
> 723478c8a471403c53cf144999701f6e0c4bbd11
> perf: Enforce 1 as lower limit for perf_event_max_sample_rate
> 
> 5f5092e72cc25a6a5785308270e0085b2b2772cc
> ARM: perf: hook up perf_sample_event_took around pmu irq
> 
> These patches look applicable to stable-3.10, these patches prevent
> an interrupt storm when perf sampling is too slow on x86 and arm,
> an interrupt storm may trigger softlockup.
> 
> Patch e5302920da9e and 723478c8a471 are bug fix for 14c63f17b1fd. The
> last one patch can't be applied directly, I've adjusted the context manually.
>

Thank you, I'm queuing this last patch for the 3.11 kernel as well
(all the others were already present).

Cheers,
--
Luís

> Now they were built successful for me. What do you think?
> 
> the statistics of these patches:
>  Documentation/sysctl/kernel.txt  | 26 +++++++++++
>  arch/arm/kernel/perf_event.c     | 11 ++++-
>  arch/x86/kernel/cpu/perf_event.c | 12 ++++-
>  include/linux/perf_event.h       |  7 +++
>  kernel/events/core.c             | 94 +++++++++++++++++++++++++++++++++++++---
>  kernel/sysctl.c                  | 10 +++++
>  6 files changed, 152 insertions(+), 8 deletions(-)
> 
> 
> A detailed discussion can see the following link:
> http://www.gossamer-threads.com/lists/linux/kernel/1839307?do=post_view_threaded#1839307
> 
> --------------------------------------------------------
> 
> From: Will Deacon <will.deacon@xxxxxxx>
> Subject: [PATCH] ARM: perf: hook up perf_sample_event_took around pmu irq handling
> 
> commit 5f5092e72cc25a6a5785308270e0085b2b2772cc upstream.
> 
> Since we indirect all of our PMU IRQ handling through a dispatcher, it's
> trivial to hook up perf_sample_event_took to prevent applications such
> as oprofile from generating interrupt storms due to an unrealisticly
> low sample period.
> 
> Reported-by: Robert Richter <rric@xxxxxxxxxx>
> Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
> [wml: Backported to 3.10: context adjust ]
> Signed-off-by: Weng Meiling <wengmeiling.weng@xxxxxxxxxx>
> ---
>  arch/arm/kernel/perf_event.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index e19edc6..ace0ce8 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -303,11 +303,18 @@ static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
>  	struct arm_pmu *armpmu = (struct arm_pmu *) dev;
>  	struct platform_device *plat_device = armpmu->plat_device;
>  	struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev);
> +	int ret;
> +	u64 start_clock, finish_clock;
> 
> +	start_clock = sched_clock();
>  	if (plat && plat->handle_irq)
> -		return plat->handle_irq(irq, dev, armpmu->handle_irq);
> +		ret = plat->handle_irq(irq, dev, armpmu->handle_irq);
>  	else
> -		return armpmu->handle_irq(irq, dev);
> +		ret = armpmu->handle_irq(irq, dev);
> +	finish_clock = sched_clock();
> +
> +	perf_sample_event_took(finish_clock - start_clock);
> +	return ret;
>  }
> 
>  static void
> -- 
> 1.8.2.2
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]