From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id 975866B0006 for ; Wed, 3 Oct 2018 09:52:39 -0400 (EDT) Received: by mail-qt1-f199.google.com with SMTP id e88-v6so5158896qtb.1 for ; Wed, 03 Oct 2018 06:52:39 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id u3-v6si921994qtk.133.2018.10.03.06.52.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 06:52:38 -0700 (PDT) From: Vitaly Kuznetsov Subject: Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types In-Reply-To: <20181003134444.GH4714@dhcp22.suse.cz> References: <20180928150357.12942-1-david@redhat.com> <20181001084038.GD18290@dhcp22.suse.cz> <20181002134734.GT18290@dhcp22.suse.cz> <98fb8d65-b641-2225-f842-8804c6f79a06@redhat.com> <8736tndubn.fsf@vitty.brq.redhat.com> <20181003134444.GH4714@dhcp22.suse.cz> Date: Wed, 03 Oct 2018 15:52:24 +0200 Message-ID: <87zhvvcf3b.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: David Hildenbrand , Kate Stewart , Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Balbir Singh , Dave Hansen , Heiko Carstens , linux-mm@kvack.org, Pavel Tatashin , Paul Mackerras , "H. Peter Anvin" , Rashmica Gupta , Boris Ostrovsky , linux-s390@vger.kernel.org, Michael Neuling , Stephen Hemminger , Yoshinori Sato , Michael Ellerman , linux-acpi@vger.kernel.org, Ingo Molnar , xen-devel@lists.xenproject.org, Rob Herring , Len Brown , Fenghua Yu , Stephen Rothwell , "mike.travis@hpe.com" , Haiyang Zhang , Dan Williams , Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , Nicholas Piggin , Joe Perches , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Mike Rapoport , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Joonsoo Kim , Oscar Salvador , Juergen Gross , Tony Luck , Mathieu Malaterre , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Mauricio Faria de Oliveira , Philippe Ombredanne , Martin Schwidefsky , devel@linuxdriverproject.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "Kirill A. Shutemov" Michal Hocko writes: > On Wed 03-10-18 15:38:04, Vitaly Kuznetsov wrote: >> David Hildenbrand writes: >> >> > On 02/10/2018 15:47, Michal Hocko wrote: >> ... >> >> >> >> Why do you need a generic hotplug rule in the first place? Why don't you >> >> simply provide different set of rules for different usecases? Let users >> >> decide which usecase they prefer rather than try to be clever which >> >> almost always hits weird corner cases. >> >> >> > >> > Memory hotplug has to work as reliable as we can out of the box. Letting >> > the user make simple decisions like "oh, I am on hyper-V, I want to >> > online memory to the normal zone" does not feel right. But yes, we >> > should definitely allow to make modifications. >> >> Last time I was thinking about the imperfectness of the auto-online >> solution we have and any other solution we're able to suggest an idea >> came to my mind - what if we add an eBPF attach point to the >> auto-onlining mechanism effecively offloading decision-making to >> userspace. We'll of couse need to provide all required data (e.g. how >> memory blocks are aligned with physical DIMMs as it makes no sense to >> online part of DIMM as normal and the rest as movable as it's going to >> be impossible to unplug such DIMM anyways). > > And how does that differ from the notification mechanism we have? Just > by not relying on the process scheduling? If yes then this revolves > around the implementation detail that you care about time-to-hot-add > vs. time-to-online. And that is a solveable problem - just allocate > memmaps from the hot-added memory. It is more than just memmaps (e.g. forking udev process doing memory onlining also needs memory) but yes, the main idea is to make the onlining synchronous with hotplug. > > As David said some of the memory cannot be onlined without further steps > (e.g. when it is standby as David called it) and then I fail to see how > eBPF help in any way. and also, we can fight till the end of days here trying to come up with an onlining solution which would work for everyone and eBPF would move this decision to distro level. -- Vitaly