All of lore.kernel.org
 help / color / mirror / Atom feed
From: "canquan.shen" <shencanquan@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: len.brown@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>,
	linqiangmin@huawei.com, james.chenjiabo@huawei.com
Subject: Re: Re : [PATCH] acpi: Fix hot cpu remove problem on acpi subsystem
Date: Thu, 08 Sep 2011 08:21:09 +0800	[thread overview]
Message-ID: <4E680A75.3000600@huawei.com> (raw)
In-Reply-To: <CAErSpo7Rf+X3MVgmdYvbEXw-UAU7sEEMq5upBkhEn9Eu0zD-zw@mail.gmail.com>

On 2011/9/7 14:57, Bjorn Helgaas wrote:
> On Tue, Sep 6, 2011 at 7:40 PM, canquan.shen<shencanquan@huawei.com>  wrote:
>> On 2011/9/7 2:38, Bjorn Helgaas wrote:
>
>>> Is acpi_processor_remove() called when you remove a processor?  I see
>>> a path where it will be called via acpi_eject_store():
>>>
>>>      acpi_eject_store
>>>        acpi_os_hotplug_execute(acpi_bus_hot_remove_device)
>>>        acpi_bus_hot_remove_device
>>>          acpi_bus_trim
>>>            acpi_bus_remove
>>>              device_release_driver
>>>                dev->driver->remove (acpi_processor_remove())
>>>              acpi_device_unregister
>>>                device_unregister
>>>                  device_del
>>>                    kobject_uevent(KOBJ_REMOVE)
>>>
>>> but as far as I can tell, this path is only used when we write
>>> something to the "eject" sysfs file.  I would think we'd want to use
>>> most of this same path when we hot remove a CPU via the ACPI SCI
>>> mechanism.
>>>
>>
>> Because in my patch will send the KOBJ_REMOVE event to udev module. and I
>> write a udev rule like the following:
>> ACTION=="remove",DRIVER=="processor",SUBSYSTEM=="acpi",RUN+="/bin/bash -c
>> 'echo 1>  /sys%p/eject'"
>> This rule will write "1" to the "eject" sysfs file. and then call
>> acpi_eject_store function.
>
> Hmmm.  I think I understand your proposal, but it seems like a
> convoluted path to me.
>
> I guess the real question is whether we must give userspace a chance
> to decide whether to actually do the remove or not.  Is there a
> requirement to do that?  Neither the dynamic device removal flow (ACPI
> spec 4.0a, sec 6.3) nor the ejection flow example (fig 6-5) mentions
> doing that.
>
    I think we should give userspace a chance to decide whether do  the 
remove or not. About the cpu remove, it has two part, one in the linux 
kernel which mainly online/offline cpu, another is acpi core driver, 
which mainly add and remove the device of processor.
    giving userspace a chance is not acpi spec requirement. but it is 
flexible for linux kernel. many driver use the udev mechanism to has a 
chance for user to decide how to handle the event of kernel.

> I mentioned before that I think the ACPI hotplug code should be ripped
> out of the drivers and consolidated in the ACPI core.  I think it's
> pretty clear from the spec that the 0-0x7f notifications (Bus Check,
> Device Check, Eject Request, etc.) are designed to be handled by the
> core, not by individual drivers.  We handle hotplug in the drivers
> today, but I think that's mainly because we never implemented support
> in the Linux ACPI core.  There are comments in acpi_bus_check_device()
> and acpi_bus_check_scope() about what we *should* be doing there.
>
> I am opposed to adding more hotplug support to individual drivers
> because I still hope that someday we'll support it in the ACPI core.
> Many ACPI drivers don't support hotplug at all, and the ones that do
> support hotplug do it in a variety of ways.  It's all quite a mess.
>
> Bjorn
>
> .
>

I admit it is convoluted path for hot cpu remove. and the acpi processor 
driver will be consolidated in the acip core. but how to do in the acpi 
core ? I think it maybe directly call acpi_bus_hot_remove_device or send 
KOBJ_OFFLINE event to linux kernel.

I will modify the processor driver by add the acpi_bus_trim function in 
acpi_processor_hotplug_notify. and create the patch for fix this problem.
Could you help me to merge to latest linux kernel? Thanks for your 
answer again.

---
canquan.shen






      reply	other threads:[~2011-09-08  0:21 UTC|newest]

Thread overview: 12+ 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-05  6:22 ` Shen Canquan
2011-09-06  4:19 ` Bjorn Helgaas
2011-09-06  4:19   ` Bjorn Helgaas
2011-09-06  6:48   ` canquan.shen
2011-09-06 18:38     ` Bjorn Helgaas
2011-09-06 18:38       ` Bjorn Helgaas
2011-09-07  2:40       ` canquan.shen
2011-09-07  2:40         ` canquan.shen
2011-09-07  6:57         ` Bjorn Helgaas
2011-09-07  6:57           ` Bjorn Helgaas
2011-09-08  0:21           ` canquan.shen [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=4E680A75.3000600@huawei.com \
    --to=shencanquan@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=hanweidong@huawei.com \
    --cc=james.chenjiabo@huawei.com \
    --cc=len.brown@intel.com \
    --cc=linqiangmin@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.