From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Question about tboot_wait_for_aps()
Date: Tue, 24 Jul 2012 08:58:53 -0700 [thread overview]
Message-ID: <20120724155853.GA32362@linux.vnet.ibm.com> (raw)
Hello!
While taking another pass through the CPU_DYING notifiers, I came upon
the following:
static int tboot_wait_for_aps(int num_aps)
{
unsigned long timeout;
timeout = AP_WAIT_TIMEOUT*HZ;
while (atomic_read((atomic_t *)&tboot->num_in_wfs) != num_aps &&
timeout) {
mdelay(1);
timeout--;
}
if (timeout)
pr_warning("tboot wait for APs timeout\n");
return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
}
Questions:
1. Why AP_WAIT_TIMEOUT*HZ? Given the mdelay(), shouldn't this
instead be AP_WAIT_TIMEOUT*1000? The definition of AP_WAIT_TIMEOUT
indicates that it is in seconds.
2. Who changes ->num_in_wfs? Any other CPUs are in stop_machine(),
plus I don't see any assignments to this field. Does the boot
firmware run again to make this change, sort of like SMIs?
I guess that the good news is that I don't seen anything that cares about
stop_machine(). ;-)
Thanx, Paul
reply other threads:[~2012-07-24 16:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20120724155853.GA32362@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).