lkml.org 
[lkml]   [2020]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/6] arm64: perf: Implement correct cap_user_time
Hi Peter,

On Wed, Jul 15, 2020 at 10:38:00AM +0200, Peter Zijlstra wrote:
> On Wed, Jul 15, 2020 at 10:05:08AM +0800, Leo Yan wrote:
>
> > [leoyan: Use quot/rem to convert cyc to ns to avoid overflow]
>
> > + quot = rd->epoch_cyc >> rd->shift;
> > + rem = rd->epoch_cyc & (((u64)1 << rd->shift) - 1);
> > + ns = quot * rd->mult + ((rem * rd->mult) >> rd->shift);
> > + userpg->time_zero -= ns;
>
> I think we have mul_u64_u32_shr() for that.

Will fix it in next spin.

Thanks for suggestion,
Leo

\
 
 \ /
  Last update: 2020-07-15 17:41    [W:0.930 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site