All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yinghai@kernel.org>, Jiang Liu <liuj97@gmail.com>
Subject: Re: [PATCH 7/7] ACPI / scan: Make memory hotplug driver use struct acpi_scan_handler
Date: Wed, 20 Feb 2013 15:39:35 -0700	[thread overview]
Message-ID: <1361399975.9542.91.camel@misato.fc.hp.com> (raw)
In-Reply-To: <4809314.VZzvuVVOXZ@vostro.rjw.lan>

On Wed, 2013-02-20 at 23:29 +0100, Rafael J. Wysocki wrote:
> On Wednesday, February 20, 2013 02:50:12 PM Toshi Kani wrote:
> > On Wed, 2013-02-20 at 11:42 +0100, Vasilis Liaskovitis wrote:
> > > Hi Yasuaki,
> > > 
> > > On Wed, Feb 20, 2013 at 12:35:48PM +0900, Yasuaki Ishimatsu wrote:
> > > > Hi Vasilis,
> > > > 
> > > > 2013/02/20 3:11, Vasilis Liaskovitis wrote:
> > > > >Hi,
> > > > >
> > > > >On Sun, Feb 17, 2013 at 04:27:18PM +0100, Rafael J. Wysocki wrote:
> > > > >>From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > >>
> > > > >>Make the ACPI memory hotplug driver use struct acpi_scan_handler
> > > > >>for representing the object used to set up ACPI memory hotplug
> > > > >>functionality and to remove hotplug memory ranges and data
> > > > >>structures used by the driver before unregistering ACPI device
> > > > >>nodes representing memory.  Register the new struct acpi_scan_handler
> > > > >>object with the help of acpi_scan_add_handler_with_hotplug() to allow
> > > > >>user space to manipulate the attributes of the memory hotplug
> > > > >>profile.
> > > > >
> > > > >Let's consider an example where we want acpi memory device ejection to be safely
> > > > >handled by userspace. We do the following:
> > > > >
> > > > >echo 0 > /sys/firmware/acpi/hotplug/memory/autoeject
> > > > >echo 1 > /sys/firmware/acpi/hotplug/memory/uevents
> > > > >
> > > > >We succesfully hotplug acpi device:
> > > > >/sys/devices/LNXSYSTM:00/LNXSYSBUS:00/PNP0C80:00
> > > > >and its corresponding memblocks /sys/devices/system/memory/memoryXX are
> > > > >also successfully onlined.
> > > > >
> > > > >On an eject request, since uevents == 1, the kernel will emit KOBJ_OFFLINE for:
> > > > >/sys/devices/LNXSYSTM:00/LNXSYSBUS:00/PNP0C80:00
> > > > >
> > > > >Can userspace know which memblocks in /sys/devices/system/memory/memoryXX/
> > > > >correspond to the acpi device /sys/devices/LNXSYSTM:00/LNXSYSBUS:00/PNP0C80:00 ?
> > > > >This will be needed so that userspace tries to offline the memblocks (and only
> > > > >if successful, issue the eject operation on the acpi device). As far as I see,
> > > > >we don't create any sysfs links or files for this scenario - can userspace get
> > > > >this info somehow?
> > > > 
> > > > >
> > > > >/sys/devices/system/memory/memoryXX/phys_device needs to be properly implemented
> > > > >for this to work I think, see Documentation/ABI/testing/sysfs-memory
> > > > >
> > > > >The following test patch works toward that direction. Let me know if it's of
> > > > >interest or if there are better ideas /comments.
> > > > 
> > > > How about use ../PNP0C80:00/physical_node/resources file?
> > > > In my system, the file shows following information.
> > > > 
> > > > $ cat /sys/bus/acpi/devices/PNP0C80\:00/physical_node/resources
> > > > state = active
> > > > mem 0x0-0x80000000
> > > > mem 0x100000000-0x800000000
> > > > 
> > > > It means PNP0C80:00's memory ranges are "0x0-0x7fffffff" and
> > > > "0x100000000-0x7ffffffff". In x86 architecture, memory section size is
> > > > 128MiB. So, if these memory range is divided by 128MiB, you can
> > > > calculate memory section number as follow:
> > > > 
> > > > 0x0-0x7fffffff => 0x0-0x10
> > > > 0x100000000-0x7ffffffff => 0x20-0xff
> > > > 
> > > > But there is one problem. The problem is that resources file of added memory
> > > > is not created. If the problem is fixed, I think you can use the way.
> > > 
> > > thanks for your suggestion. Is this resources file a property of the
> > > physical_node or of each acpi devices? 
> > > 
> > > If it's a node specific file could there be a chance that adjacent memory
> > > ranges get merged? We 'd like these to not get merged.
> > > 
> > > I will look more into this property. I don't see it currently in my system
> > > (probably because initial memory is not backed by acpi devices in my
> > >  seabios/virtual machine).
> > 
> > I have been thinking about this issue as well.  In case of CPUs, we have
> > a sysdev link that links LNXCPU:%d to its system/cpu/cpu%d file.
> > 
> > /sys/bus/acpi/devices/LNXCPU:02 > ll sysdev
> > lrwxrwxrwx. 1 root root 0 Feb  8 13:52 sysdev -> ../../system/cpu/cpu2
> > 
> > So, one possible approach is to create a sysdev directory under
> > PNP0C080:%d, and then create links to associated system/cpu/memory%d
> > files underneath.  What do you think?
> 
> I need to think about that a bit more, quite frankly.
> 
> I probably would prefer links to be created directly from under PNP0C080:%d
> to system/cpu/memory%d (in analogy with PCI and other devices having ACPI
> companions).
> 
> One of the problems here is that the whole /sys/bus/acpi/ stuff is kind of
> confusing, because it makes people think that there's an "ACPI bus", while
> there's no such thing.  For this reason, it should go away and the
> /sys/devices/LNXSYSTM:00/ directory should be moved somewhere under
> /sys/firmware/acpi/.  Of course, that's long-term, but this means I'd prefer
> not to add more stuff under /sys/devices/LNXSYSTM:00/ that may potentially
> cause that to be more difficult to do in the future.

