login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
26
Re: [PATCH] perf: fix possible divide-by-zero in perf_swevent_overflow()
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [PATCH] perf: fix possible divide-by-zero in perf_swevent_overflow()
Date: Thursday, August 26, 2010 - 5:12 am
On Thu, 2010-08-26 at 20:07 +0800, Dongdong Deng wrote:
quoted text
> The event->hw.last_period is possible to zero, thus it will > cause divide_by_zero later in perf_swevent_set_period().
How can it be zero?
quoted text
> This patch checks event->hw.last_period before invoke > perf_swevent_set_period() and replaces "event->hw" with "hwc". > > Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> > Cc: Frederic Weisbecker <fweisbec@gmail.com> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > Cc: Paul Mackerras <paulus@samba.org> > --- > kernel/perf_event.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/perf_event.c b/kernel/perf_event.c > index 403d180..ccba741 100644 > --- a/kernel/perf_event.c > +++ b/kernel/perf_event.c > @@ -4050,8 +4050,8 @@ static void perf_swevent_overflow(struct perf_event *event, u64 overflow, > struct hw_perf_event *hwc = &event->hw; > int throttle = 0; > > - data->period = event->hw.last_period; > - if (!overflow) > + data->period = hwc->last_period; > + if (!overflow && hwc->last_period) > overflow = perf_swevent_set_period(event); > > if (hwc->interrupts == MAX_INTERRUPTS)
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] perf: fix possible divide-by-zero in perf_swevent_ ...
, Dongdong Deng
, (Thu Aug 26, 5:07 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, Peter Zijlstra
, (Thu Aug 26, 5:12 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, DDD
, (Thu Aug 26, 5:36 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, Peter Zijlstra
, (Thu Aug 26, 5:58 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, DDD
, (Fri Aug 27, 5:21 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, Peter Zijlstra
, (Fri Aug 27, 5:50 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, DDD
, (Fri Aug 27, 6:19 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, Frederic Weisbecker
, (Fri Aug 27, 6:37 am)
Re: [PATCH] perf: fix possible divide-by-zero in perf_swev ...
, DDD
, (Sun Oct 24, 10:58 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Re: [PATCH 1/1] staging: hv: Fix race condition on IC channel initialization (modi...
Brian Swetland
Re: Attempted summary of suspend-blockers LKML thread
Sam Ravnborg
[PATCH 05/11] x86: add X86_64 dependency to x86_64 specific symbols in Kconfig.x86...
Christoph Lameter
Re: [PATCH 02/40] mm: slab allocation fairness
Alexey Dobriyan
Re: [2.6.22.2 review 09/84] Fix rfkill IRQ flags.
git
:
Felipe Contreras
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Paolo Ciarrocchi
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Peter Oberndorfer
Subject: [PATCH] fix stg edit command
Sverre Rabbelier
Re: [GSoC] What is status of Git's Google Summer of Code 2008 projects?
linux-netdev
:
Andi Kleen
Re: RFC: Nagle latency tuning
Badalian Vyacheslav
Re: tc filter flow hash question
Jarek Poplawski
Re: tc filter flow hash question
David Miller
Re: [RFC 0/5] generic rx recycling
Chuck Lever
Re: [RFC] ipv6: Change %pI6 format to output compacted addresses?
git-commits-head
:
Linux Kernel Mailing List
New device ID for sc92031 [1088:2031]
Linux Kernel Mailing List
e1000e: Expose MDI-X status via ethtool change
Linux Kernel Mailing List
NFS: Store pages from an NFS inode into a local cache
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constant
openbsd-misc
:
Theo de Raadt
Re: RES: OpenBSD on IBM System X3550 7879
Bret S. Lambert
Re: any web management gui for pf ?
Rob Shepherd
x86 hardware for router system
Leif Blixt
Re: Force passwordcheck in login.conf
Nick Holland
Re: Install OpenBSD from USB ?
Colocation donated by:
Syndicate