All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 30 Nov 2015 11:25:15 +0300	[thread overview]
Message-ID: <565C07EB.1060306@dev.rtsoft.ru> (raw)
In-Reply-To: <56598C59.4070307@dev.rtsoft.ru>

28.11.2015 14:13, Nikita Yushchenko пишет:
>>> 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?

At least LTP suite does not like it:
while running /opt/ltp/runtest/cpuhotplug, we see things like the above

<<<test_start>>>
tag=cpuhotplug02 stime=1446628761
cmdline="cpuhotplug02.sh -c 1 -l 1"
contacts=""
analysis=exit
<<<test_output>>>
Name:   cpuhotplug02
Date:   Wed Nov  4 09:19:21 UTC 2015
Desc:   What happens to a process when its CPU is offlined?

CPU is 1
/opt/ltp/testcases/bin/cpuhotplug_hotplug.sh: line 76: echo: write error:
Function not implemented
cpuhotplug02 1 TBROK : CPU1 cannot be onlined
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=2 corefile=no
cutime=4 cstime=6
<<<test_end>>>


WARNING: multiple messages have this Message-ID (diff)
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: Mon, 30 Nov 2015 11:25:15 +0300	[thread overview]
Message-ID: <565C07EB.1060306@dev.rtsoft.ru> (raw)
In-Reply-To: <56598C59.4070307@dev.rtsoft.ru>

28.11.2015 14:13, Nikita Yushchenko ?????:
>>> 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?

At least LTP suite does not like it:
while running /opt/ltp/runtest/cpuhotplug, we see things like the above

<<<test_start>>>
tag=cpuhotplug02 stime=1446628761
cmdline="cpuhotplug02.sh -c 1 -l 1"
contacts=""
analysis=exit
<<<test_output>>>
Name:   cpuhotplug02
Date:   Wed Nov  4 09:19:21 UTC 2015
Desc:   What happens to a process when its CPU is offlined?

CPU is 1
/opt/ltp/testcases/bin/cpuhotplug_hotplug.sh: line 76: echo: write error:
Function not implemented
cpuhotplug02 1 TBROK : CPU1 cannot be onlined
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=2 corefile=no
cutime=4 cstime=6
<<<test_end>>>

  reply	other threads:[~2015-11-30  8:25 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
2015-11-23 11:59 ` nyushchenko at dev.rtsoft.ru
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
2015-11-28 11:13                   ` Nikita Yushchenko
2015-11-30  8:25                   ` Nikita Yushchenko [this message]
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=565C07EB.1060306@dev.rtsoft.ru \
    --to=nyushchenko@dev.rtsoft.ru \
    --cc=ard.biesheuvel@linaro.org \
    --cc=contact@paulk.fr \
    --cc=ian.campbell@citrix.com \
    --cc=kuznetsovg@dev.rtsoft.ru \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pavel@ucw.cz \
    --cc=slash.tmp@free.fr \
    --cc=vladimir.murzin@arm.com \
    --cc=will.deacon@arm.com \
    --cc=yamada.m@jp.panasonic.com \
    /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.