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 27001C41513 for ; Wed, 2 Aug 2023 15:54:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCD392801C0; Wed, 2 Aug 2023 11:54:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7E0F2801AA; Wed, 2 Aug 2023 11:54:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1FE82801C0; Wed, 2 Aug 2023 11:54:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8FF062801AA for ; Wed, 2 Aug 2023 11:54:14 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7B70A80931 for ; Wed, 2 Aug 2023 15:54:13 +0000 (UTC) X-FDA: 81079611186.14.AEB0266 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 7AE8440007 for ; Wed, 2 Aug 2023 15:54:10 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aSwRfdEL; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690991650; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UtY8YgdOIvB+Y8Vu12vBZ+3g5eOHOZrJmfxbOSMI4po=; b=rlsw6toXRwonAv/whbFfv3G61eNn66S0uvgP9eAnQ+H8gFTGI+BRFfS29tsTzF8rlIlN0k 6qrcz3ZTQqcjOS6WvIJTCooWFnCCQDy+PKUi4wlHkOwXN9Xb31Sk9dhCboEqrITrri6KyF qWK6ynePSpZHOaBp3MonECwT3LBkhY4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aSwRfdEL; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690991650; a=rsa-sha256; cv=none; b=2y3Z7B0qQkVLlQJu40CxRV10K4rMu3Yz/uJG/pB+2/5iMrZXAKtUXQ8xALl/hfGEtdOQfX Dz3cUni4iK4xw0c/ZsPkkYFBbdVxvbTYwJsTVxKvnHAHE2qWUy6hqkLmsPQ6qYdpvWMCBw 3SlhxPSx9MY/9MNE4/RnaykdI+mdIxc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690991648; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UtY8YgdOIvB+Y8Vu12vBZ+3g5eOHOZrJmfxbOSMI4po=; b=aSwRfdELtPF/FJ0KqlQe3Ym3poAgACuaxDo0Z6ordt4FI5jnQmeSUge7Y1DcLfcgXKBfos j9nGRrFf7yrSoojtxAm3VQ8oMK5XvbuD5TvtqYuv+EYrCrlSHJjqg3qJKUZ5a8WKEnxIfv tFo08KwutsGty+1uZ0OqpYhKq87qRKA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-X_SRDnV5PraMQ3UlnG1cvA-1; Wed, 02 Aug 2023 11:54:07 -0400 X-MC-Unique: X_SRDnV5PraMQ3UlnG1cvA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-31400956ce8so3591823f8f.3 for ; Wed, 02 Aug 2023 08:54:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690991646; x=1691596446; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UtY8YgdOIvB+Y8Vu12vBZ+3g5eOHOZrJmfxbOSMI4po=; b=dBNCunk3K33BjBM02xemyvjBAEd2aPpUqwAMX2mlo5nrOTNyVJzhN7QM/ghxyqznjy 4gyotmDUa7+w9BjPu6OmBsm73WJ1EPzTAdY5iUPnXRvzN07Lwr9Mx5Gk7FUl2z20BxEc axcf0J9VtYqblrEIYn8fIxUxThSaCEkPYs1ODkWV4iT3SB35AT6UKH0yzd6egnAtJWOS +rzg7GOAkg8ZfZBaU//YuDzM03mCLxtuyOjpELBvxE2efqoN3AlSO7Kpb8UvVqRGh5Rr ho81PcmzYHrCmhVDSZr+1kv2NbyNc6hNo91oIVnvDHVPlYglWCzgdSJ3xX8QIT50rLV2 Pmbw== X-Gm-Message-State: ABy/qLYA1eUlY/JfnQZd4HnMTOUYTB83bmhruwX1PlWFfTAN5a03B6Hj t2fKpPocQ4fCNKORL24lD0JY9p0zIz2HFiiE46A5ggsxLKG7nTbU/DaDCZo5Wdl/RnzmBOef+RT NOEuLIKOAMTI= X-Received: by 2002:a5d:464c:0:b0:317:5f13:5c2f with SMTP id j12-20020a5d464c000000b003175f135c2fmr4898163wrs.0.1690991646444; Wed, 02 Aug 2023 08:54:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFzzVD2A2bhO++OKlt8DJCnzUArBWQQBSyp8nncjpC/RF8cerJqPgcgFA4FsYjuPBv9bK9oFw== X-Received: by 2002:a5d:464c:0:b0:317:5f13:5c2f with SMTP id j12-20020a5d464c000000b003175f135c2fmr4898144wrs.0.1690991646077; Wed, 02 Aug 2023 08:54:06 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:e00:b8a4:8613:1529:1caf? (p200300cbc70b0e00b8a4861315291caf.dip0.t-ipconnect.de. [2003:cb:c70b:e00:b8a4:8613:1529:1caf]) by smtp.gmail.com with ESMTPSA id f17-20020adffcd1000000b00313f61889ecsm19407610wrs.66.2023.08.02.08.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 08:54:05 -0700 (PDT) Message-ID: <31305ab7-1e65-80aa-ee91-9190c8f67430@redhat.com> Date: Wed, 2 Aug 2023 17:54:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v7 7/7] mm/memory_hotplug: Enable runtime update of memmap_on_memory parameter To: Michal Hocko , Aneesh Kumar K V Cc: 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 References: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> <20230801044116.10674-8-aneesh.kumar@linux.ibm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: 3j19fw9zbhjwo1etag378yuun5sn6k41 X-Rspamd-Server: rspam07 X-Rspamd-Queue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Xm1mFMCJi/B+lAy9HSzdJbeZ2BAgs+LlfkHxxlaby+VV9C91krOlIjQWgUMsRqVQ+41DvxznRBcB27PDDOUdLptKpGUvguH/eMf+WMdtQr0A4eIgKP+7pkAmJcrShb7vuPikGjKgxnY8bAagNZ9b+mEzoijEkPY1W30v0gKJf964dnHqmxVwKy9KroVe1nx+W6PK5g1MbI7PvkLPjfHmPL+3tzvedPwOyGa8h/AiBi/Xogycp5faLWmtrb9CZEkgbg7HlYFbg1T4c2IcKPWBiIXbpAXzsF5qS80cGTkeKfrNr/WUVOxc24STIRbxX+psUMJa/W0xBem4J0fvYa9pTw2xEHN0qZwWMWThRxZqNF0xJaTo/vwpKghMgHyKgwO9NOv34hHEE0nzCv7Ie3quZ2BHN6hR9G8owNyz7jQV4zileg4+3Yt11n/ncPkoF3LLj1Hgq6xLBzoSYRKlBoe+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. 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. -- Cheers, David / dhildenb