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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <481A2BF6.2070406@austin.ibm.com>
Date:	Thu, 01 May 2008 15:45:42 -0500
From:	Joel Schopp <jschopp@...tin.ibm.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: questions on calc_delta_mine() in sched.c

Ingo,

I have a few questions regarding  this code in kernel/sched.c

static unsigned long
calc_delta_mine(unsigned long delta_exec, unsigned long weight,
         struct load_weight *lw)
{
     u64 tmp;

     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?
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.
Q3) That division is pretty expensive, could we sacrifice some accuracy and 
do a precompute table?  Do you have another idea how we could get rid of 
the divide?

-Joel Schopp

--
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