Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-05-19 Thread Giovanni Gherdovich
On Mon, 2020-05-18 at 15:20 -0700, Ricardo Neri wrote: > On Sat, May 02, 2020 at 04:25:00PM +0200, Giovanni Gherdovich wrote: > > > > > > I've changed the patch like so.. OK? > > > > > > (ok, perhaps I went a little overboard with the paranoia ;-) > > > > Right, I wasn't really checking for over

Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-05-18 Thread Ricardo Neri
On Sat, May 02, 2020 at 04:25:00PM +0200, Giovanni Gherdovich wrote: > > > > I've changed the patch like so.. OK? > > > > (ok, perhaps I went a little overboard with the paranoia ;-) > > Right, I wasn't really checking for overflow, only for when the product > "mcnt * arch_max_freq_ratio" become

Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-05-02 Thread Giovanni Gherdovich
On Fri, 2020-05-01 at 15:30 +0200, Peter Zijlstra wrote: > On Tue, Apr 28, 2020 at 03:24:49PM +0200, Giovanni Gherdovich wrote: > > The product mcnt * arch_max_freq_ratio could be zero if it overflows u64. > > > > For context, a large value for arch_max_freq_ratio would be 5000, > > corresponding

Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-05-01 Thread Peter Zijlstra
On Tue, Apr 28, 2020 at 03:24:49PM +0200, Giovanni Gherdovich wrote: > The product mcnt * arch_max_freq_ratio could be zero if it overflows u64. > > For context, a large value for arch_max_freq_ratio would be 5000, > corresponding to a turbo_freq/base_freq ratio of 5 (normally it's more like > 150

Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-04-29 Thread Rafael J. Wysocki
On Tue, Apr 28, 2020 at 3:25 PM Giovanni Gherdovich wrote: > > The product mcnt * arch_max_freq_ratio could be zero if it overflows u64. > > For context, a large value for arch_max_freq_ratio would be 5000, > corresponding to a turbo_freq/base_freq ratio of 5 (normally it's more like > 1500-2000).

[PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

2020-04-28 Thread Giovanni Gherdovich
The product mcnt * arch_max_freq_ratio could be zero if it overflows u64. For context, a large value for arch_max_freq_ratio would be 5000, corresponding to a turbo_freq/base_freq ratio of 5 (normally it's more like 1500-2000). A large increment frequency for the MPERF counter would be 5GHz (the b