public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "canquan.shen" <shencanquan@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"rui.zhao@intel.com" <rui.zhao@intel.com>,
	"shemminger@vyatta.com" <shemminger@vyatta.com>,
	"yakui.zhao@intel.com" <yakui.zhao@intel.com>,
	"xiaowei.yang@huawei.com" <xiaowei.yang@huawei.com>,
	hanweidong <hanweidong@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: Re : [PATCH] acpi: Fix hot cpu remove problem on acpi subsystem
Date: Tue, 06 Sep 2011 14:48:52 +0800	[thread overview]
Message-ID: <4E65C254.8090107@huawei.com> (raw)
In-Reply-To: <CAErSpo4JsyHag24SH=zSRHt4c8kYwdcXEnCConGEi2u6dN-pnw@mail.gmail.com>

On 2011/9/6 12:19, Bjorn Helgaas wrote:
>> 主题: [PATCH] acpi: Fix hot cpu remove problem on acpi subsystem
>>
>> In Xen virtualization environment, When I used xen tools (xm vcpu-set vcpu_number ) to test the vcpu add and remove, I found it is failure on vcpu remove, I found the reason is that nothing to do when cpu remove in acpi_processor_hotplug_notify function, so I add the code of send the OFFLINE message to udev and add the rule of udev. it is ok on vcpu remove.
>> Signed-off-by: Shen canquan<shencanquan@huawei.com>
>> ---
>>   drivers/acpi/processor_driver.c |    2 ++
>>   1 files changed, 2 insertions(+), 0 deletions(-)
>> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
>> index a4e0f1b..a1c564f 100644
>> --- a/drivers/acpi/processor_driver.c
>> +++ b/drivers/acpi/processor_driver.c
>> @@ -677,6 +677,8 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
>>                                      "Driver data is NULL, dropping EJECT\n");
>>                          return;
>>                  }
>> +
>> +               kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
>>                  break;
>>          default:
>>                  ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>
> The processor driver used to generate ONLINE and OFFLINE messages.  I
> removed them with c1815e0740.  According to the changelog, the driver
> core still generates KOBJ_ADD and KOBJ_REMOVE events.
>

Thanks for your answer.
When I used xen tools (xm vcpu-set vcpu_numer) to reduce the cpu number. 
I don't found any event . I use the following tool to capture the event: 
udevadm monitor --env --kernel --udev.

If I used xen tools to add the cpu number , udev module will receive the 
KOBJ_ADD event.

In my patch ,It is more fine to replace KOBJ_OFFLINE to KOBJ_REMOVE event .

btw: how to find changelog of the c1815e0740.

> Could you fix the Xen vcpu add/remove problem by looking for
> ADD/REMOVE events rather than ONLINE/OFFLINE?
>

Xen vcpu add/remove module has send the sci interrupt to linux ACPI Core 
module. the sci interrupt handler function (acpi_ev_gpe_xrupt_handler) 
has hanled it and called to AML code of processor to add and remove cpu. 
and then call back acpi_processor_hotplug_notify function to notify 
linux acpi processor driver .



> I removed ONLINE/OFFLINE because I think hotplug should be handled in
> the ACPI core, not in the drivers.  Removing ONLINE/OFFLINE got rid of
> one small piece of driver-specific hotplug handling.  Obviously,
> there's still a lot to do.
>
> If using ADD/REMOVE is not sufficient, what is the justification for
> needing both REMOVE and OFFLINE, and how would they be different?
>

I think the device of processor add and remove should be handle in 
processor driver . The ONLINE/OFFLINE function of CPU should be handle 
in linux kernel. so when removing cpu by Xen. at first it should be 
notify linux kernel to offline the cpu and then remove the device of 
processor.

btw: I found acpi_eject_store function in driver/acpi/scan.c will deal 
the offline cpu and remove the device of processor.


> Bjorn
>
>





  reply	other threads:[~2011-09-06  6:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05  6:22 Re : [PATCH] acpi: Fix hot cpu remove problem on acpi subsystem Shen Canquan
2011-09-06  4:19 ` Bjorn Helgaas
2011-09-06  6:48   ` canquan.shen [this message]
2011-09-06 18:38     ` Bjorn Helgaas
2011-09-07  2:40       ` canquan.shen
2011-09-07  6:57         ` Bjorn Helgaas
2011-09-08  0:21           ` canquan.shen

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=4E65C254.8090107@huawei.com \
    --to=shencanquan@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=hanweidong@huawei.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhao@intel.com \
    --cc=shemminger@vyatta.com \
    --cc=xiaowei.yang@huawei.com \
    --cc=yakui.zhao@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox