Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp450267lqp; Mon, 10 Jun 2024 08:53:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSdDOEKosF3++zY5uVul5q6c0MzBy0aPd7n4KRukgh7zOpVX+tfKh4GdOAC4PVSouggQUgI/xzSpETJFjZucCaV5Ueq3ctxQikY+xzMg== X-Google-Smtp-Source: AGHT+IEXiazjIFQ/VKrh2BNLHznBbBT0u/2NYxh43RhwhqOiyUJHQucHucrOT2Ax4oT/Sc9boK2D X-Received: by 2002:a05:6a00:3c95:b0:704:3678:3f03 with SMTP id d2e1a72fcca58-70436784fa1mr4990913b3a.5.1718034795915; Mon, 10 Jun 2024 08:53:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718034795; cv=pass; d=google.com; s=arc-20160816; b=mW/2zhUQE5Z8PlFnUhyD7rpPY+jh9qN37B15upwRMRefv+nOqRAW3abU+DgyAQFZYg BrqG2MmHMZKlg2iwFwOSWa/xz8XVmzXX8XCKbWRov79pc9Q3Cv397TtliUhYLnxlOI+X iqD/Kpcp2prVzTO4kAbnSAmnrO5M6m6TFoQWpR+jX4h8JEr0LkPwmL8uhFvL7s5Af7u7 ypQDA7Sx5TfOuFQTpe9E+Nmfqp77CwnbpUbG4dl0HKTXB7+sgFpCIRoB6Xplkn+9wGTL adKWS+GbLTH9kfc4lZmP790+ayGgJ0yQB2seE+1AawMuKOCwBW1G1n+YMSJAHR/Vf3SS zLwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:sender:dkim-signature; bh=u3atx2iJ/yoI8yKq05i3Y/SAy7CKrqfXcG/FtiEnceA=; fh=dA4oLJG8B6sBNitGiuqA9aZNLxjrRsGu/A+sYxWlLGg=; b=bvcNZxTSijKrTuEp3u9w1ECkhHe7Zl8O7o4f1VfXkUWgDsTWSBxnViJf7IZKQYqWhn 1PbeiepMWJVmk0Bz+L/sxKNGAzZzmXQOQxW4m4+mJjfqk8fsFzH68MvvTxni9HIptf0q xj6IIcWs5Np0EFxG/is0AvSbbzSZB9rFIAaSFjbK8MROn/F93+ycaFOExeaywojlSRXN 2/3bxZic63g+kCs3kIRMKksXOmuPAxgb5hmJjb23iOhoJQrPIIV9dlwEUvxPcOJLvH5y Q3j7+AkEDPwBbbqk2aWc0KkEldFExJQzRpPIVXqqV69XyaSsHj2yMgN//1u3IYobJkw1 3IBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RCSiqSHb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208447-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-7041a7d4ccfsi5423993b3a.221.2024.06.10.08.53.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RCSiqSHb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208447-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208447-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A9951B2591D for ; Mon, 10 Jun 2024 15:17:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E30D1422B8; Mon, 10 Jun 2024 15:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RCSiqSHb" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EFC01422AD for ; Mon, 10 Jun 2024 15:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032566; cv=none; b=RKYzyO+HUH+Or577YWVfgNhyTVV8G4wKJyItOE6AzW5i9jZWeb9hwUKYOZhFlVZSmU9gWW2vsUzNDXbKWp87cgCXIDzYFDkZyjydx2AkBAJINbRvMr3jsYIbK7FpMcS1Fov+LtjVN3ElLykmO5+a9VcDrckw4eB1VPYp0IHIGe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032566; c=relaxed/simple; bh=X4JtHTKBBPUql6YsZxnJPRHjtdRPv9Gew00ZGGyoQkY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=P7o5iGqfY+ILQ9PyPq39xUslovSFliqF37X/EfXWM/MpnYmIsj/YBHGLZUvCafKepeTVNpkSIpTtj3L19WppfQY85p6koiRel/dYkNGC2szuKm6y+9xwjnobixrGjZXOE/MvG1/MfChXoIzkmnJI+dzm5uexRK5FZXfig23HR+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ooseel.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RCSiqSHb; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ooseel.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1f6f031549bso18626945ad.3 for ; Mon, 10 Jun 2024 08:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718032564; x=1718637364; darn=vger.kernel.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=RCSiqSHb4/BsnycBxESfyE2b1uGQKKz+OeVH5eUt3LyynloK0XZ1959QsW6PcB96ix EHugBDeJS1BLMfMOjwxDt+RtAdjLbra25u7wzTIfW3mfsvwOCmJBAL3FcS2K0wATtXrf uxWJElQt2Rul0j7OTmjOb4PNFsretkUFU0xgnFiUjXHvsprwTIYlkD5cfTjofZ9ytiNM s/lIoPhKMB7ohlZGpf4jVEHBL3xBrMHBAmdRRJwCvzWShHlaQ1zeTRPxxWyZUr4Ooimo vyFVbNunWoCa1bhn3L72pVaizfIS3l6+owBJ9umrhwx2Gzxh+cQvNSFMMk2Go/TW0WPV GWLQ== 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=KPngzqX+/sU2QqyK9vF8JpPSSmWTEAaT7zxAsdPOaJVIK8bOUM44r6M0D8a5oEDq/a oWoiDAxiOEXgKt164G2Xt4edycDfZR74Hmnq7hnLA3N4A8RIWEuSGqvePALxR8KX9aTk L/Q+tSOImWQH1q9NaZTXVOZQgBiA4tVUWxHi2jfDyQph7rOKho9jGw0Eocymcmd14ggO BxZ9utCxcD2UAuZqSa8r/cv1vUuKbqx2ff54GRil/hMZBeDwhORPq4sIvGwkhiiNABER +wcBy3ozzRe1LXBuaspmMDDldY2fg3R2HA47dhksp7NEOyv/1pDUAArr84LaulQlDN/Y LTqg== X-Forwarded-Encrypted: i=1; AJvYcCX9Vdcq2TSecfhNLAwCpsykNrjsPQBOAsIDAm0tlAyzwJQLYWqEEIZ5ige+LfnjK3Fh8xM41a5vY4j2cXhV23eRZASqZH9ocnPMLnvM X-Gm-Message-State: AOJu0YzxnnJxI6m2CSUgYYZuvfNOUHd/OlR0YCRWz72kR47+b7BbiL3E nn2GhGRK5S+pPVKZEkfm8IhGeFz3dRcdC/FcYncPlG8DiY0BI2Uq 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) Sender: Leesoo Ahn 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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; -- 2.34.1