From patchwork Mon Jan 27 15:34:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Price X-Patchwork-Id: 13951567 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 CC107C02188 for ; Mon, 27 Jan 2025 15:34:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E3ED28016C; Mon, 27 Jan 2025 10:34:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09478280165; Mon, 27 Jan 2025 10:34:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E03CE28016C; Mon, 27 Jan 2025 10:34:21 -0500 (EST) 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 BD1D4280165 for ; Mon, 27 Jan 2025 10:34:21 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6554C120287 for ; Mon, 27 Jan 2025 15:34:21 +0000 (UTC) X-FDA: 83053628322.23.79EB41C Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf18.hostedemail.com (Postfix) with ESMTP id 8D3221C0009 for ; Mon, 27 Jan 2025 15:34:19 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b="p/uWrEBN"; spf=pass (imf18.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.52 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737992059; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=K2QKacaR1w2J0DOe/2A1iWnNo84Ql16Satbz8d4J348=; b=8EHFIO5kXouFrq97dZB65fW8QtaiP4QO6WMlLhPCOECqW/oZSV3FjGe1zbzlbuU6GtMF3h YmGg1E7AXLskpgqcbcWD2cEx7Y28ywvcb1twudLmiu/eEGqrkwRa9vNqZJPiXxbgHuzT6f KIXrBnZq3J327fRUWtLL4L0vKLuwWH0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b="p/uWrEBN"; spf=pass (imf18.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.52 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737992059; a=rsa-sha256; cv=none; b=ZLnyijgrN6YLAwllrb0tT3eM5TxRPOVBGRtQ9E5tjlsicisO0nSaU2BEjkN0kv3wUV8LQ3 FOkPBNWlAkBeIhh1aZYowwQx5EP1CaKy0j+/A5MXRix41eAWlEaRnMkAi3v9S2f7E2xRCR xcQzgX5RbCKu68ki+2dAQV+xMnPZul8= Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6d8e8445219so41149546d6.0 for ; Mon, 27 Jan 2025 07:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1737992058; x=1738596858; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K2QKacaR1w2J0DOe/2A1iWnNo84Ql16Satbz8d4J348=; b=p/uWrEBNPDsvf6wABOAlm+FRp67OrJLTe81+kXCDPJ5CytuLt4wkl4Gz2DHlDvZMHQ tFLNhv8X6H21xulfhlaGyE45KVektmdQxP0agULQv7vtr4UjI3E8JbMwefd1TSlyuKqK 0xvexJg7iGq3NCakpOUzksoT2Cb0eJNkGyxKkyUKoNpAA7p2TLtmmj+45T8W57DH6uKj +aIfmf8961utw1PyubfESJXQyveZPPpdsY7hm7w2I2YGZMFqk7h3SjO8fksK4qX0SVUG l3llf2EJ5wxU9meVxXDeaT4BNOM7EXoATrPkqsI4l5RgGRplgZk+yf1ld3uW4NDR3bzs uVUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737992058; x=1738596858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K2QKacaR1w2J0DOe/2A1iWnNo84Ql16Satbz8d4J348=; b=tz2GE3WxV4yZyle030Y+gJdfM4e4roQvgCJIKVj1qTqH4DnRA95Grs0/nT7t3q+3hM 38Ybj4XT8iklSsI1u0mSvhsudokOCjZpDPm3NoLgC5YtcZrbUS3gyVEAKE38rowHYO7c Z/7MTG4qO0WTgIVIJC/eiL1zQMtPp4fliQZXbdd72f4Rab1pmBz6Tmim3cxjZkE97twm hltwnIzo43/ACUxiEV+sRhxzjKGrl603nX7ZZQrRQqtafKu4/BDFBxfrwj0EOiHZh/o/ ghQGBdngNleKlV3lhs9AY9eRPZkxq5L69fInfDzJAkxLjuikANL4cG3Ar5foDoOyu5sN rrwQ== X-Gm-Message-State: AOJu0YwewQbLhQsH2oThqA1l+muoVq3ZQV1UCwcdwU7P7d/AwP4M3ssM dJiNHolkuOEpRVLysljYdpPXL+qikIEiIBW2GbJnS4YqmKLUfgPOmP56QvmbA+IJUYbO0G3D+ef n X-Gm-Gg: ASbGncvfR6kDhewiHdgm0k7RdCewgkU1xet14Dg89cC3rPPwFrwRbYFFmoPjG0waN2w 4Z+mkRsnWS7wsLq14QkVX2BBlm4WqvLFsZHVeCTg9CDcXQYeuUbAW4zX/D7aQOst/q8JG3b8YnZ DSdlRCcZ4N4/WgZ5FKg+7JSgL66oQyCcHJCpfHPOkDyIwHm+iblAqeCZ3RwaCCpkKKqc1RzQWsS C6uAa0+CqUQfUd9W8FnXofJDLn2iaOvHq7+7LTFe0Q6wVj7hUrcYIK5cZVqUhu19dBXNn0l5bO5 VG2cnttz8v8HYGhW97SSqYDA2aFWQuL5moNXDHqmSaiS0PPhkKKRDpTUc/jCGRdIh8/U X-Google-Smtp-Source: AGHT+IEloh1Kwttg6pCvanJlLHnirCN2YmmH2PFhQey08HdVHFNPfJ5MgRHGu5KGGQRd7g7bqkubRw== X-Received: by 2002:a05:6214:2584:b0:6cb:ee08:c1e8 with SMTP id 6a1803df08f44-6e1b21b7b81mr667790436d6.23.1737992058363; Mon, 27 Jan 2025 07:34:18 -0800 (PST) Received: from gourry-fedora-PF4VCD3F.lan (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e2058c2a51sm35380476d6.109.2025.01.27.07.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 07:34:18 -0800 (PST) From: Gregory Price To: linux-mm@kvack.org, linux-acpi@vger.kernel.org Cc: kernel-team@meta.com, x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rafael@kernel.org, lenb@kernel.org, david@redhat.com, osalvador@suse.de, gregkh@linuxfoundation.org, akpm@linux-foundation.org, dan.j.williams@intel.com, Jonathan.Cameron@huawei.com, alison.schofield@intel.com, rrichter@amd.com, rppt@kernel.org, gourry@gourry.net, bfaccini@nvidia.com, haibo1.xu@intel.com, dave.jiang@intel.com, Fan Ni , "Rafael J. Wysocki" , Ira Weiny Subject: [PATCH v8 3/3] acpi,srat: give memory block size advice based on CFMWS alignment Date: Mon, 27 Jan 2025 10:34:05 -0500 Message-ID: <20250127153405.3379117-4-gourry@gourry.net> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250127153405.3379117-1-gourry@gourry.net> References: <20250127153405.3379117-1-gourry@gourry.net> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8D3221C0009 X-Stat-Signature: uqdb5twpywxo8sh49gi5t8fkgpkjeaff X-Rspam-User: X-HE-Tag: 1737992059-304905 X-HE-Meta: U2FsdGVkX1/My9hqwq195vVR5ZQY/a6egflouoQjLBqQrZmLSf/GpqEF9HA53OsUUxGTQCkqHWBvgMAtRyF7/WvXO6kIKeZ07/33958NvKlAoazDlp3y+Yk88oIkPMyOzdrF8/tXL7YRQfhS+8/ifOguHNHOeGjunWJ3uxREWpyDFDf3C5r//rDaOtLnxQKCMkX/EbD1wQu96DTZ7MWuKaebmf3eNO1onNZsKLj4+7cpikDJ4Ubxn6miJYogl1dkQipEo21XjZiD2LD2QauzeD/AefSUqzImjUEEcS4qJqC7fAxj65zcN9TQXdmU5lE/08OD4DcZ4Rb9AJoflJexnVh9t68uN3Hsv5kR8G8sXmO+H/U+7f1d+tU/1JS7vDKy+yslD1D0prJpRkQREv+03Tcdsr2oH0zWLoQceWZ39o6nYxqJ3HuX0lKSXl+MTgCUjLTR0511pAgrYMMT/g2w2Cyx5I8zxvqlKV+wJCALfCVLh2RY3xwAwJmTkQGsCLpgHsVdQm3vmQRKuqm74+F/mGwNy6HSK8LT694b24cUr4zm8MqXRYzNQ1B09Qp9KDeTVAjDMXCrvXaGAKZJOlqAU++qjeJFQh9GUOxjqCDtV86YSvyyO1J5h95+oQ9qj928ywidNTAhPlOKqogD25xoSC6Gzn6Syl6RdujWRKpb6WkfxhaUA3xz1rKDhF7+XSA6+1gaK2LbX6AHTcXzM4IdcjwCwjW2HSVglBxOVOuFfVre1NNW9U9AJ8QvGxsnwcpgxyMpXK6EqBhQNGweK5m24ClJ3l3BSVRLo9V7k6Cb8U1f6poOzUhYYxwi+eNVu4z46EbcSMzOU/73MStmfijKl16nPr2NBibglypiQ75aOMJJZZ9Y/DK7eDg/HZA3NWN2ElEde+etyNDxo3Dt7X+aAWdEw3xmQejhPFHT4BLKuqBpREVRq5ltOyyderM8tjlWxXgGAF0xVZMEqzCbo9l T3OI/pLO iTC3+6wAyxCrDvR67n8K2z5/rjbEQgoBHq6Hs5M83lKuURACub4UelZfPNSaYtB3SkyuxOFOCAd0pPMYtvfonf7NvURGkx8OxiwgZDwMjuPwgNrGk88ZyjLhurwJR0vLZAD85fnf9NW1QnRBZmZ5A+HqC21Pfx3xdREB4nTF48tN4pfct9kfXO4r8ihR4b0+wqnh+AmBeveR0/HNy8uvUFNNJSda8lnwNHWBCpA4T+qBZywywkG7SEqJESqHE322zSnoiVsr9/VHJqArW1bsIbAi3R4KiX5RiTCqnJix9+PjuFIvJ8M9eTv/+qmWGXbvL/unqsfrkgFTUW1MRmPPmTJNU/PCvKD3qxmP3vvvXqBwe7ia91EuNmH2O+D83xH4SOLYcZ7Fy1gcGgi7wci6MqcRKOw== 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: Capacity is stranded when CFMWS regions are not aligned to block size. On x86, block size increases with capacity (2G blocks @ 64G capacity). Use CFMWS base/size to report memory block size alignment advice. Suggested-by: Dan Williams Acked-by: Mike Rapoport (Microsoft) Acked-by: David Hildenbrand Acked-by: Dan Williams Tested-by: Fan Ni Acked-by: Rafael J. Wysocki Reviewed-by: Ira Weiny Signed-off-by: Gregory Price --- drivers/acpi/numa/srat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 59fffe34c9d0..1501a9bb3936 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -425,13 +426,23 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, { struct acpi_cedt_cfmws *cfmws; int *fake_pxm = arg; - u64 start, end; + u64 start, end, align; int node; + int err; cfmws = (struct acpi_cedt_cfmws *)header; start = cfmws->base_hpa; end = cfmws->base_hpa + cfmws->window_size; + /* Align memblock size to CFMW regions if possible */ + align = 1UL << __ffs(start | end); + if (align >= SZ_256M) { + err = memory_block_advise_max_size(align); + if (err) + pr_warn("CFMWS: memblock size advise failed (%d)\n", err); + } else + pr_err("CFMWS: [BIOS BUG] base/size alignment violates spec\n"); + /* * The SRAT may have already described NUMA details for all, * or a portion of, this CFMWS HPA range. Extend the memblks