All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	David Rientjes <rientjes@google.com>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	linux-api@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-s390@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-acpi@vger.kernel.org, Michal Hocko <mhocko@suse.com>
Subject: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks
Date: Mon, 27 Feb 2017 11:02:09 +0100	[thread overview]
Message-ID: <87lgssvtni.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20170227092817.23571-1-mhocko@kernel.org> (Michal Hocko's message of "Mon, 27 Feb 2017 10:28:17 +0100")

Michal Hocko <mhocko@kernel.org> writes:

> From: Michal Hocko <mhocko@suse.com>
>
> This knob has been added by 31bc3858ea3e ("memory-hotplug: add automatic
> onlining policy for the newly added memory") mainly to cover memory
> hotplug based balooning solutions currently implemented for HyperV
> and Xen. Both of them want to online the memory as soon after
> registering as possible otherwise they can register too much memory
> which cannot be used and trigger the oom killer (we need ~1.5% of the
> registered memory so a large increase can consume all the available
> memory). hv_mem_hot_add even waits for the userspace to online the
> memory if the auto onlining is disabled to mitigate that problem.
>
> Adding yet another knob and a config option just doesn't make much sense
> IMHO. How is a random user supposed to know when to enable this option?
> Ballooning drivers know much better that they want to do an immediate
> online rather than waiting for the userspace to do that. If the memory
> is onlined for a different purpose then we already have a notification
> for the userspace and udev can handle the onlining. So the knob as well
> as the config option for the default behavior just doesn't make any
> sense. Let's remove them and allow user of add_memory to request the
> online status explicitly. Not only it makes more sense it also removes a
> lot of clutter.
>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
>
> Hi,
> I am sending this as an RFC because this is a user visible change. Maybe
> we won't be able to remove the sysfs knob which would be sad, especially
> when it has been added without a wider discussion and IMHO it is just
> wrong. Is there any reason why a kernel command line parameter wouldn't
> work just fine?
>
> Even in that case I believe that we should remove
> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE knob. It just adds to an already
> messy config space. Does anybody depend on the policy during the early
> boot before the userspace can set the sysfs knob? Or why those users cannot
> simply use the kernel command line parameter.
>
> I also believe that the wait-for-userspace in hyperV should just die. It
> should do the unconditional onlining. Same as Xen. I do not see any
> reason why those should depend on the userspace. This should be just
> fixed regardless of the sysfs/config part. I can separate this out of course.
>
> Thoughts/Concerns?

I don't have anything new to add to the discussion happened last week
but I'd like to summarize my arguments against this change:

1) This patch doesn't solve any issue. Configuration option is not an
issue by itself, it is an option for distros to decide what they want to
ship: udev rule with known issues (legacy mode) or enable the new
option. Distro makers and users building their kernels should be able to
answer this simple question "do you want to automatically online all
newly added memory or not". There are distros already which ship kernels
with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE enabled (Fedora 24 and 25 as
far as I remember, maybe someone else).

2) This patch creates an imbalance between Xen/Hyper-V on one side and
KVM/Vmware on another. KVM/Vmware use pure ACPI memory hotplug and this
memory won't get onlined. I don't understand how this problem is
supposed to be solved by distros. They'll *have to* continue shipping
a udev rule which has and always will have issues.

3) Kernel command line is not a viable choice, it is rather a debug
method. Having all newly added memory online as soon as possible is a
major use-case not something a couple of users wants (and this is
proved by major distros shipping the unconditional 'offline->online'
rule with udev).

A couple of other thoughts:
1) Having all newly added memory online ASAP is probably what people
want for all virtual machines. Unfortunately, we have additional
complexity with memory zones (ZONE_NORMAL, ZONE_MOVABLE) and in some
cases manual intervention is required. Especially, when further unplug
is expected.

2) Adding new memory can (in some extreme cases) still fail as we need
some *other* memory before we're able to online the newly added
block. This is an issue to be solved and it is doable (IMO) with some
pre-allocation.

I'd also like to notice that this patch doesn't re-introduce the issue I
was fixing with in-kernel memory onlining as all memory added through
the Hyper-V driver will be auto-onlined unconditionally. What I disagree
with here is taking away choice without fixing any real world issues.

[snip]

-- 
  Vitaly

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	David Rientjes <rientjes@google.com>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	linux-api@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-s390@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-acpi@vger.kernel.org, Michal Hocko <mhocko@suse.com>
Subject: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks
Date: Mon, 27 Feb 2017 11:02:09 +0100	[thread overview]
Message-ID: <87lgssvtni.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20170227092817.23571-1-mhocko@kernel.org> (Michal Hocko's message of "Mon, 27 Feb 2017 10:28:17 +0100")

Michal Hocko <mhocko@kernel.org> writes:

> From: Michal Hocko <mhocko@suse.com>
>
> This knob has been added by 31bc3858ea3e ("memory-hotplug: add automatic
> onlining policy for the newly added memory") mainly to cover memory
> hotplug based balooning solutions currently implemented for HyperV
> and Xen. Both of them want to online the memory as soon after
> registering as possible otherwise they can register too much memory
> which cannot be used and trigger the oom killer (we need ~1.5% of the
> registered memory so a large increase can consume all the available
> memory). hv_mem_hot_add even waits for the userspace to online the
> memory if the auto onlining is disabled to mitigate that problem.
>
> Adding yet another knob and a config option just doesn't make much sense
> IMHO. How is a random user supposed to know when to enable this option?
> Ballooning drivers know much better that they want to do an immediate
> online rather than waiting for the userspace to do that. If the memory
> is onlined for a different purpose then we already have a notification
> for the userspace and udev can handle the onlining. So the knob as well
> as the config option for the default behavior just doesn't make any
> sense. Let's remove them and allow user of add_memory to request the
> online status explicitly. Not only it makes more sense it also removes a
> lot of clutter.
>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
>
> Hi,
> I am sending this as an RFC because this is a user visible change. Maybe
> we won't be able to remove the sysfs knob which would be sad, especially
> when it has been added without a wider discussion and IMHO it is just
> wrong. Is there any reason why a kernel command line parameter wouldn't
> work just fine?
>
> Even in that case I believe that we should remove
> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE knob. It just adds to an already
> messy config space. Does anybody depend on the policy during the early
> boot before the userspace can set the sysfs knob? Or why those users cannot
> simply use the kernel command line parameter.
>
> I also believe that the wait-for-userspace in hyperV should just die. It
> should do the unconditional onlining. Same as Xen. I do not see any
> reason why those should depend on the userspace. This should be just
> fixed regardless of the sysfs/config part. I can separate this out of course.
>
> Thoughts/Concerns?

I don't have anything new to add to the discussion happened last week
but I'd like to summarize my arguments against this change:

1) This patch doesn't solve any issue. Configuration option is not an
issue by itself, it is an option for distros to decide what they want to
ship: udev rule with known issues (legacy mode) or enable the new
option. Distro makers and users building their kernels should be able to
answer this simple question "do you want to automatically online all
newly added memory or not". There are distros already which ship kernels
with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE enabled (Fedora 24 and 25 as
far as I remember, maybe someone else).

2) This patch creates an imbalance between Xen/Hyper-V on one side and
KVM/Vmware on another. KVM/Vmware use pure ACPI memory hotplug and this
memory won't get onlined. I don't understand how this problem is
supposed to be solved by distros. They'll *have to* continue shipping
a udev rule which has and always will have issues.

3) Kernel command line is not a viable choice, it is rather a debug
method. Having all newly added memory online as soon as possible is a
major use-case not something a couple of users wants (and this is
proved by major distros shipping the unconditional 'offline->online'
rule with udev).

A couple of other thoughts:
1) Having all newly added memory online ASAP is probably what people
want for all virtual machines. Unfortunately, we have additional
complexity with memory zones (ZONE_NORMAL, ZONE_MOVABLE) and in some
cases manual intervention is required. Especially, when further unplug
is expected.

2) Adding new memory can (in some extreme cases) still fail as we need
some *other* memory before we're able to online the newly added
block. This is an issue to be solved and it is doable (IMO) with some
pre-allocation.

I'd also like to notice that this patch doesn't re-introduce the issue I
was fixing with in-kernel memory onlining as all memory added through
the Hyper-V driver will be auto-onlined unconditionally. What I disagree
with here is taking away choice without fixing any real world issues.

[snip]

-- 
  Vitaly

  parent reply	other threads:[~2017-02-27 10:02 UTC|newest]

Thread overview: 143+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  9:28 [RFC PATCH] mm, hotplug: get rid of auto_online_blocks Michal Hocko
2017-02-27  9:28 ` Michal Hocko
2017-02-27 10:02 ` Vitaly Kuznetsov
2017-02-27 10:02 ` Vitaly Kuznetsov [this message]
2017-02-27 10:02   ` Vitaly Kuznetsov
2017-02-27 10:21   ` Michal Hocko
2017-02-27 10:21     ` Michal Hocko
2017-02-27 10:49     ` Vitaly Kuznetsov
2017-02-27 10:49       ` Vitaly Kuznetsov
2017-02-27 12:56       ` Michal Hocko
2017-02-27 12:56         ` Michal Hocko
2017-02-27 13:17         ` Vitaly Kuznetsov
     [not found]         ` <20170227125636.GB26504-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-02-27 13:17           ` Vitaly Kuznetsov
2017-02-27 13:17             ` Vitaly Kuznetsov
2017-02-27 13:17             ` Vitaly Kuznetsov
2017-02-27 12:56       ` Michal Hocko
2017-02-27 10:49     ` Vitaly Kuznetsov
2017-02-27 10:21   ` Michal Hocko
2017-02-27 11:25   ` Heiko Carstens
2017-02-27 11:25   ` Heiko Carstens
2017-02-27 11:25     ` Heiko Carstens
2017-02-27 11:50     ` Vitaly Kuznetsov
2017-02-27 11:50     ` Vitaly Kuznetsov
2017-02-27 11:50       ` Vitaly Kuznetsov
2017-02-27 15:43     ` Michal Hocko
2017-02-27 15:43     ` Michal Hocko
2017-02-27 15:43       ` Michal Hocko
2017-02-28 10:21       ` Heiko Carstens
2017-02-28 10:21       ` Heiko Carstens
2017-02-28 10:21         ` Heiko Carstens
2017-03-02 13:53       ` Igor Mammedov
2017-03-02 13:53       ` Igor Mammedov
2017-03-02 13:53         ` Igor Mammedov
2017-03-02 14:28         ` Michal Hocko
2017-03-02 14:28           ` Michal Hocko
2017-03-02 17:03           ` Igor Mammedov
2017-03-02 17:03             ` Igor Mammedov
2017-03-03  8:27             ` Michal Hocko
2017-03-03  8:27               ` Michal Hocko
2017-03-03 17:34               ` Igor Mammedov
2017-03-03 17:34                 ` Igor Mammedov
2017-03-06 14:54                 ` Michal Hocko
2017-03-06 14:54                 ` Michal Hocko
2017-03-06 14:54                   ` Michal Hocko
2017-03-07 12:40                   ` Igor Mammedov
2017-03-07 12:40                     ` Igor Mammedov
2017-03-09 12:54                     ` Michal Hocko
2017-03-09 12:54                     ` Michal Hocko
2017-03-09 12:54                       ` Michal Hocko
2017-03-10 13:58                       ` WTH is going on with memory hotplug sysf interface (was: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks) Michal Hocko
2017-03-10 13:58                       ` Michal Hocko
2017-03-10 13:58                         ` Michal Hocko
2017-03-10 15:53                         ` Michal Hocko
2017-03-10 15:53                         ` Michal Hocko
2017-03-10 15:53                           ` Michal Hocko
2017-03-10 19:00                           ` Reza Arbab
2017-03-10 19:00                           ` Reza Arbab
2017-03-10 19:00                             ` Reza Arbab
2017-03-13  9:21                             ` Michal Hocko
2017-03-13  9:21                             ` Michal Hocko
2017-03-13  9:21                               ` Michal Hocko
2017-03-13 14:58                               ` Reza Arbab
2017-03-13 14:58                               ` Reza Arbab
2017-03-13 14:58                                 ` Reza Arbab
2017-03-14 19:35                               ` Andrea Arcangeli
2017-03-14 19:35                               ` Andrea Arcangeli
2017-03-14 19:35                                 ` Andrea Arcangeli
2017-03-15  7:57                                 ` Michal Hocko
2017-03-15  7:57                                   ` Michal Hocko
2017-03-15  7:57                                 ` Michal Hocko
2017-03-13 15:11                           ` Michal Hocko
2017-03-13 15:11                             ` Michal Hocko
2017-03-13 23:16                             ` Andi Kleen
2017-03-13 23:16                             ` Andi Kleen
2017-03-13 23:16                               ` Andi Kleen
2017-03-13 23:16                               ` Andi Kleen
2017-03-13 15:11                           ` Michal Hocko
2017-03-10 17:39                         ` WTH is going on with memory hotplug sysf interface Yasuaki Ishimatsu
2017-03-10 17:39                           ` Yasuaki Ishimatsu
2017-03-13  9:19                           ` Michal Hocko
2017-03-13  9:19                             ` Michal Hocko
2017-03-14 16:05                             ` YASUAKI ISHIMATSU
2017-03-14 16:05                             ` YASUAKI ISHIMATSU
2017-03-14 16:05                               ` YASUAKI ISHIMATSU
2017-03-14 16:20                               ` Michal Hocko
2017-03-14 16:20                                 ` Michal Hocko
2017-03-14 16:20                               ` Michal Hocko
2017-03-13  9:19                           ` Michal Hocko
2017-03-10 17:39                         ` Yasuaki Ishimatsu
2017-03-13 10:31                         ` WTH is going on with memory hotplug sysf interface (was: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks) Igor Mammedov
2017-03-13 10:31                           ` Igor Mammedov
2017-03-13 10:43                           ` Michal Hocko
2017-03-13 10:43                           ` Michal Hocko
2017-03-13 10:43                             ` Michal Hocko
2017-03-13 13:57                             ` Igor Mammedov
2017-03-13 13:57                               ` Igor Mammedov
2017-03-13 14:36                               ` Michal Hocko
2017-03-13 14:36                               ` Michal Hocko
2017-03-13 14:36                                 ` Michal Hocko
2017-03-13 13:57                             ` Igor Mammedov
2017-03-13 10:31                         ` Igor Mammedov
2017-03-13 10:55                       ` [RFC PATCH] mm, hotplug: get rid of auto_online_blocks Igor Mammedov
2017-03-13 10:55                       ` Igor Mammedov
2017-03-13 10:55                         ` Igor Mammedov
2017-03-13 12:28                         ` Michal Hocko
2017-03-13 12:28                         ` Michal Hocko
2017-03-13 12:28                           ` Michal Hocko
2017-03-13 12:54                           ` Vitaly Kuznetsov
2017-03-13 12:54                           ` Vitaly Kuznetsov
2017-03-13 12:54                             ` Vitaly Kuznetsov
2017-03-13 13:19                             ` Michal Hocko
2017-03-13 13:19                             ` Michal Hocko
2017-03-13 13:19                               ` Michal Hocko
2017-03-13 13:42                               ` Vitaly Kuznetsov
2017-03-13 13:42                                 ` Vitaly Kuznetsov
2017-03-13 14:32                                 ` Michal Hocko
2017-03-13 14:32                                   ` Michal Hocko
2017-03-13 15:10                                   ` Vitaly Kuznetsov
2017-03-13 15:10                                     ` Vitaly Kuznetsov
2017-03-13 15:10                                   ` Vitaly Kuznetsov
2017-03-13 14:32                                 ` Michal Hocko
2017-03-13 13:42                               ` Vitaly Kuznetsov
2017-03-14 13:20                           ` Igor Mammedov
2017-03-14 13:20                           ` Igor Mammedov
2017-03-14 13:20                             ` Igor Mammedov
2017-03-15  7:53                             ` Michal Hocko
2017-03-15  7:53                               ` Michal Hocko
2017-03-15  7:53                             ` Michal Hocko
2017-03-07 12:40                   ` Igor Mammedov
2017-03-10 22:00                   ` Daniel Kiper
2017-03-10 22:00                     ` Daniel Kiper
2017-03-10 22:00                   ` Daniel Kiper
2017-03-03 17:34               ` Igor Mammedov
2017-03-03  8:27             ` Michal Hocko
2017-03-02 17:03           ` Igor Mammedov
2017-03-02 14:28         ` Michal Hocko
2017-02-27 17:28 ` Reza Arbab
2017-02-27 17:28 ` Reza Arbab
2017-02-27 17:28   ` Reza Arbab
2017-02-27 17:34   ` Michal Hocko
2017-02-27 17:34   ` Michal Hocko
2017-02-27 17:34     ` Michal Hocko
2017-02-27  9:28 Michal Hocko

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=87lgssvtni.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.kiper@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kys@microsoft.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=xen-devel@lists.xenproject.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.