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-next>] [day] [month] [year] [list]
Message-ID: <4ED6C5CE.2030105@gmail.com>
Date:	Wed, 30 Nov 2011 19:09:50 -0500
From:	"Yang Honggang(Joseph)" <ganggexiongqi@...il.com>
To:	johnstul@...ibm.com
CC:	linux-kernel@...r.kernel.org
Subject: clocksource.c "margin"

Hi John Stultz,
I'm very sorry to trouble you. A problem puzzled me when I reading your 
code in kernel/time/clocksource.c.
In the following functions, your said in the comments that >>5 was used 
to leave a margin of 12.5%.
I don't know how to get the result. I think is should be >> 3 in order 
to leave a margin of 12.5%.
The operation of >> 5 only left 3.125% margin.

__clocksource_updatefreq_scale
...
sec = (cs->mask - (cs->mask >> 5));
...
clocksource_max_deferment
...
     /*
      * To ensure that the clocksource does not wrap whilst we are idle,
      * limit the time the clocksource can be deferred by 12.5%. Please
      * note a margin of 12.5% is used because this can be computed with
      * a shift, versus say 10% which would require division.
      */
     return max_nsecs - (max_nsecs >> 5);
...

Best regards,
Joseph
--
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