Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp188099lqp; Tue, 11 Jun 2024 01:00:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGjTiR3k2HTKTAqYObskeLcaZp4MEVmVsxtsqaClyy6Q7uhlBRZR6otYxrqGbg1OLKPxqTrvQBhU9DktTqHys2HD2XCRFPBOvENAzpqA== X-Google-Smtp-Source: AGHT+IHuB9Y4URf90CZR1NMc8lnKDieYRFYoHopYlYQyHfP9KXmuCzxrG4o8PRygiXMA/Pux5M/k X-Received: by 2002:a17:907:76d8:b0:a6d:fb80:cbb1 with SMTP id a640c23a62f3a-a6dfb80cc85mr659917466b.60.1718092838989; Tue, 11 Jun 2024 01:00:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718092838; cv=pass; d=google.com; s=arc-20160816; b=0RzSc0O1s6TvWz7MzHgp2/hei2MLixU6l90/yMwbpR9ZZzU1YpIFK4nSlZF18aoESZ UMC0mi4WExUQ3JA/KaBpIAcNuIbArHgrSruXf6W2S3q+v31HqttprrW1tm9jTr0NVUOK 7Zs8KARrAkOIQ2FATRBhpWZV0Vzs5W2OTdRolksGnEOvOV5bKEVDRQfcvC+TQ/JFH63I AtYk5gqNpO16Ac1cmLWykRudQ/sNpsGm8yA0obVEXk+2NfGOJyOh5gC2ruA0xFP4Mcpp e/Yx6z0+wqgtwWsU/1qLILHuQ3ujPGWMUtO96edjW6pH8AjzIKHFFKHjo45/eH622Oe7 NcEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6vFCoGU/o48UdvFKW+ItMahY1/uawvkTxxvFoUNx4lM=; fh=e+nWX/vsq8SMoOyFCniIrnayzLcrh98iRs7ieQ+9BkQ=; b=Ni0ez1O85C4RXk9ftEcy2OV/JMMQ8nttdQM+hLzaLZuWMO9Rsy+Q6YZtlTaJcjUoBX lAshaJJ/PrAGt36NLLaNMyJ90QH8vC2JjebyyTNh3W9205iEFHnMDDWaQ/2ANGZeiMOa sYyEt1lCAQZNsFBrHST7OU2we9t/Ohz2V8HOUsS9lySno3JGtBsjlo2PbdKglGdGVhJS Hk5W5Z3c3joq3d/yaMRNt8jJkcQXp4KXjPH7mMkE9sbieSUWq7Y2p+q3gDuZcV4JuUPp wDnngxBOhyC9PKhqySp9pgs+TL32Px2dazvERUvN72x/gW2zkzncsOcwcJsxC+zxQf3J mPPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BBxarMO7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f04a8290asi324030666b.1032.2024.06.11.01.00.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:00:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BBxarMO7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id E2D431F291B0 for ; Tue, 11 Jun 2024 07:58:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DFAD173352; Tue, 11 Jun 2024 07:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BBxarMO7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 366C817333E for ; Tue, 11 Jun 2024 07:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718092713; cv=none; b=YMBKLcolIOXvY1LShwuiEx4z4UDui9BfPnzcUCXKisTBGqWL05AgVSUzgQTxrTSlXcN46CDypCgAcJOs5hog8nAuNl/LPXKnogwuYUiFswOzEXVYmbYYcPRc/xyK0cwDGR9sdWdmCMFYcuLB+z6kDIYf1tg9WyfNhH5ZIGqWXQQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718092713; c=relaxed/simple; bh=H99vVv9ub0DJP3qHQoowqgVv5mp0f18pTA6aACoo1to=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tdivActrIvmVczZ3S1z1K7WmnYJBuCo1pibYZUXuCbELbAVUBZxej4M103b2jpfEY7zynh/giVuKCcZSHqFUEyFFHXgfbAzLXhhHkZrEanZxuypUelzOet8o7QG+TgP6Pyrwd+8h7QR4+L0s7gzQweg9LpwhCvHYF1jDRwWg0v8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BBxarMO7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB5D0C2BD10; Tue, 11 Jun 2024 07:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718092710; bh=H99vVv9ub0DJP3qHQoowqgVv5mp0f18pTA6aACoo1to=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BBxarMO74u6V3m/bUhzkvkCqjqvOeU19xeLvYt9ai5SYcAaD6Lpe0nm4Gm39WcI8v AinF8TfI1h1ptD9gPu+vBDAh31Wkrb7PZmEPz5HV+bO6zsJ7uaddgoq6Hgm2YHjBJT 01l9hz4WuFEnKSTOii57qgzAGGHBpJ7kUqOfLwJAMN4aFVKLazrXHWWrwlBVHTJfRK 0yuTEi8/tAU8c6bjrL30Mgmug2iXUKS9ohWjdQCOCnP9wRiA3dcJhdqYxQ/PYWmQ2i t2d3PVOC/rBOhQ/NGKsAV2YpBE7WJd8SDs3jHy6ukpYnUhKBWyPuelRKBi8sSfqt5I T+1NtLhjIiRsA== Date: Tue, 11 Jun 2024 10:56:25 +0300 From: Mike Rapoport To: Leesoo Ahn Cc: Leesoo Ahn , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0 Message-ID: References: <20240610151528.943680-1-lsahn@wewakecorp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240610151528.943680-1-lsahn@wewakecorp.com> On Tue, Jun 11, 2024 at 12:15:28AM +0900, Leesoo Ahn wrote: > 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 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; > -- > 2.34.1 > -- Sincerely yours, Mike.