lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 02 May 2008 15:30:39 -0500
From:	Joel Schopp <jschopp@...tin.ibm.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC:	Ingo Molnar <mingo@...e.hu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Anton Blanchard <anton@....ibm.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: questions on calc_delta_mine() in sched.c

>>      if (unlikely(!lw->inv_weight))
>>          lw->inv_weight = (WMULT_CONST-lw->weight/2) / (lw->weight+1);
>>
>>
>> Q1) This code is hit often in scenarios I run, is this really unlikely for 
>> others?
> 
> I think it became a lot more likely recently, perhaps removing that
> unlikely is not such a bad idea.

Especially if you remove the divide in the other locations, then this might 
even be likely.

> 
>> Q2) The rest of the code in sched.c seems to make inv_weight == 
>> WMULT_CONST/weight and I was wondering if you could explain why this 
>> instance is different.
> 
> because the rest of the code is wrong, there are only 2 other sites, and
> I have a patch that removes those div64_64() with =0;
> 
> The idea is to use rounding division: (x + y/2) / y
> but we can't because 'x' is touching the limits of our modulo space,
> hence we do: (x - y/2) / y
> which comes in 1 short, that fixup has been lost along the way.

Ah, that makes more sense, and the fact that it is broken explains why I 
couldn't figure it out.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