From patchwork Mon Jan 13 17:44:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Price X-Patchwork-Id: 13937847 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 49C47C02184 for ; Mon, 13 Jan 2025 17:45:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16A2D6B0089; Mon, 13 Jan 2025 12:44:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F3956B008A; Mon, 13 Jan 2025 12:44:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E880E6B008C; Mon, 13 Jan 2025 12:44:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C45D86B0089 for ; Mon, 13 Jan 2025 12:44:58 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DEA87801F2 for ; Mon, 13 Jan 2025 17:44:57 +0000 (UTC) X-FDA: 83003154234.28.1EC51F8 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by imf14.hostedemail.com (Postfix) with ESMTP id 021D110000D for ; Mon, 13 Jan 2025 17:44:55 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=FYLItdRL; dmarc=none; spf=pass (imf14.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.172 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736790296; a=rsa-sha256; cv=none; b=3sz1qXTNq057Yx+cGItFnFdl5ZKfyBrhGWf7FIp4Km8O8US4HQQ/29wVg6VPrgHeYm6W5F mGs2/G6P4f2fYny1nNHwe17IH863wq2OTv9C9ga5RzjpHtoQ9dy5T4uBQ2141WU6QudNHv XZ0RlkWbTYH3XAqUNXHHKKXiKCE6ZMY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=FYLItdRL; dmarc=none; spf=pass (imf14.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.172 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736790296; 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=yl2EwUT2VKVvGiWjqp0to7EI8yUq6Zt171XOZkuZj5A=; b=v5z4y8OMmPGkNqCU9iBaoDZTX9itecOgp8zjx/DAUBFWTmekiKLWqwNd/yyw9BET8tAw09 +J2zB8pjjgvVkxI0DViQdWvMe1gN4T19KZV1WLcfiy03rc3sueXeoUe2fwTSLVc4S/a5he 9aBJiQXM0elxZ1botgdJojWZzGMt0l4= Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-7b6eb531e13so253022685a.0 for ; Mon, 13 Jan 2025 09:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736790294; x=1737395094; 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=yl2EwUT2VKVvGiWjqp0to7EI8yUq6Zt171XOZkuZj5A=; b=FYLItdRLh22l6v/LHwa+H/t35UbZ740B3kijNu1nORbhlzPt/ChjKxkPBIbTg+2iGx 2F/YyfCoplStLZ168WvJY4OwRxyyhWI69SgsUSyxiC8p7puY7fg/EMQQE3vv8asuK35o 8uqdMzSYld/k0UHkMu04hpVbXW/3DMOfLW05JUtDgb1BpBLqflp4Eg7+lXt+roB8cDzy qicMskeDb1mlW7xSrFf/l+dUc2s+y7mz9+cz7FUKf74c3imRkGckxsj1qnZKgXXiqaDf aQBTylHLpIwc0UkZxb5JdaUwsO4mAGI1zYPhPfISCvwiZOxFZRheS2aKdHb5Q1WUkdu/ j08g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736790294; x=1737395094; 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=yl2EwUT2VKVvGiWjqp0to7EI8yUq6Zt171XOZkuZj5A=; b=SHwIo7gyiAidaNUEhzLOxWAeq2zuqq1TyN13E65trNtbcLAK/o/Qo2H2XduspAyQWm fHPbqLIi+HZ6SaDQO/BugShfA77PD6cdMrQXMAB1pjhdyEcwJmdTqkbZJYcrowvFrtyp V6ihNzDPYhc0W4jyi6FphgTKLzpXzaOLqzj1Ott9+RTELzvjq8oMmEC4Oo+cQLmb7H+0 Sgvw11xC3Diphx7CqkFH7/oBjLfniPT9MxAtX7Gox2CoCefinW1QOzxe8Wyso+yQ/WcF bpj0PfKFpmVbLcCQVsPTuf7NEwfGGQuIUFQ3qsHD0GiWnmVACsFGoMFVNt8Azv6euCCx 65MQ== X-Gm-Message-State: AOJu0YybxbPzUuvFnSicRwYhFrH/3qNKMrR7mD7JZyE3ZZ+RLLkc6HEU eP95m9aeyykSLi3J1okiMDAAut09s5IsrEXzrrhue4Y/9FM0xAIYHF6gwXoa64U0Cen3kDWibuh E X-Gm-Gg: ASbGncuTEjVQCu6y6Zq3zcI+SIjwK/Hr9bgy00noqAKZRf/x/t8GdCtZP/uV1JNLG1D lGCc1IQciiasZ9nCJtrCIcBJI9tZUfGpCfaFJHZi82u0a0AO8Z0jx/7oSdA4Sj4Fj8Km41Rlvqo zjcpLy7wH3iavYtFy6szbhLoHP7g7sc2S+plaN17OEvh3c74iU+qFxMPuq/uYpQNRXSIEcKLeJL z5X0LBvVZt5RdJ8xMKvCaZ6BOhQuo3pRoqmPYpSBgsSxHdfHUpcwVqO4IymbyqlPxQdWX8q+6l/ JNfLEr8GFC1z5y0agXcUGmtXzcQlrnoKoDC7ot3d4+Kk X-Google-Smtp-Source: AGHT+IHjZNO++490q5I1chUVLoFtrxzaVQ8wh+7ZzlHK7PMYF+bXoOp6mvzhXoNAdBo9KngXvoeIQg== X-Received: by 2002:a05:620a:4095:b0:7b6:6b88:cc00 with SMTP id af79cd13be357-7bcd96e8d37mr3639424985a.5.1736790294598; Mon, 13 Jan 2025 09:44:54 -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 af79cd13be357-7bce3248c80sm511214185a.49.2025.01.13.09.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 09:44:53 -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 Subject: [RESEND v7 3/3] acpi,srat: give memory block size advice based on CFMWS alignment Date: Mon, 13 Jan 2025 12:44:39 -0500 Message-ID: <20250113174439.1965168-4-gourry@gourry.net> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113174439.1965168-1-gourry@gourry.net> References: <20250113174439.1965168-1-gourry@gourry.net> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 021D110000D X-Stat-Signature: nbmbiwzmonquh6hojmt8uscdbc81npgd X-Rspam-User: X-HE-Tag: 1736790295-999113 X-HE-Meta: U2FsdGVkX19HTw8LDlw4ZG1/qeEsTiMRC8MJSyVB4C5pmZuD7ekZslGiUz38+KAhvEd9st1uWtr88TyVx95s9jTIi28GScnilQ354q5nJKYtpkudOv/fgJ6pU6mvrov6rj+pSPbmWt+HMCEhYMitjT3q+jVNq0iT1kBfuBCUj2oomD+xrP8W5Vz+mDyPNHoLApMFoMrjIuWFJPW/TbOSdMgJUyhfGwtFHkwfz3NhbbHk4nFzM2pIPfoOlYHHjpRfZKgM1FB/aWXPwMKi3F8XzxSsyFdEb4rHRE5dBlBizZDdsm5k7o7UMXYZC+KFxRXwjpwTx6TjJ+nq8HA0KL361ie9B9RJAu5mOefgA2trIrIWmcEN1haeV/mzJ32WhJNSey2EocdYlKokk9fnDMW+wDLOAMc54fFz5meVCKuSZ3NYjB0VXPK6ialVGAbRXaum4VXaAeUuZdDRtItQZablP0HxgGwnLoi9HVeHm31d7Xiq2GhqVlt1ISkdU/xZF6xgUlvquKQI/p56I2EYqbd8d+g0Gr6hnTTuGo9NsuOqoddYW9GMNYr0l3rGCfl/YMCW+0I93ANzsmvYTB/Mn+kGc4AcR8J/vvjfpqZzpRx3XQr466O69Z/l6vxz+qCfzDrLQXOerVUwlVqlvTboiKQHgq+CKN/zq+lqvtr5fUg84s7sEWLj35x2pS3O3uxu3WA6zNSBCrbgDc7LJnlyrBPYndYKhHMCrE0S3hrjyt9ky/lHwoHck+IgebSl4d1FKJb65bdixPTSB4Jt8VBEslsIbO8h3/swFbx+1HQ/A6+RlhhPO4+SMFM3CoMw7FYy07zBWQANkbQXG1FX6F2DPqExA3FJ2Q9dUXI+GKcMAnj/hT28yjZL1SguQOvD9r3WV4mAwI7i2CAy/ExX0RdEkf8rw/fEQ40btv8STZehVJ1i5zZOqK0iAZosHY3xV4Ap1SRZjwq30iOtCnpDA4oM68O olVwfZ4P Qi0ji0IzFtd73W8A9SQD85J7Aa0yhvxd4BjipKWSlBRDDTbtp/gRm67Dn12dn8xai0PE7Ymn/BrkxfmW9OJYQrZlXHVNHQDb12SsP1iyiyogep3JsNGA41ZzMcayZkJFAyoDLo/7Etz0OtFh2v6CsnIVFP2VQAoP8AZKa9b4NXTbkGKr3eQ5A92JUN+h6fFOI/ryamJ6teBeLFCxiMOLaXNvH3jJKNDGfr/wyGaspQ0bBbrQRJG8wYGbLjjBGVXa4qilbTOdV12xTmCDRxgJkWR4zWjgyvju6dHeJTgIvJiL+cC3YAR2EpJ7GOo1vskbK2PrVNPEJJyl7rxYIwTNjq4kXhtCGIDhJqhP8y+GnJ+3ezjR2Ede9wbIfxyY5u0IIG54R1RxJUQF4FHjrfcBi9V5GeA== 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 Signed-off-by: Gregory Price 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 --- drivers/acpi/numa/srat.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 59fffe34c9d0..7526119fe945 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,22 @@ 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; 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) { + if (memory_block_advise_max_size(align) < 0) + pr_warn("CFMWS: memblock size advise failed\n"); + } 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