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 27FF5C021AB for ; Wed, 19 Feb 2025 08:53:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0561280213; Wed, 19 Feb 2025 03:53:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B43728020C; Wed, 19 Feb 2025 03:53:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 806CA280213; Wed, 19 Feb 2025 03:53:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5FA6F28020C for ; Wed, 19 Feb 2025 03:53:17 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 495291C91F9 for ; Wed, 19 Feb 2025 08:53:16 +0000 (UTC) X-FDA: 83136079992.29.6C85CEA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id D4CF51A0012 for ; Wed, 19 Feb 2025 08:53:13 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SG5DHqfs; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739955194; 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=Y3RTKbzPGzhYU0bOzSORSMZdnlNJ+TKlrPge/3JxlnU=; b=K7w+2hbEFTEWOUoG8aZDlobJzMDVRbizJgcatcFeKRyhHL9vyt06Bq1OJ97BG9+WzGgxxi 6Vj6XVPTXF2pKqYozgTDYSAMREbvvVmLrbZuE0vsTyZt+ZGwBNbuK1uND7NoIwVISHrEi1 zcw7CFjhVzrmyMFYGzHa/I2ZwT9caHU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739955194; a=rsa-sha256; cv=none; b=22GDt/b/eC9z9YeTldVU5olhYyg0aDi03vmPgDo6lZsGGCt/f2Wv0LEMkWQXYYCs9JMzJx PaoxO1UqeRhGYz+EhNfCHNfSYV8DxrskdnWNgC2MmGWl+L1slxXrSLAs+ynuf2yzHGgkZe emgNLqPG6WsnmZ8ExThJEO0QEhdxknc= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SG5DHqfs; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739955193; 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:autocrypt:autocrypt; bh=Y3RTKbzPGzhYU0bOzSORSMZdnlNJ+TKlrPge/3JxlnU=; b=SG5DHqfsMbSnaW4z4du5598r4Q8fWhzQuvUBGjtpld46rbg88TRyFL0hwvwcj+u5VktWhY eWk4Z/v+8otwyq6VOMQvvDJvrbMF7zZsnVO4c1Ausho8PHbFOhMQR+HNJdg6QrTjTvUD5Z OT8YEcG6sdf0iJ9WOgsjR7P3++ZiEcg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-xhCmYfihP_K6NAE3fenPIA-1; Wed, 19 Feb 2025 03:53:11 -0500 X-MC-Unique: xhCmYfihP_K6NAE3fenPIA-1 X-Mimecast-MFC-AGG-ID: xhCmYfihP_K6NAE3fenPIA_1739955191 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43947979ce8so32995375e9.0 for ; Wed, 19 Feb 2025 00:53:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739955190; x=1740559990; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Y3RTKbzPGzhYU0bOzSORSMZdnlNJ+TKlrPge/3JxlnU=; b=AxWk6vTdp0+buMpvTvuF3yFuO9VTU1F5SDiawa5DYA8Jq5mwnGIp7kjp2pkIwruvRE vouiHGIwlISSXeaqqTAK8r4hgooxkvczVBDjW/fj+91Wv7ZlXTd05bbsCYTDoLu4eCqE av1PMWRbP0t6hpSo1vMoTdIQfg7IoAyB7Bf122MHJQftQIHxFpJ0nML6brnP0+c+NHea wQIlLqA7KcMSyoyu6/t1hrjUPhC8XHYrvNz2mMf+QuF1+Yl8jjH1/HsG50zpQsuDXfnI gknAF+vkGwE+Mgqe9ywfYc+NwTzvxpWfZrU5flZ2PFhL3ogq5IgY/ntOFP+I2Z+QlPyE 2WXw== X-Forwarded-Encrypted: i=1; AJvYcCX6bOnlTj+2Pndbypk+nz5GEvmx7zxVbUz7WvjjH8WG3jyGipMfPVD1VnE309IQY8kl3KIF/wepJA==@kvack.org X-Gm-Message-State: AOJu0YxMP5gvlF3VUtLhdqUaihhYUKH/Zn+MP/c/f8gbkdKgIw1Frk7U LqViaosesBtSBBB9Z4OfqHIZYvI0PwsnRq7hEN/U++lyYh04u0y2yYalKw3+J4AstuHD8CwFD7t ZWxBtrJgVREkzHTU08Rxn2t7zJBb1nToOFpghZyia5Zxd5I9l X-Gm-Gg: ASbGncttDnOpNhL/t4xmmlaq9W5+vzsLmuLVi+QIpJPjmXwBjhiAOjJgNmLhgeLtgi+ /CFlRZlGL+U40mrojWUBrIVpZ6YqvK0BeeOxL2+cwtnt0Ch5Ekd80CH9P5PG7j2W593XRy15zKx 59Qn6j/aGKZbRrbmLVZK4I7yUFkQBq76HBbJC6ZfB+QUfVC5LqM1FRsr85jIYPtAAVlVVS/YrkY 28YEPUBiTS9bl4urFRzsx5Z7NHGS81xmIIHgYACt915H5cBCxqyW2P6+tqejxbVau5Bkx8NuXoy Z3ElhNgZfzI2Akv/lMgXq2aRRer9BVtq7xU= X-Received: by 2002:a05:600c:468d:b0:439:91dd:cfa3 with SMTP id 5b1f17b1804b1-43991ddd1f7mr71014735e9.29.1739955190489; Wed, 19 Feb 2025 00:53:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHx30RG+4JLoDz7Ka+fSqZ4eEfXF8qqBuHgGrd9WrXzZoAldBNNjBxMEAYKQO9+ocdK769P4w== X-Received: by 2002:a05:600c:468d:b0:439:91dd:cfa3 with SMTP id 5b1f17b1804b1-43991ddd1f7mr71014465e9.29.1739955190069; Wed, 19 Feb 2025 00:53:10 -0800 (PST) Received: from [192.168.3.141] (p5b0c68c8.dip0.t-ipconnect.de. [91.12.104.200]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4399c5f901bsm5799465e9.3.2025.02.19.00.53.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2025 00:53:08 -0800 (PST) Message-ID: Date: Wed, 19 Feb 2025 09:53:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: CXL Boot to Bash - Section 3: Memory (block) Hotplug To: Gregory Price Cc: Yang Shi , lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org References: <1b4c6442-a2b0-4290-8b89-c7b82a66d358@redhat.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZgEEwEIAEICGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAhkBFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAl8Ox4kFCRKpKXgACgkQTd4Q 9wD/g1oHcA//a6Tj7SBNjFNM1iNhWUo1lxAja0lpSodSnB2g4FCZ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: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: FWbwX0VZZd8DOP3r8RHXQ7Rk8WA4OGO4OKExOX3gVxk_1739955191 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-Rspamd-Queue-Id: D4CF51A0012 X-Rspamd-Server: rspam07 X-Stat-Signature: r54ayyxgfqkab3tqtppp5ix7szje9zs4 X-HE-Tag: 1739955193-585034 X-HE-Meta: U2FsdGVkX1/BglY9WnnDOpcwO2BFYImW2X+WRKoxHfqU4Csh39xa7HKju0F8SFJS6AXv0ynqLQPaqPE6QDVKlKDb5/I0zXk3Mj5/uWt4CnPg6mHKXU7wSM4vVruvaqerlJY85xpLlR3mTeY6brPwmrZfE7gv4iHZS2q0+w8fzWq4OVDxq3JK2CdP7iSgvqU6AFoIo1kPANKye+0HOjLRy/2Fb0HY1NVBpGMWdvmVyGcVHRrkyCrNOkNPNoBkYUJsnFQRp8/rZW87N+Er2Jtkix1/jJ5dMeepjkUYwEG/qQ1Yp1Th1UC7bIQ23WCVx4inQF+KL3h8OcUF1BAYIpoVJk6TmnItIbXyQxsuk+ejmMsR5HBVFR+FfXKWMb+kYm4v8T9tvCM93b6psBTLDpisX5JLotuDJJQofsVZGc87ejRxssVT9BtvQdqkSm9EXUvoXmKsfYff5RVvVflaiY4tCmXxpHMoQTxSqy7nQPxpPW/nIgGtp0EPUUiKdLkFgH9BMuaFtuHtFHhl12ed0HWNgV3hg8jswgCzz6SZTBmrzEf012W2Ok02tVLSy/rUzcGAP9O2q0UcdQgMLqAxNqxdQ0aTM5FQ8MpZCCaLoLuYOmbCSMuLuNEGAC2tXWhownxzo3oxaPijtwEfDhTOk0slBrGCXwGVRGRT8Lz6SVAdwpdOs8G4ehieVxjoKxv59gpgxAEyqm0nx0kkiTzgAT2v/atwL6mlVZYAGWV3OxeKsACYBDUbb9UUS/Po+oRx505PasnNwLUZRdS4Lq8dN1WPSHk9z5UCWKoGa4UGGStlTY2Mld8whabS0gM7Mkt66XKpEgsoVKmNqjm16BdE/EPLXB7aU0A1HPwaSFlI2n/NflEKOoMOENCt2bmBUidFSd+wH+gyz2ZFbY01JP/lx2DOlvzMaCF2GZpSMaYSohQLtxRW36zt6h6Z+7vGw54soEAXRP+cYFOg1d3AS46bIwz N4Z6Hk+F uaESoLlN5yDYdTWyY1vI/J7UHoQBi5jF1GZXf6giI6KiYyqNTYQ1Lo4exgWKCfXMeX4Wua114DLNJxhHh5myNgriYWhKTCVMqmWaMNGeT8/UouPqdurtc/Izri1/dMkdurOCS7WtMRQybo1aom4Gc5e7VxlVVGCGNQs1iZWL4w0zTK9Hgv00ADvi4+Pb5aTjMnHLHlsyDrJs173dDkgYx+LDjHd7x7eoA735+5HwCLRiXnB3HAqsgULxd3AkheoZOwse6za/UyYMxg02Yd3mLMUv+8MIldE3yb6hcAAErGzAn80XQ1jTzrqrkE6deoOPbcrNeFqh2Er78L+/Pp6uQbfx5YPZz+UGXBzK0YhXYwYXsWX+nhv3+Z8ruQQHb7gaJxbTci0LUjKvcSyCJP2iR4SxSmjhg2bVISygwK1geXJwwoF7jClYSwWtEGn/Q8yoYS7nm5qx5qCVOq646UqzailRIN3UiWXL3lD+ba5TbjEhlC0lmlHCu42r7XnkxYjqQC4ZHsJoImcgotdolIo3a0n/UWmfmcjR06wi2 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: List-Subscribe: List-Unsubscribe: > What's mildly confusing is for pages used for altmap to be accounted for > as if it's an allocation in vmstat - but for that capacity to be chopped > out of the memory-block (it "makes sense" it's just subtly misleading). Would the following make it better or worse? diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 4765f2928725c..17a4432427051 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -237,9 +237,12 @@ static int memory_block_online(struct memory_block *mem) * Account once onlining succeeded. If the zone was unpopulated, it is * now already properly populated. */ - if (nr_vmemmap_pages) + if (nr_vmemmap_pages) { adjust_present_page_count(pfn_to_page(start_pfn), mem->group, nr_vmemmap_pages); + adjust_managed_page_count(pfn_to_page(start_pfn), + nr_vmemmap_pages); + } mem->zone = zone; mem_hotplug_done(); @@ -273,17 +276,23 @@ static int memory_block_offline(struct memory_block *mem) nr_vmemmap_pages = mem->altmap->free; mem_hotplug_begin(); - if (nr_vmemmap_pages) + if (nr_vmemmap_pages) { adjust_present_page_count(pfn_to_page(start_pfn), mem->group, -nr_vmemmap_pages); + adjust_managed_page_count(pfn_to_page(start_pfn), + -nr_vmemmap_pages); + } ret = offline_pages(start_pfn + nr_vmemmap_pages, nr_pages - nr_vmemmap_pages, mem->zone, mem->group); if (ret) { /* offline_pages() failed. Account back. */ - if (nr_vmemmap_pages) + if (nr_vmemmap_pages) { adjust_present_page_count(pfn_to_page(start_pfn), mem->group, nr_vmemmap_pages); + adjust_managed_page_count(pfn_to_page(start_pfn), + nr_vmemmap_pages); + } goto out; } Then, it would look "just like allocated memory" from that node/zone. As if, the memmap was allocated immediately when we onlined the memory (see below). > > I thought the system was saying i'd allocated memory (from the 'free' > capacity) instead of just reducing capacity. The question is whether you want that memory to be hidden from MemTotal (carveout?) or treated just like allocated memory (allocation?). If you treat the memmap as "just a memory allocation after early boot" and "memap_on_memory" telling you to allocate that memory from the hotplugged memory instead of the buddy, then "carveout" might be more of an internal implementation detail to achieve that memory allocation. >>> stupid question - it sorta seems like you'd want this as the default >>> setting for driver-managed hotplug memory blocks, but I suppose for >>> very small blocks there's problems (as described in the docs). >> >> The issue is that it is per-memblock. So you'll never have 1 GiB ranges >> of consecutive usable memory (e.g., 1 GiB hugetlb page). >> > > That makes sense, i had not considered this. Although it only applies > for small blocks - which is basically an indictment of this suggestion: > > https://lore.kernel.org/linux-mm/20250127153405.3379117-1-gourry@gourry.net/ > > So I'll have to consider this and whether this should be a default. > It's probably this is enough to nak this entirely. > > > ... that said .... > > Interestingly, when I tried allocating 1GiB hugetlb pages on a dax device > in ZONE_MOVABLE (without memmap_on_memory) - the allocation fails silently > regardless of block size (tried both 2GB and 256MB). I can't find a reason > why this would be the case in the existing documentation. Right, it only currently works with ZONE_NORMAL, because 1 GiB pages are considered unmovable in practice (try reliably finding a 1 GiB area to migrate the memory to during memory unplug ... when these hugetlb things are unswappable etc.). I documented it under https://www.kernel.org/doc/html/latest/admin-guide/mm/memory-hotplug.html "Gigantic pages are unmovable, resulting in user space consuming a lot of unmovable memory." If we ever support THP in that size range, we might consider them movable because we can just split/swapout them when allcoating a migration target fails. > > (note: hugepage migration is enabled in build config, so it's not that) > > If I enable one block (256MB) into ZONE_NORMAL, and the remainder in > movable (with memmap_on_memory=n) the allocation still fails, and: > > nr_slab_unreclaimable 43 > > in node1/vmstat - where previously there was nothing. > > Onlining the dax devices into ZONE_NORMAL successfully allowed 1GiB huge > pages to allocate. > > This used the /sys/bus/node/devices/node1/hugepages/* interfaces to test > > Using the /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages with > interleave mempolicy - all hugepages end up on ZONE_NORMAL. > > (v6.13 base kernel) > > This behavior is *curious* to say the least. Not sure if bug, or some > nuance missing from the documentation - but certainly glad I caught it. See above :) > > >> I thought we had that? See MHP_MEMMAP_ON_MEMORY set by dax/kmem. >> >> IIRC, the global toggle must be enabled for the driver option to be considered. > > Oh, well, that's an extra layer I missed. So there's: > > build: > CONFIG_MHP_MEMMAP_ON_MEMORY=y > CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y > global: > /sys/module/memory_hotplug/parameters/memmap_on_memory > device: > /sys/bus/dax/devices/dax0.0/memmap_on_memory > > And looking at it - this does seem to be the default for dax. > > So I can drop the existing `nuance movable/memmap` section and just > replace it with the hugetlb subtleties x_x. > > I appreciate the clarifications here, sorry for the incorrect info and > the increasing confusing. No worries. If you have ideas on what to improve in the memory hotplug docs, please let me know! -- Cheers, David / dhildenb