mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steffen Persvold <sp@numascale.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Daniel J Blueman <daniel@numascale-asia.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 3/3] v4: Add support for Numascale's NumaChip
Date: Mon, 05 Dec 2011 10:49:01 +0100	[thread overview]
Message-ID: <4EDC938D.6000304@numascale.com> (raw)
In-Reply-To: <20111205091022.GA29006@elte.hu>

On 12/5/2011 10:10, Ingo Molnar wrote:
[]
>
> The patches are now structured mostly right and look clean.

Thanks for the review!

>
> Other small details i noticed:
>
>> +static int numachip_system;
>> +
>> +static struct apic apic_numachip;
>
> Those want to be __read_mostly - this also makes them more NUMA
> friendly .

Ok, makes sense.

>
>> +static int __cpuinit numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip)
>> +{
>> +#ifdef CONFIG_SMP
>> +	union numachip_csr_g3_ext_irq_gen int_gen;
>> +	unsigned long flags;
>> +
>> +	int_gen.s._destination_apic_id = phys_apicid;
>> +	int_gen.s._vector = 0;
>> +	int_gen.s._msgtype = APIC_DM_INIT>>  8;
>> +	int_gen.s._index = 0;
>> +
>> +	local_irq_save(flags);
>> +	write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
>> +	local_irq_restore(flags);
>> +
>> +	mdelay(10);
>
> Exactly why does it have to sleep 10 milliseconds here? Please
> document it.

It doesn't. I'm not quite sure why it was left in there.. We will remove 
it. Thanks for catching it.

>
>> +
>> +	int_gen.s._msgtype = APIC_DM_STARTUP>>  8;
>> +	int_gen.s._vector = start_rip>>  12;
>> +
>> +	local_irq_save(flags);
>> +	write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v);
>> +	local_irq_restore(flags);
>> +
>> +	atomic_set(&init_deasserted, 1);
>> +#endif
>> +	return 0;
>
> You could do a 'depends on SMP' and stop uglifying the code with
> !SMP considerations. Unless a single-core installation with a UP
> kernel is possible and desired.

Agreed.

>
>> +static void numachip_send_IPI_allbutself(int vector)
>> +{
>> +	unsigned int this_cpu = smp_processor_id();
>> +	unsigned int cpu;
>> +	unsigned long flags;
>> +
>> +	local_irq_save(flags);
>> +	for_each_online_cpu(cpu) {
>> +		if (cpu != this_cpu)
>> +			numachip_send_IPI_one(cpu, vector);
>> +	}
>> +	local_irq_restore(flags);
>> +}
>
> This seems preempt unsafe: you take smp_processor_id() before
> disabling hardirqs.

Hmm, yes. Again some debug stuff laying around, local_irq_save/restore 
isn't really needed there I think.

We will redo this last patch and re-send after testing. Thanks!

Kind regards,
-- 
Steffen Persvold, Chief Architect NumaChip
Numascale AS - www.numascale.com
Tel: +47 92 49 25 54 Skype: spersvold

  reply	other threads:[~2011-12-05 14:09 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26  6:07 [PATCH 1/3] Add Numachip APIC support Daniel J Blueman
2011-10-26  6:07 ` [PATCH 2/3] Add multi-node boot support Daniel J Blueman
2011-10-27  7:30   ` Ingo Molnar
2011-10-27 10:46     ` Steffen Persvold
2011-10-27 11:38       ` Ingo Molnar
2011-10-27 11:42         ` Steffen Persvold
2011-12-02 18:31         ` Daniel J Blueman
2011-12-05  8:20           ` [PATCH 1/3] Make flat_init_apic_ldr available Daniel J Blueman
2011-12-05  8:20             ` [PATCH 2/3] v2: Add x86_init platform override to fix up core numbering Daniel J Blueman
2011-12-05 17:58               ` [tip:x86/apic] x86: Add x86_init platform override to fix up NUMA " tip-bot for Daniel J Blueman
2011-12-06  6:30               ` [tip:x86/apic] x86: Fix the !CONFIG_NUMA build of the new CPU ID fixup code support tip-bot for Steffen Persvold
2011-12-05  8:20             ` [PATCH 3/3] v4: Add support for Numascale's NumaChip Daniel J Blueman
2011-12-05  9:10               ` Ingo Molnar
2011-12-05  9:49                 ` Steffen Persvold [this message]
2011-12-05 16:07                   ` [PATCH 3/3] v5: Add NumaChip support Daniel J Blueman
2011-12-05 17:59                     ` [tip:x86/apic] x86: " tip-bot for Steffen Persvold
2011-12-05 20:31                       ` Ingo Molnar
2011-12-06  0:10                         ` Steffen Persvold
2011-12-06  5:50                           ` Ingo Molnar
2011-12-06  6:09                             ` Steffen Persvold
2011-12-08 22:35                             ` Kevin Winchester
2011-12-09  1:24                               ` Steffen Persvold
2011-12-09  7:22                               ` Ingo Molnar
2011-12-10  1:52                                 ` Kevin Winchester
2011-12-10  2:28                                   ` Kevin Winchester
2011-12-18  9:44                                   ` Ingo Molnar
2011-12-19  0:12                             ` [PATCH] x86: Simplify code by allowing more of struct cpuinfo_x86 for the !SMP case Kevin Winchester
2011-12-19 14:07                               ` [tip:x86/apic] " tip-bot for Kevin Winchester
2011-12-19 18:47                                 ` Ingo Molnar
2011-12-21  0:52                                   ` [PATCH] " Kevin Winchester
2011-12-21  8:48                                     ` [tip:x86/apic] x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86' tip-bot for Kevin Winchester
2011-12-05 17:57             ` [tip:x86/apic] x86: Make flat_init_apic_ldr() available tip-bot for Daniel J Blueman
2011-10-26  6:07 ` [PATCH 3/3] Add NumaChip quirk Daniel J Blueman
2011-10-27  7:26 ` [PATCH 1/3] Add Numachip APIC support Ingo Molnar
2011-10-27  7:35 ` Ingo Molnar
2011-10-27  7:44 ` Ingo Molnar
2011-10-27 10:31   ` Steffen Persvold

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=4EDC938D.6000304@numascale.com \
    --to=sp@numascale.com \
    --cc=daniel@numascale-asia.com \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

Powered by JetHome