linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Laurent Dufour <ldufour@linux.ibm.com>,
	akpm@linux-foundation.org, David Hildenbrand <david@redhat.com>,
	rafael@kernel.org, nathanl@linux.ibm.com, cheloha@linux.ibm.com,
	stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug operations
Date: Thu, 10 Sep 2020 16:40:18 +0200	[thread overview]
Message-ID: <20200910144018.GK28354@dhcp22.suse.cz> (raw)
In-Reply-To: <20200910135106.GI28354@dhcp22.suse.cz>

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

  reply	other threads:[~2020-09-10 14:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5cbd92e1-c00a-4253-0119-c872bfa0f2bc@redhat.com>
     [not found] ` <20200908170835.85440-1-ldufour@linux.ibm.com>
2020-09-09  7:40   ` [PATCH] mm: don't rely on system state to detect hot-plug operations Michal Hocko
2020-09-09  7:48     ` Laurent Dufour
2020-09-09  9:09       ` Michal Hocko
2020-09-09  9:21         ` Laurent Dufour
2020-09-09  9:24           ` David Hildenbrand
2020-09-09  9:32             ` Laurent Dufour
2020-09-09 12:30             ` Greg Kroah-Hartman
2020-09-09 12:32               ` David Hildenbrand
2020-09-09 12:36                 ` Greg Kroah-Hartman
2020-09-09 12:45                 ` Michal Hocko
2020-09-09 10:59           ` Michal Hocko
2020-09-09 16:07             ` Laurent Dufour
2020-09-10  7:23               ` Michal Hocko
2020-09-10  7:51                 ` Laurent Dufour
2020-09-10 11:12                   ` Michal Hocko
2020-09-10 11:35                     ` Laurent Dufour
2020-09-10 12:00                       ` David Hildenbrand
2020-09-10 12:36                         ` Laurent Dufour
2020-09-10 12:38                           ` David Hildenbrand
2020-09-10 12:01                       ` Michal Hocko
2020-09-10 12:03                       ` Oscar Salvador
2020-09-10 12:32                         ` Laurent Dufour
2020-09-10 12:47                         ` Michal Hocko
2020-09-10 12:48                           ` Michal Hocko
2020-09-10 13:39                             ` Oscar Salvador
2020-09-10 13:51                               ` Michal Hocko
2020-09-10 14:40                                 ` Michal Hocko [this message]
2020-09-10 12:49                           ` David Hildenbrand
2020-09-10 13:54                             ` Michal Hocko
2020-09-10 13:57                               ` David Hildenbrand

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=20200910144018.GK28354@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=cheloha@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nathanl@linux.ibm.com \
    --cc=osalvador@suse.de \
    --cc=rafael@kernel.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).