From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 585A8C04A6A for ; Wed, 2 Aug 2023 16:59:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C62F2801C6; Wed, 2 Aug 2023 12:59:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 876642801AA; Wed, 2 Aug 2023 12:59:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73DBA2801C6; Wed, 2 Aug 2023 12:59:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 61FCE2801AA for ; Wed, 2 Aug 2023 12:59:11 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3740C806B8 for ; Wed, 2 Aug 2023 16:59:11 +0000 (UTC) X-FDA: 81079774902.04.537AFFB Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf09.hostedemail.com (Postfix) with ESMTP id 8783B140018 for ; Wed, 2 Aug 2023 16:59:06 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Y6mEFfRD; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690995548; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Vw999DL8KBm20PpuKx0JYdGZA0mLNGxSfOEO9Movnd4=; b=J3lc7gI5DUvpW0jJcoPzIRGCkxcg/nMLxcTk532+NMuTcRyjNMw6IZqXy3uMgPVYog9gwj wjDEMDAk8cIKwjpeDXBm+OpNIIAWLq2NftbtyFjaZtI63KrRT50YeRc/Y7KNb8s+mj1Umi 8nOPnVgixUoFiZvkZIjNi4phdN+K1lU= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Y6mEFfRD; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690995548; a=rsa-sha256; cv=none; b=jXqwqH1Yo62Au4k1pDz4akvPHkhH5hv9n3NJfIhreSMKoKRM4bx+2mlABHWq7W62IQmzs3 nen5c9suyfbUqb4Kl2miVySn97QPO54sY6pa9xRqtPLunLHrWV1/CH7a/PowThFOSlSoX/ PBb8bVVMsAjWrXWcWZUxeoupIJSiP14= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 33ABA21A08; Wed, 2 Aug 2023 16:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1690995544; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Vw999DL8KBm20PpuKx0JYdGZA0mLNGxSfOEO9Movnd4=; b=Y6mEFfRDvZNvsEMSiD1VjIKV1h2/nAqDp9ze8JHgob9J9s4E41UuITgETayl76qIXK32Ru 7xOcCxYWLvt77Aevr1adaKQvjFGjE6jDaelo/C1/hi8iCzyKMVd9kxvgLnYTPT2f4VydJI Izh82rWhATVd0BZZvnGEDOplM/EfNuU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 14F4A13919; Wed, 2 Aug 2023 16:59:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id d1b2AViLymREWQAAMHmgww (envelope-from ); Wed, 02 Aug 2023 16:59:04 +0000 Date: Wed, 2 Aug 2023 18:59:03 +0200 From: Michal Hocko To: David Hildenbrand Cc: Aneesh Kumar K V , linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu, Oscar Salvador , Vishal Verma Subject: Re: [PATCH v7 7/7] mm/memory_hotplug: Enable runtime update of memmap_on_memory parameter Message-ID: References: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> <20230801044116.10674-8-aneesh.kumar@linux.ibm.com> <31305ab7-1e65-80aa-ee91-9190c8f67430@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31305ab7-1e65-80aa-ee91-9190c8f67430@redhat.com> X-Rspamd-Queue-Id: 8783B140018 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: bu9tzccespcr41ttuonkcfkqcurpf743 X-HE-Tag: 1690995546-517255 X-HE-Meta: U2FsdGVkX1+cl/RQelxQzCxtQBSVfNaEsws9QBv13o7CTy03Jc37bb66CtsFCCiAYt8kdJeDud5aOoslUzk+iWbtGbUKs7rr3kGJHy3DRjDL+TcwI2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ybLbnOGNDosiQREWqygH2oSDohVhhQFUmiNHFfnIEITV2cWrQWzxYj6NgKbfB9cxZw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 02-08-23 17:54:04, David Hildenbrand wrote: > On 02.08.23 17:50, Michal Hocko wrote: > > On Wed 02-08-23 10:15:04, Aneesh Kumar K V wrote: > > > On 8/1/23 4:20 PM, Michal Hocko wrote: > > > > On Tue 01-08-23 14:58:29, Aneesh Kumar K V wrote: > > > > > On 8/1/23 2:28 PM, Michal Hocko wrote: > > > > > > On Tue 01-08-23 10:11:16, Aneesh Kumar K.V wrote: > > > > > > > Allow updating memmap_on_memory mode after the kernel boot. Memory > > > > > > > hotplug done after the mode update will use the new mmemap_on_memory > > > > > > > value. > > > > > > > > > > > > Well, this is a user space kABI extension and as such you should spend > > > > > > more words about the usecase. Why we could live with this static and now > > > > > > need dynamic? > > > > > > > > > > > > > > > > This enables easy testing of memmap_on_memory feature without a kernel reboot. > > > > > > > > Testing alone is rather weak argument to be honest. > > > > > > > > > I also expect people wanting to use that when they find dax kmem memory online > > > > > failing because of struct page allocation failures[1]. User could reboot back with > > > > > memmap_on_memory=y kernel parameter. But being able to enable it via sysfs makes > > > > > the feature much more useful. > > > > > > > > Sure it can be useful but that holds for any feature, right. The main > > > > question is whether this is worth maintaing. The current implementation > > > > seems rather trivial which is an argument to have it but are there any > > > > risks long term? Have you evaluated a potential long term maintenance > > > > cost? There is no easy way to go back and disable it later on without > > > > breaking some userspace. > > > > > > > > All that should be in the changelog! > > > > > > I updated it as below. > > > > > > mm/memory_hotplug: Enable runtime update of memmap_on_memory parameter > > > > > > Allow updating memmap_on_memory mode after the kernel boot. Memory > > > hotplug done after the mode update will use the new mmemap_on_memory > > > value. > > > > > > It is now possible to test the memmap_on_memory feature easily without > > > the need for a kernel reboot. Additionally, for those encountering > > > struct page allocation failures while using dax kmem memory online, this > > > feature may prove useful. Instead of rebooting with the > > > memmap_on_memory=y kernel parameter, users can now enable it via sysfs, > > > which greatly enhances its usefulness. > > > > > > I do not really see a solid argument why rebooting is really a problem > > TBH. Also is the global policy knob really the right fit for existing > > hotplug usecases? In other words, if we really want to make > > memmap_on_memory more flexible would it make more sense to have it per > > memory block property instead (the global knob being the default if > > admin doesn't specify it differently). > > Per memory block isn't possible, due to the creation order. I am not sure I follow. Could you elaborate more? > Also, I think it's not the right approach. > > I thought about driver toggles. At least for dax/kmem people are looking > into that: > > https://lkml.kernel.org/r/20230801-vv-kmem_memmap-v3-2-406e9aaf5689@intel.com > > Where that can also be toggled per device. Per device flag makes sense to me as well. But what we should do about hotplugged memory with a backing device (like regular RAM). I can see some reason to have large hotplugged memory ranges to be self vmemap hosted while smaller blocks to be backed by external vmemmaps. -- Michal Hocko SUSE Labs