From: "Yang Honggang(Joseph)" <ganggexiongqi@gmail.com>
To: johnstul@us.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: clocksource.c "margin"
Date: Wed, 30 Nov 2011 19:09:50 -0500 [thread overview]
Message-ID: <4ED6C5CE.2030105@gmail.com> (raw)
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
next reply other threads:[~2011-11-30 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 0:09 Yang Honggang(Joseph) [this message]
2011-11-30 18:43 ` clocksource.c "margin" John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ED6C5CE.2030105@gmail.com \
--to=ganggexiongqi@gmail.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.