From: Christoph Hellwig <hch@infradead.org>
To: Andreas Schwab <schwab@suse.de>
Cc: linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3] riscv: don't stop itself in smp_send_stop
Date: Mon, 17 Dec 2018 10:36:19 -0800 [thread overview]
Message-ID: <20181217183619.GA23353@infradead.org> (raw)
In-Reply-To: <mvm7eg85vsj.fsf@suse.de>
> 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?
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2018-12-17 18:36 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 [this message]
2018-12-18 8:50 ` Andreas Schwab
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=20181217183619.GA23353@infradead.org \
--to=hch@infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=schwab@suse.de \
/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