Re: [????] Re: divide error in x86 and cputime

From: David Laight
Date: Sun Jan 04 2026 - 17:03:34 EST


On Sun, 4 Jan 2026 21:30:39 +0100
Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> On 01/04, David Laight wrote:
> >
> > On Sun, 4 Jan 2026 15:23:19 +0100
> > Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >
> > > Peter, Ingo,
> > >
> > > can you take
> > >
> > > [PATCH v3 0/2] x86/math64: handle #DE in mul_u64_u64_div_u64()
> > > https://lore.kernel.org/all/20250815164009.GA11676@xxxxxxxxxx/
> > >
> > > ? at least 1/2 which fixes the problem with #DE ...
> >
>
> ...
>
> > But this code needs a completely different fix.
>
> Of course, this is clear. The fix above doesn't even try to address the
> problems in cputime_adjust() paths.
>
> But. To me the fix above makes sense regardless. mul_u64_u64_div_u64()
> should nevet trigger #DE, and I thought that we already discussed this
> before.
>
> Do you agree?

Yes, I think both the generic and x86 versions should just return ~0ull
for both overflow and divide by zero.

David

>
> Oleg.
>