From: Andreas Schwab <schwab@suse.de>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3] riscv: don't stop itself in smp_send_stop
Date: Tue, 18 Dec 2018 09:50:49 +0100 [thread overview]
Message-ID: <mvmimzr43rq.fsf@suse.de> (raw)
In-Reply-To: <20181217183619.GA23353@infradead.org> (Christoph Hellwig's message of "Mon, 17 Dec 2018 10:36:19 -0800")
On Dez 17 2018, Christoph Hellwig <hch@infradead.org> wrote:
>> void smp_send_stop(void)
>> {
>> - on_each_cpu(ipi_stop, NULL, 1);
>> + unsigned long timeout;
>> +
>> + if (num_online_cpus() > 1) {
>> + cpumask_t mask;
>> +
>> + cpumask_copy(&mask, cpu_online_mask);
>> + cpumask_clear_cpu(smp_processor_id(), &mask);
>> +
>> + if (system_state <= SYSTEM_RUNNING)
>> + pr_crit("SMP: stopping secondary CPUs\n");
>> + send_ipi_message(&mask, IPI_CPU_STOP);
>> + }
>> +
>> + /* Wait up to one second for other CPUs to stop */
>> + timeout = USEC_PER_SEC;
>> + while (num_online_cpus() > 1 && timeout--)
>> + udelay(1);
>> +
>> + if (num_online_cpus() > 1)
>> + pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
>> + cpumask_pr_args(cpu_online_mask));
>
> Given that this function doesn't mark the current CPU as not offline
> it seems we could just exit early for num_online_cpus() == 1?
So much for copying existing implementations.
The only difference it would make is two less calls to num_online_cpus
on a single cpu system. Hardly worth it, IMHO.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2018-12-18 8:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-17 9:47 [PATCH v3] riscv: don't stop itself in smp_send_stop Andreas Schwab
2018-12-17 18:36 ` Christoph Hellwig
2018-12-18 8:50 ` Andreas Schwab [this message]
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=mvmimzr43rq.fsf@suse.de \
--to=schwab@suse.de \
--cc=hch@infradead.org \
--cc=linux-riscv@lists.infradead.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).