[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200910144018.GK28354@dhcp22.suse.cz>
Date: Thu, 10 Sep 2020 16:40:18 +0200
From: Michal Hocko <mhocko@...e.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: Laurent Dufour <ldufour@...ux.ibm.com>, akpm@...ux-foundation.org,
David Hildenbrand <david@...hat.com>, rafael@...nel.org,
nathanl@...ux.ibm.com, cheloha@...ux.ibm.com,
stable@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug
operations
On Thu 10-09-20 15:51:07, Michal Hocko wrote:
> On Thu 10-09-20 15:39:00, Oscar Salvador wrote:
> > On Thu, Sep 10, 2020 at 02:48:47PM +0200, Michal Hocko wrote:
[...]
> > > Forgot to ask one more thing. Who is going to online that memory when
> > > userspace is not running yet?
> >
> > Depends, if you have CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE set or you specify
> > memhp_default_online_type=[online,online_*], memory will get onlined right
> > after hot-adding stage:
> >
> > /* online pages if requested */
> > if (memhp_default_online_type != MMOP_OFFLINE)
> > walk_memory_blocks(start, size, NULL, online_memory_block);
> >
> > If not, systemd-udev will do the magic once the system is up.
>
> Does that imply that we need udev to scan all existing devices and
> reprobe them?
I've checked the sysfs side of things and it seems that the KOBJ_ADD
event gets lost because there are no listeners
(create_memory_block_devices -> .... -> device_register -> ... ->
device_add -> kobject_uevent(&dev->kobj, KOBJ_ADD) ->
kobject_uevent_net_broadcast). So the only way to find out about those
devices once the init is up and something than intercept those events is
to rescan devices.
This is really unfortunate because this solution really doesn't scale
with most usecases which do not do early boot hotplug and this can get
more than interesting on machines like ppc which have gazillions of
memory block devices because they use insanly small blocks and just
imagine a multi TB machine how that scales. Sigh...
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists