From patchwork Mon Jun 10 15:15:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leesoo Ahn X-Patchwork-Id: 13692212 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 8C823C27C55 for ; Mon, 10 Jun 2024 15:16:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FE836B009A; Mon, 10 Jun 2024 11:16:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AEAC6B009B; Mon, 10 Jun 2024 11:16:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0758B6B009C; Mon, 10 Jun 2024 11:16:07 -0400 (EDT) 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 D88806B009A for ; Mon, 10 Jun 2024 11:16:07 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8B3DAA11C1 for ; Mon, 10 Jun 2024 15:16:07 +0000 (UTC) X-FDA: 82215329574.29.F817E41 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf24.hostedemail.com (Postfix) with ESMTP id A7EC1180014 for ; Mon, 10 Jun 2024 15:16:05 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="P/CWRjt4"; spf=pass (imf24.hostedemail.com: domain of yisooan.dev@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=yisooan.dev@gmail.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718032565; a=rsa-sha256; cv=none; b=ZIuAzrU9mv/j1mPCecbxAm38w1XHt++gADFnWJu5aGZqCy7IkveqzX9rw1FY4N5/DE6klE VAYOvJtyok5W4vxT7mm8GQp0acWJScJtKd9n6xb68oCL3b6UQtDzURbkTTnqMX2rsuRiZp yFou14jmf8wPk9mPBdYa+GNwapcQFjQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="P/CWRjt4"; spf=pass (imf24.hostedemail.com: domain of yisooan.dev@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=yisooan.dev@gmail.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718032565; h=from:from:sender: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=u3atx2iJ/yoI8yKq05i3Y/SAy7CKrqfXcG/FtiEnceA=; b=i43+p2EDeN8AeV8mAsVb/6AIpoD5VzZn8kWI1bOPqw3AkSHP/peJOQy1RHDLa9pTM/YZu+ ptLYbf24DUSLHbBYM8oPL3poQKaRcR6nm+6D1WrjRynemgh2RJuc4EL98wVlzzsjqzltaf GeaSTnJhf5l6pWnDRh0h4tK73118k2Y= Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f44b441b08so34671005ad.0 for ; Mon, 10 Jun 2024 08:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718032564; x=1718637364; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=u3atx2iJ/yoI8yKq05i3Y/SAy7CKrqfXcG/FtiEnceA=; b=P/CWRjt44UTWjqWOJo/hc7lX4PJEic9+azazRv4zKTaeV5s0KO8eGLqmtgbxZMxWA4 ly8U1gw09BJnv1eI/4UM/h3moTSiAdMHMwvOmMWVS6LwBwM3ORfWfFBBi2XAc3XVfRRp doydvQs8qUBpC+54UnwOXb1TrjbK08Vbevhu7sGWuRS2dOdnTe27eoyC7e/zmJ7JTxcE xsU1cjQeOfH7YKGANqIieMxPGcl+NVnUeiQarDiiCOq66qS+Cv2kk/Il6EJXIQDDZLol ty5mjZZGbhONgngpxtQU5CxqlquqUBlUZRQbzyHSFLhnMNEY97D4ncjoXTnEY7MhdHPG CD7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718032564; x=1718637364; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u3atx2iJ/yoI8yKq05i3Y/SAy7CKrqfXcG/FtiEnceA=; b=MlsmPhaOnuWWDg4URQBe4ZCYuRSWliQW5aDY/alj542fnRJrzUPhQzagNuo3rUcsRw uhCn1wOYZsaKDDWDidFW7Eu2pd/uRwB6M1YUjU7f72BeAECnnYKNDfd3pkg7gZD2KyRr W7hOvXeUVN6CLbPVTrYVP0uIr+tbgNqOercc4/hP3wOOKgrGDgGv49heNzn/mvhNx+YS tbvx1hkx04BzSkZmg/m6UvuXCz6i3QmFSJ/2yvyl/Q1U4GxncoZlEVlIjHs5ldL9op5f a6pRTZM5LaQdJPhtAKj6fJS2nCa+3cbOxQYjkfCOFAMHbwP6mkzEEEOF2PixndOiONun 0ZDQ== X-Forwarded-Encrypted: i=1; AJvYcCV941ip0gDqOWNE1ca+0r9CjaFi5TzMpHg1XuWzmZCEKAkSZcxwgh9dsHar+VL3q5uzlWPXhkQYBM9AYzaRgeO2S7g= X-Gm-Message-State: AOJu0YwpHaDgwCslU5UdUCF2ZUpPNZ+n2uku2thEkpFF6ljk4+7ArXZ+ cDgoQSQ3gc5Kfoga4nmGr7Bl+OFKrPdfN6mZrkH7RgBxXRFijpG4 X-Google-Smtp-Source: AGHT+IFu3JEylIFN+CmlzVlSQG94BeMHtKadbl5d4/qtdF/EmBNuEAq9rfzT7KZ3Wbsdvamnl+j8ow== X-Received: by 2002:a17:902:64c1:b0:1f6:daa6:e774 with SMTP id d9443c01a7336-1f6daa6e87cmr74777125ad.61.1718032564191; Mon, 10 Jun 2024 08:16:04 -0700 (PDT) Received: from SYSOS.. ([115.178.65.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd75f2e8sm85378205ad.25.2024.06.10.08.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:16:03 -0700 (PDT) From: Leesoo Ahn X-Google-Original-From: Leesoo Ahn To: lsahn@ooseel.net Cc: rppt@kernel.org, Leesoo Ahn , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0 Date: Tue, 11 Jun 2024 00:15:28 +0900 Message-Id: <20240610151528.943680-1-lsahn@wewakecorp.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: A7EC1180014 X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: z7tbhruujgya96tbdax1agjcp8usu3sw X-HE-Tag: 1718032565-150165 X-HE-Meta: U2FsdGVkX193Lt92egBBkKl61X3JsG9vvFp/IO5vHlZhE2fawd7NKIgFGOGvdvj72dGGzsOWPsykkHs+pEIyXofFe1rk/SVWDnFcEzK5YK4c5Ex1RKk3dZKs/eonD+RH8lDaFfcqYE0AwyX9e6ZeBT+Sp6VxykgBjCCUoscP4EXgl51jnQsmcfYvAb0OhdbKGtkGRJ2EcwkKI6C6fJH9RSQA2Vxq+5uYYP+Irs5ZH8hYjByQtU74fHsHTHtimbjWn6OWzdA/6uBZEnEZqVTNhviA+VlAcI1AOCgaNt4LN6yCSC98hdPfxIkLfUlaaKjFNbCKzETg38oJDsM3c8YfIZ8Soin3jNVEVmlvCyHO7BLbS29S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nUo/hdwPyfV36MBMn16AnQEn/1Tc2OuoB3dDLUcGDamMBfIP7dzLU5s3LVObMFRa1A5PTksnaRuFQVMAYa33eiEizHiJPsKlMmiPnAucyOgl5UGA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000380, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Setting 'limit' variable to 0 might seem like it means "no limit". But in the memblock API, 0 actually means the 'MEMBLOCK_ALLOC_ACCESSIBLE' enum, which limits the physical address range end based on 'memblock.current_limit'. This could be confusing. Use the enum instead of 0 to make it clear. Signed-off-by: Leesoo Ahn Reviewed-by: Wei Yang Acked-by: Mike Rapoport (IBM) --- v1 -> v2: do not rename 'limit' to 'limit_or_flag' --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index de40b2c73406..cf93abc542ca 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -351,7 +351,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, again: usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); if (!usage && limit) { - limit = 0; + limit = MEMBLOCK_ALLOC_ACCESSIBLE; goto again; } return usage;