I see.  I think PCI creates files under PNP0A08:%d/physical_node.
Either way, we need to do something in this space.  I will think about a
bit more as well.

Thanks,
-Toshi


  reply	other threads:[~2013-02-20 22:50 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-17 15:18 [PATCH 0/7] ACPI / hotplug: Common code for ACPI-based hotplug Rafael J. Wysocki
2013-02-17 15:20 ` [PATCH 1/7] ACPI / scan: Introduce acpi_scan_match_handler() Rafael J. Wysocki
2013-02-19  6:48   ` Yasuaki Ishimatsu
2013-02-17 15:21 ` [PATCH 2/7] ACPI / scan: Introduce common code for ACPI-based device hotplug Rafael J. Wysocki
2013-02-19  6:43   ` Yasuaki Ishimatsu
2013-02-19  7:10     ` Yasuaki Ishimatsu
2013-02-20 13:27       ` Rafael J. Wysocki
2013-02-20 13:23     ` Rafael J. Wysocki
2013-02-20 20:23       ` Toshi Kani
2013-02-20 21:17         ` Rafael J. Wysocki
2013-02-20 22:49   ` [Update][PATCH " Rafael J. Wysocki
2013-02-21  1:17     ` Toshi Kani
2013-02-21 15:44       ` Rafael J. Wysocki
2013-02-21 15:52     ` [Update 2][PATCH " Rafael J. Wysocki
2013-02-21 17:39       ` Toshi Kani
2013-02-21 22:57         ` Rafael J. Wysocki
2013-02-21 23:06       ` [Update 3][PATCH " Rafael J. Wysocki
2013-02-22  1:12         ` Toshi Kani
2013-02-22  1:50           ` Rafael J. Wysocki
2013-02-22  8:51             ` Yasuaki Ishimatsu
2013-02-22 12:37               ` Rafael J. Wysocki
2013-02-22 15:54                 ` Toshi Kani
2013-02-22 20:59                   ` Rafael J. Wysocki
2013-02-23 22:38         ` [Update 4][PATCH " Rafael J. Wysocki
2013-02-25 18:07           ` Toshi Kani
2013-02-25 23:39             ` Rafael J. Wysocki
2013-02-25 23:32               ` Toshi Kani
2013-02-26  0:40               ` Yasuaki Ishimatsu
2013-02-26  1:09                 ` Toshi Kani
2013-02-26  2:02                   ` Yasuaki Ishimatsu
2013-02-26  3:11                     ` Rafael J. Wysocki
2013-02-26  3:40                       ` Yasuaki Ishimatsu
2013-02-26  3:50                         ` Rafael J. Wysocki
2013-03-04 13:10               ` Vasilis Liaskovitis
2013-03-14 17:16                 ` Rafael J. Wysocki
2013-03-15 10:47                   ` Vasilis Liaskovitis
2013-03-25 20:45                     ` Toshi Kani
2013-03-25 22:29                       ` Rafael J. Wysocki
2013-03-25 22:57                         ` Toshi Kani
2013-03-26 12:22                           ` Rafael J. Wysocki
2013-03-26 20:10                             ` Toshi Kani
2013-02-17 15:22 ` [PATCH 3/7] ACPI / container: Use common hotplug code Rafael J. Wysocki
2013-02-17 15:23 ` [PATCH 4/7] ACPI / scan: Introduce acpi_scan_handler_matching() Rafael J. Wysocki
2013-02-19  8:05   ` Yasuaki Ishimatsu
2013-02-17 15:24 ` [PATCH 5/7] ACPI / hotplug: Introduce user space interface for hotplug profiles Rafael J. Wysocki
2013-02-25 18:13   ` Toshi Kani
2013-02-25 23:25     ` Rafael J. Wysocki
2013-02-17 15:25 ` [PATCH 6/7] ACPI / container: Use hotplug profile user space interface Rafael J. Wysocki
2013-02-17 15:27 ` [PATCH 7/7] ACPI / scan: Make memory hotplug driver use struct acpi_scan_handler Rafael J. Wysocki
2013-02-19 18:11   ` Vasilis Liaskovitis
2013-02-20  3:35     ` Yasuaki Ishimatsu
2013-02-20 10:42       ` Vasilis Liaskovitis
2013-02-20 21:50         ` Toshi Kani
2013-02-20 22:29           ` Rafael J. Wysocki
2013-02-20 22:39             ` Toshi Kani [this message]
2013-02-21  6:58         ` Yasuaki Ishimatsu
2013-02-26 22:41 ` [PATCH v2, 0/7] ACPI / hotplug: Common code for ACPI-based hotplug Rafael J. Wysocki
2013-02-26 22:44   ` [PATCH v2, 1/7] ACPI / scan: Introduce acpi_scan_match_handler() Rafael J. Wysocki
2013-02-26 22:46   ` [PATCH v2, 2/7] ACPI / scan: Introduce common code for ACPI-based device hotplug Rafael J. Wysocki
2013-02-26 22:46   ` [PATCH v2, 3/7] ACPI / container: Use common hotplug code Rafael J. Wysocki
2013-02-26 23:13     ` Toshi Kani
2013-02-26 23:13       ` Toshi Kani
2013-02-27  0:06       ` Rafael J. Wysocki
2013-02-27  0:09     ` [Update][PATCH " Rafael J. Wysocki
2013-02-26 22:47   ` [PATCH v2, 4/7] ACPI / scan: Introduce acpi_scan_handler_matching() Rafael J. Wysocki
2013-02-26 22:48   ` [PATCH v2, 5/7] ACPI / hotplug: Introduce user space interface for hotplug profiles Rafael J. Wysocki
2013-02-26 22:49   ` [PATCH v2, 6/7] ACPI / container: Use hotplug profile user space interface Rafael J. Wysocki
2013-02-26 22:50   ` [PATCH v2, 7/7] ACPI / scan: Make memory hotplug driver use struct acpi_scan_handler Rafael J. Wysocki
2013-02-27  0:51   ` [PATCH v2, 0/7] ACPI / hotplug: Common code for ACPI-based hotplug Toshi Kani

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=1361399975.9542.91.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=bhelgaas@google.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=rjw@sisk.pl \
    --cc=vasilis.liaskovitis@profitbricks.com \
    --cc=yinghai@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.