linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Atish Patra <atish.patra@wdc.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>,
	Andreas Schwab <schwab@suse.de>, Anup Patel <anup@brainfault.org>,
	Dmitriy Cherkasov <dmitriy@oss-tech.org>,
	Johan Hovold <johan@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Palmer Dabbelt <palmer@sifive.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Anup Patel <Anup.Patel@wdc.com>
Subject: Re: [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option.
Date: Tue, 19 Mar 2019 18:29:23 -0700	[thread overview]
Message-ID: <17dc2df7-a730-1461-2577-1a05ec27d32d@wdc.com> (raw)
In-Reply-To: <BYAPR04MB58168FE99AA058FB79A0650EE7400@BYAPR04MB5816.namprd04.prod.outlook.com>

On 3/19/19 4:58 PM, Damien Le Moal wrote:
> On 2019/03/20 8:56, Damien Le Moal wrote:
>> On 2019/03/20 7:20, Atish Patra wrote:
>>> If nr_cpus command line option is set, maximum possible cpu should be
>>> set to that value.
>>>
>>> Signed-off-by: Atish Patra <atish.patra@wdc.com>
>>> ---
>>>   arch/riscv/kernel/smpboot.c | 10 +++++++++-
>>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c
>>> index 609475c5..a8fe590c 100644
>>> --- a/arch/riscv/kernel/smpboot.c
>>> +++ b/arch/riscv/kernel/smpboot.c
>>> @@ -86,11 +86,19 @@ void __init setup_smp(void)
>>>   		}
>>>   
>>>   		cpuid_to_hartid_map(cpuid) = hart;
>>> -		set_cpu_possible(cpuid, true);
>>
>> This looks weird: the code being changed does not match what patch 3/4 did.
> 
> Arg... Ignore this one. My bad. Morning here, I need more coffee :)
> 
:).

>>
>>>   		cpuid++;
>>>   	}
>>>   
>>>   	BUG_ON(!found_boot_cpu);
>>> +
>>> +	if (cpuid > nr_cpu_ids)
>>> +		pr_warn("Total number of cpus [%d] are greater than configured via nr_cpus [%d]\n",
>>
>> "The total number of cpus [%d] is greater than nr_cpus option value [%d]\n"
>>

ok. I will fix it in v2.

Regards,
Atish
>>> +			cpuid, nr_cpu_ids);
>>> +
>>> +	for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) {
>>> +		if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID)
>>> +			set_cpu_possible(cpuid, true);
>>> +	}
>>>   }
>>>   
>>>   int __cpu_up(unsigned int cpu, struct task_struct *tidle)
>>>
>>
>>
> 
> 


      reply	other threads:[~2019-03-20  1:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 22:20 [v1 PATCH 1/4] RISC-V: Add RISC-V specific arch_match_cpu_phys_id Atish Patra
2019-03-19 22:20 ` [v1 PATCH 2/4] RISC-V: Fix of_get_cpu_node usage Atish Patra
2019-03-19 22:20 ` [v1 PATCH 3/4] RISC-V: Implement nosmp commandline option Atish Patra
2019-03-19 22:20 ` [v1 PATCH 4/4] RISC-V: Support nr_cpus command line option Atish Patra
2019-03-19 23:56   ` Damien Le Moal
2019-03-19 23:58     ` Damien Le Moal
2019-03-20  1:29       ` Atish Patra [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=17dc2df7-a730-1461-2577-1a05ec27d32d@wdc.com \
    --to=atish.patra@wdc.com \
    --cc=Anup.Patel@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=dmitriy@oss-tech.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    --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;
as well as URLs for NNTP newsgroup(s).