From patchwork Tue Oct 22 18:41:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Meyer X-Patchwork-Id: 13846028 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 C3473CDD0C6 for ; Tue, 22 Oct 2024 18:42:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5E706B007B; Tue, 22 Oct 2024 14:42:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D0DE86B0082; Tue, 22 Oct 2024 14:42:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD5C06B0083; Tue, 22 Oct 2024 14:42:31 -0400 (EDT) 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 9C3336B007B for ; Tue, 22 Oct 2024 14:42:31 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 67FBFAA053 for ; Tue, 22 Oct 2024 18:41:58 +0000 (UTC) X-FDA: 82702108440.12.3756DA2 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by imf06.hostedemail.com (Postfix) with ESMTP id 6B10F180003 for ; Tue, 22 Oct 2024 18:42:17 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=hpe.com header.s=pps0720 header.b=TlBFr739; spf=pass (imf06.hostedemail.com: domain of kyle.meyer@hpe.com designates 148.163.143.35 as permitted sender) smtp.mailfrom=kyle.meyer@hpe.com; dmarc=pass (policy=reject) header.from=hpe.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729622348; 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:references:dkim-signature; bh=g2sdBQDg4t2kpRPBBz9oL8e9hRetJBRpVWhNycTyKEs=; b=srpfRd/40GQTU+8o8xt3Et48kgNXpFhXPFHTprNEZB0Rli74wPYPXcfsifI4aQIGN3LbKu P9LcM5sBvgVCayXoD8t1IjsX1QsONuPCxBZUdSHN84+QonRo//Wjf+LP6G3lzBbMnqWuw6 y37rXa8ZV4Hp+szYbqxTfx7AediEACs= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=hpe.com header.s=pps0720 header.b=TlBFr739; spf=pass (imf06.hostedemail.com: domain of kyle.meyer@hpe.com designates 148.163.143.35 as permitted sender) smtp.mailfrom=kyle.meyer@hpe.com; dmarc=pass (policy=reject) header.from=hpe.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729622348; a=rsa-sha256; cv=none; b=svdCH/RNenUj7HzvryPmnzJBHh2ha9zOOTlPIDtAJxns+wM7/cxvh+sOXavUEqvGlEzvuc y/TqcELbaOYqvJciLS2jkqgWDkMJrjQt3CBFAyOcQfhLkhFDPP3r1tvctWBUvoqAO6j/0/ +wxn+GRIcPk88A6PzAaRgkhzvWwyIIY= Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49MEv5pr026824; Tue, 22 Oct 2024 18:42:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pps0720; bh=g2sdBQDg4t2kpRPBBz9oL8e9hRetJBRpVWhNy cTyKEs=; b=TlBFr7395SQMov+EbbDY4RrWR1fFklkGYyqFBkzOHPYRI9pAagbOT OynAVCZ3IjpkQJcB3qTlGPQXwJvWmjZOgvd9Llt6l1ksyv6LUVEfMUpEBy34P79k lYXjOVtCsI+rMqSQOaxXVRWVoS4uBqRpvljqyAahMqvO+zBD1mpwY6djV5Gq2aWA 7GfcmVbN6xyctO0+e6WiY3iiv9twyfYWH2/e0hHSPqK2MVLvEBsHX9ty9FKD1kT9 sWSUuUVF8YLFMU5v+8VokurP8kcNLhCLX75SZZCwtmaMxmnbx+57+vVuTJH+wi8b Ji0jaBInyiChgiJk0B6D+s5kg9ZstSVMA== Received: from p1lg14880.it.hpe.com ([16.230.97.201]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 42ee8ujxft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2024 18:42:05 +0000 (GMT) Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14880.it.hpe.com (Postfix) with ESMTPS id 83BDA800EA2; Tue, 22 Oct 2024 18:42:04 +0000 (UTC) Received: from cat.eag.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 2A04A809AB9; Tue, 22 Oct 2024 18:42:04 +0000 (UTC) Received: by cat.eag.rdlabs.hpecorp.net (Postfix, from userid 48777) id 902E8B490D; Tue, 22 Oct 2024 13:42:03 -0500 (CDT) From: Kyle Meyer To: akpm@linux-foundation.org, rppt@kernel.org, david@redhat.com, dan.j.williams@intel.com, Jonathan.Cameron@huawei.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Kyle Meyer Subject: [PATCH] mm: numa_memblks: Don't skip reserved areas before DRAM Date: Tue, 22 Oct 2024 13:41:42 -0500 Message-Id: <20241022184142.5691-1-kyle.meyer@hpe.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ZDrAeCQeCFgs6QkC3h2qUKXEFeqjPrmn X-Proofpoint-GUID: ZDrAeCQeCFgs6QkC3h2qUKXEFeqjPrmn X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-05_02,2024-10-04_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 mlxlogscore=855 impostorscore=0 phishscore=0 malwarescore=0 mlxscore=0 clxscore=1011 priorityscore=1501 adultscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410220120 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6B10F180003 X-Stat-Signature: wt9oddwjqohh56j737icwhbjw7djwpk8 X-Rspam-User: X-HE-Tag: 1729622537-209954 X-HE-Meta: U2FsdGVkX195OPfomrbKpwgqQmn1zMSPSLUAZps9mPxS0m0yZEK/FpWLwfjfMuQ8JpagCgIIadU7I5A1oTyBx78DMQtV/8q8utlmEq8SpMuRX4zfgKNREVge2ouuIbRk5e/X1zdVUAydJ+8EyeVsu421cFEAfmrSNdRQ7EI37guYoxY6BUB4qeKuhhfGLFWKsZjJJn+j4OCiKikJpKQ73oKpJFwvQM4KmEs00Uws6dF1ixjrm4MExFYk5gSaXWMlNBPwhKoz8DiPxHmxCEa4oHOmZAbo9mr+LlOmAzj91oXBVTP7HjNFCy0Q7kGPAdS0NsWo130vuMeU1TwXbZR7rGzUsCBLxJgDhISQFQFMFcEE5MbiFCCfY9FwEDGtSCQhmR5E8UeCtPBm9TqIvEBNBDFSuyfbM6dqZoKT24b6S+q/0B4FOGtrmBE+H01fU3Zmw3oYnn9dkUZYoTzew/rTtrN5XVn/KsSy5xHms3KpsV5Oj01KrDQ5fXzMAQpT3svVq2n9PGxxii4mHGZLoEtTYQ9WWsiJVacmalmDKhyRUgooE8f4nn/Zws50gPH2OpQoxvGdKvIJ8y3ly1BweOZogeeYijUNOb6xfixrbtVx+BzWaW6u0Uty9hFgfF7y/k0z3JxhF3jDy03KBTSb2JElyl8/vV9w0GGenbwqMCRpBNHiVCfxzDfBeJ3RlLkDWDh8P8H4XIDQXnI1SFuN2FhSxM8STWDp5a1Idiuefpmxin5OntbEL7iNVEfliXo6D73qRsjsOvutfBGuU+/90nr0YXMqajWLNwbXXQQA+mX3VkqrmyncUZEBncGFZmeX/rSva6laEfZzKGhqFlwLBwt3pXmvTckrHazmoaTzzhV6QS/5C2KQqPbssZHcd7s2/vcYfZa9rPjzcKAI0DAkcJycthn34gcGGpsBV+n7BjI2FHZXW9cY2bncGaXhWK/ZPzEWJ1MTUA3kMdgZOTZU+gh pW4XuNtX uCi348jV1u9DV+1yuNCPr8r407joN2fqoDqdYOB7BS7g97JlDF1OuU1j3Co0exd0nyQGp/1FI1CIACDJcE58EjLYbST2hQLjndp9Gda+cGs/gpXEG+Rq9Phg915ZxtZmwieVhsTG5PEVXCook3KKZUI8jV3U9M4RGxSroZEcmslzQRBRMD9rSq3Lhxejpf4mKTQRfKqoHeclvRAG+CglGUmdloRdOAZEW+jt502IQaAcRhIhFN1Edu7WqVydraOHEptsA 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: memblock_start_of_DRAM() returns the base address of the 1st usable memory region. Reserved memory regions can start before that address. Instead of skipping the truncated portions of NUMA memory blocks that start before DRAM, add them to 'numa_reserved_meminfo'. Without this patch, reserved areas present in the SRAT before the start of DRAM are not assigned a node ID. Fixes: f7feea289f9a ("mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo") Signed-off-by: Kyle Meyer --- mm/numa_memblks.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index be52b93a9c58..384397d39d6d 100644 --- a/mm/numa_memblks.c +++ b/mm/numa_memblks.c @@ -227,10 +227,14 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi) continue; } - /* make sure all non-reserved blocks are inside the limits */ - bi->start = max(bi->start, low); + /* preserve info for reserved areas before DRAM */ + if (bi->start < low) { + numa_add_memblk_to(bi->nid, bi->start, low, + &numa_reserved_meminfo); + bi->start = low; + } - /* preserve info for non-RAM areas above 'max_pfn': */ + /* preserve info for reserved areas after DRAM */ if (bi->end > high) { numa_add_memblk_to(bi->nid, high, bi->end, &numa_reserved_meminfo);