All of lore.kernel.org
 help / color / mirror / Atom feed
From: nyushchenko@dev.rtsoft.ru (Nikita Yushchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case
Date: Sat, 28 Nov 2015 14:13:29 +0300	[thread overview]
Message-ID: <56598C59.4070307@dev.rtsoft.ru> (raw)
In-Reply-To: <20151124153305.GD8644@n2100.arm.linux.org.uk>

>> Not sure I understand logic behind this. With the current code,
>> resulting cpu_possible_mask depends on CONFIG_SMP_ON_UP:
>> - if it is set, cpu_possible_mask contains (0 1), as initialized in
>> arm_dt_init_cpu_maps()
>> - if it is not set, cpu_possible_mask contains (0), since
>> imx_smp_init_cpus() removes 1 from there.
> 
> Right, adding debug to arch/arm/kernel/setup.c, just before the
> "if (is_smp())" shows:
> 
> is_smp() 0 possible 3 present 1 online 1
> 
> which is totally wrong: if is_smp() is false, we should not be setting
> up any possible CPUs.  See a patch below to fix that.
> 
> However, this doesn't matter much, because the code in setup.c won't
> initialise the SMP operations struct ...

But cpu start code is not the only place in the kernel that uses cpu_present_mask.

Are you sure that running with invalid cpu_present_mask has no side effects?

> Here's the patch to fix the DT code, which should not be setting
> present CPUs when is_smp() is false.

I see that this fixes the issue as well.

But I still don't understand rationale behind all these is_smp() checks.
This makes init sequence different with and without CONFIG_SMP_ON_UP.
Isn't kernel intended to run ok without CONFIG_SMP_ON_UP?

And if yes - then why not run the same init sequence in both cases?

WARNING: multiple messages have this Message-ID (diff)
From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: kuznetsovg@dev.rtsoft.ru,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Mason <slash.tmp@free.fr>, Will Deacon <will.deacon@arm.com>,
	Paul Kocialkowski <contact@paulk.fr>,
	linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.m@jp.panasonic.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case
Date: Sat, 28 Nov 2015 14:13:29 +0300	[thread overview]
Message-ID: <56598C59.4070307@dev.rtsoft.ru> (raw)
In-Reply-To: <20151124153305.GD8644@n2100.arm.linux.org.uk>

>> Not sure I understand logic behind this. With the current code,
>> resulting cpu_possible_mask depends on CONFIG_SMP_ON_UP:
>> - if it is set, cpu_possible_mask contains (0 1), as initialized in
>> arm_dt_init_cpu_maps()
>> - if it is not set, cpu_possible_mask contains (0), since
>> imx_smp_init_cpus() removes 1 from there.
> 
> Right, adding debug to arch/arm/kernel/setup.c, just before the
> "if (is_smp())" shows:
> 
> is_smp() 0 possible 3 present 1 online 1
> 
> which is totally wrong: if is_smp() is false, we should not be setting
> up any possible CPUs.  See a patch below to fix that.
> 
> However, this doesn't matter much, because the code in setup.c won't
> initialise the SMP operations struct ...

But cpu start code is not the only place in the kernel that uses cpu_present_mask.

Are you sure that running with invalid cpu_present_mask has no side effects?

> Here's the patch to fix the DT code, which should not be setting
> present CPUs when is_smp() is false.

I see that this fixes the issue as well.

But I still don't understand rationale behind all these is_smp() checks.
This makes init sequence different with and without CONFIG_SMP_ON_UP.
Isn't kernel intended to run ok without CONFIG_SMP_ON_UP?

And if yes - then why not run the same init sequence in both cases?

  reply	other threads:[~2015-11-28 11:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 11:59 [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case nyushchenko at dev.rtsoft.ru
2015-11-23 11:59 ` nyushchenko
2015-11-23 12:03 ` Russell King - ARM Linux
2015-11-23 12:03   ` Russell King - ARM Linux
2015-11-23 12:06   ` Nikita Yushchenko
2015-11-23 12:06     ` Nikita Yushchenko
2015-11-23 12:12     ` Russell King - ARM Linux
2015-11-23 12:12       ` Russell King - ARM Linux
2015-11-23 12:19       ` Russell King - ARM Linux
2015-11-23 12:19         ` Russell King - ARM Linux
2015-11-23 12:46         ` Nikita Yushchenko
2015-11-23 12:46           ` Nikita Yushchenko
2015-11-23 12:32     ` Vladimir Murzin
2015-11-23 12:32       ` Vladimir Murzin
2015-11-23 12:42       ` Nikita Yushchenko
2015-11-23 12:42         ` Nikita Yushchenko
2015-11-23 12:47         ` Nikita Yushchenko
2015-11-23 12:47           ` Nikita Yushchenko
2015-11-23 13:04           ` Russell King - ARM Linux
2015-11-23 13:04             ` Russell King - ARM Linux
2015-11-24 14:52             ` Nikita Yushchenko
2015-11-24 14:52               ` Nikita Yushchenko
2015-11-24 15:05               ` Nikita Yushchenko
2015-11-24 15:05                 ` Nikita Yushchenko
2015-11-24 15:28                 ` Nikita Yushchenko
2015-11-24 15:28                   ` Nikita Yushchenko
2015-11-24 15:33               ` Russell King - ARM Linux
2015-11-24 15:33                 ` Russell King - ARM Linux
2015-11-28 11:13                 ` Nikita Yushchenko [this message]
2015-11-28 11:13                   ` Nikita Yushchenko
2015-11-30  8:25                   ` Nikita Yushchenko
2015-11-30  8:25                     ` Nikita Yushchenko

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=56598C59.4070307@dev.rtsoft.ru \
    --to=nyushchenko@dev.rtsoft.ru \
    --cc=linux-arm-kernel@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 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.