All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohui Zheng <shaohui.zheng@intel.com>
To: lethal@linux-sh.org
Cc: linux-kernel@vger.kernel.org
Subject: [v2,5/8] NUMA Hotplug emulator
Date: Tue, 16 Nov 2010 12:13:30 +0800	[thread overview]
Message-ID: <20101116041330.GA20694@shaohui> (raw)

>This looks like an incredibly painful interface. How about scrapping all
>of this _emu() mess and just reworking the register_cpu() interface?
> Something like:

hi, Paul
	I saw your reply on patchwork.kernel.org, but I did not find your email 
in my mailbox, you might forget to cc to me.

	I think that your register_cpu_node interface seems good, but this will 
remove the interface register_cpu. it is not the original purpose of the 
emulator, we want to emulate the oringal process, but we did not want to change
the old interface, that is a rule.

	I want to share some piece of codes, and I did not want to do so much change,
so I call register_cpu and register_cpu_emu in the same function. yes, it is a 
painful interface, I will add a function arch_register_cpu_emu to solve it.

Real hotplug process:
arch_register_cpu
	- call register_cpu

Emulated hotplug process:
arch_register_cpu_emu
	- call register_cpu_emu

diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index 7e45159..93859d5 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -52,6 +52,16 @@ int __ref arch_register_cpu(int num)
 }
 EXPORT_SYMBOL(arch_register_cpu);
 
+/* emulated version for arch_register_cpu */
+int __ref arch_register_cpu_emu(int num, int nid)
+{
+	if (num)
+		per_cpu(cpu_devices, num).cpu.hotpluggable = 1;
+
+	return register_cpu_emu(&per_cpu(cpu_devices, num).cpu, nid);
+}
+EXPORT_SYMBOL(arch_register_cpu_emu);
+
 void arch_unregister_cpu(int num)
 {
 	unregister_cpu(&per_cpu(cpu_devices, num).cpu);

-- 
Thanks & Regards,
Shaohui


             reply	other threads:[~2010-11-16  5:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  4:13 Shaohui Zheng [this message]
2010-11-16  5:47 ` [v2,5/8] NUMA Hotplug emulator Paul Mundt
     [not found]   ` <A24AE1FFE7AEC5489F83450EE98351BF27D53BCC36@shsmsx502.ccr.corp.intel.com>
2010-11-16  5:05     ` Shaohui Zheng
2010-11-16  7:04       ` Paul Mundt
2010-11-16  6:21         ` Shaohui Zheng
  -- strict thread matches above, loose matches on Subject: below --
2010-11-13  6:16 Shaohui Zheng
2010-11-15  6:58 ` Paul Mundt
2010-11-13  5:42 Shaohui Zheng

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=20101116041330.GA20694@shaohui \
    --to=shaohui.zheng@intel.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.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 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.