Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1568965rwp; Thu, 13 Jul 2023 12:57:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlFDSYXN8d4FHiG8Yhw9igi6MtI6HM5t9bihi1bnipaHC/ZhzLKZz3nIzzrZAiiVyJFesq3G X-Received: by 2002:a2e:8257:0:b0:2b6:e3d5:76a7 with SMTP id j23-20020a2e8257000000b002b6e3d576a7mr2551235ljh.24.1689278278351; Thu, 13 Jul 2023 12:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689278278; cv=none; d=google.com; s=arc-20160816; b=dNXb8Ix3VZBKyIBLFhrOSRkHT+HMC7w+kNeK2eTbmvfR+pJJWf1Gr2+qKkSUjvcaJB 237cpuV9bmeqJgJjAEoYuDotyPdce0SPOqI9bxbgg7ZTewojpwRJcS6wL7PDyg/URRau 8eI4RDmz/34zi5N7pzft9Oif76+gu5+258shf2tC3HBk+Yby7a32A1df419xtdVRKuuO lv/nw83vdywRdARoYGyjHdsd9WG6E0Pduf1qY4wmPfxxQ//7k27m7eVPzgV82xtzUHaE 5ug6yuL/4bMCPcTop68BAfPOjvxMGVR7aRWlCxC9kbsAVHAycNWgKRQ1j1clfxl4ggXU priA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=mV8Nsc8QqObfioHox/0m6vCcDaS/dZuwe57a5YlQQl8=; fh=XOs4fgs6PTpCnLCGzVW8xIpon4/cqhXLEpzkwne9Oho=; b=Ik4BpN5pp1OrwU2ECCTlBrZptWSUVKRvR5aGDV4jWmBI2bTSFW4muzw//iUSFdydyw ukgMs4UtAmhggVJGk1PCPzE2BkPEePSLEjZAhvjzvKViBx6cWlV2YaF02K08Kg3UaFci BjVoza+uBSvmkgfYInplrgJP6ANQvNJQ7KqdUa6R/NOqNU+eN+o3q25PJGqDXa/59S6L HiRey0AF+a8eaQ5srEKHjBfKknEX0TD0VN/oC+z2DmCM9CZ53H91vpzpalW3k9XSL+gH hOcMt0DAjOK0s1CEhCSNm/9AM4YtH129BqYT3HLMsGj8qHn3OWFBQto7KONhCrGwPd9m rGqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SvNl7Cv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rl18-20020a170907217200b00991c8ce54c5si7592436ejb.178.2023.07.13.12.57.33; Thu, 13 Jul 2023 12:57:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SvNl7Cv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbjGMTHC (ORCPT + 99 others); Thu, 13 Jul 2023 15:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjGMTHB (ORCPT ); Thu, 13 Jul 2023 15:07:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47AC21993 for ; Thu, 13 Jul 2023 12:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689275178; 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: in-reply-to:in-reply-to:references:references; bh=mV8Nsc8QqObfioHox/0m6vCcDaS/dZuwe57a5YlQQl8=; b=SvNl7Cv0fU4acQIjSnpAIkjYmkl2yfzoNEsMri+VklDgnWJUMAw15lyWtDpibXzVlqf/Vp 2oHtVlIIZIz88kI2gNA+pihIKNT+0gm47Eh7NO5LsuYqwqukJsAWvWXo+JHlkxLf6HMhGt Wu7Ewgj6uO0zUGwc5vSs1DPA4ZSoyZc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-iCmcfC-GOe-C3oZCLVi3ig-1; Thu, 13 Jul 2023 15:06:15 -0400 X-MC-Unique: iCmcfC-GOe-C3oZCLVi3ig-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFC588D1683; Thu, 13 Jul 2023 19:06:13 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F0BB111E3E9; Thu, 13 Jul 2023 19:06:13 +0000 (UTC) From: Jeff Moyer To: David Hildenbrand Cc: Vishal Verma , "Rafael J. Wysocki" , Len Brown , Andrew Morton , Oscar Salvador , Dan Williams , Dave Jiang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Huang Ying , Dave Hansen Subject: Re: [PATCH 0/3] mm: use memmap_on_memory semantics for dax/kmem References: <20230613-vv-kmem_memmap-v1-0-f6de9c6af2c6@intel.com> <29c9b998-f453-59f2-5084-9b4482b489cf@redhat.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Thu, 13 Jul 2023 15:12:02 -0400 In-Reply-To: <29c9b998-f453-59f2-5084-9b4482b489cf@redhat.com> (David Hildenbrand's message of "Fri, 16 Jun 2023 09:44:50 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Hildenbrand writes: > On 16.06.23 00:00, Vishal Verma wrote: >> The dax/kmem driver can potentially hot-add large amounts of memory >> originating from CXL memory expanders, or NVDIMMs, or other 'device >> memories'. There is a chance there isn't enough regular system memory >> available to fit ythe memmap for this new memory. It's therefore >> desirable, if all other conditions are met, for the kmem managed memory >> to place its memmap on the newly added memory itself. >> >> Arrange for this by first allowing for a module parameter override for >> the mhp_supports_memmap_on_memory() test using a flag, adjusting the >> only other caller of this interface in dirvers/acpi/acpi_memoryhotplug.c, >> exporting the symbol so it can be called by kmem.c, and finally changing >> the kmem driver to add_memory() in chunks of memory_block_size_bytes(). > > 1) Why is the override a requirement here? Just let the admin > configure it then then add conditional support for kmem. > > 2) I recall that there are cases where we don't want the memmap to > land on slow memory (which online_movable would achieve). Just imagine > the slow PMEM case. So this might need another configuration knob on > the kmem side. From my memory, the case where you don't want the memmap to land on *persistent memory* is when the device is small (such as NVDIMM-N), and you want to reserve as much space as possible for the application data. This has nothing to do with the speed of access. -Jeff