Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp15365lqp; Sun, 9 Jun 2024 14:04:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbUPgK9WFYhibG9wso4zr0XMfkNFUqlS4JcUMYfAM2S8sTE0MalL0Dky44uOU3XTRU6lzTfFZyfM19Y/b//jmXhg34RL9hdHJELvCfHA== X-Google-Smtp-Source: AGHT+IFZ33jZGYOyIF6b5K3/JUOA00lIGde3Ux7vzXkmuA1BgUEF8AqFEFybkCn0ikGcQZe2n2Sf X-Received: by 2002:a05:6870:c386:b0:24f:f45e:5541 with SMTP id 586e51a60fabf-25464525cd7mr9251774fac.24.1717967040129; Sun, 09 Jun 2024 14:04:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717967040; cv=pass; d=google.com; s=arc-20160816; b=i+PQMCaGqT0bbB8qv3pftBcB8NdeaZrbnu/DVH4BuDoN78w4fuXtZm8RheuQ+V9z+P eyl8MIWl13VR+aDAgHYUy3I7EoWa61FX7kWbj6x57cu48p3/ZWB0zREbzuVtPMkkaWP5 LMAXlApaTDWxMfxTxW9MUr+AOcmMc/rZgP9Zd6CVouoXU7GAfRZgmSOTq3rpXoB0FmNn BlgjSWDmTvJmAY73+01+FB1pzZCs7WmDwwYJQ7EHkLfyUgOMOCpswWHN4j+3FHlC123q 9D1T5qfBFcVSZDFVRW3y/O+qiLlZTGD61JtzGT/xIkJYvnH7R86sTeLn83sPkIBdgTvU V7yA== 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=VdH4R7x9GIdAunxCk7uhIduQj7ZfYo4O9UETRYwJbE4=; fh=d7QkY+YKgO/4OHsSuTMwT/Qdj1SEym5Fr2YXcv5K5Ak=; b=JgTwnz6tKVOfNsKs+bSQPBpkMILaDpORA7aPq5KWexKS8WUnGNUUX4PQFWbKM/Un+j NpP/aExmMIp4du8cSEIa18sEJgpo9CwMHD42h49UAag4kr2vAmfCkz9CnV1YbNGjyKKm NjU3B5VkDdDwod1aSJBn6g3vaG1NA06Jqc3el2mqFrUs3e5s5VUlWqLaAfevrHHmu2Jc Zjbs8+Ng2hWcUp/NmuoPfWhY47p8JRVGy1UOizjUZzaEyMD6fjamUxZjBTXb9eg1FG2i TuIR16kdjw3J/cvLl8hW/jrJQ8TL8ECY1Ozun44Jhv2grxquKurxS0AOAkgBPrXYHtD2 3FsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SBXq32p6; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-207510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207510-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-7959ebde2d1si162673285a.772.2024.06.09.14.03.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 14:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SBXq32p6; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-207510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207510-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D3EEE1C20D15 for ; Sun, 9 Jun 2024 21:03:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4434E4D599; Sun, 9 Jun 2024 21:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SBXq32p6" 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 3562D18C22 for ; Sun, 9 Jun 2024 21:03:42 +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=1717967023; cv=none; b=YjKqFvHzwfPJ6qYwPVepRwvDRbINlHwC+3gZFV2u/dzwuUFqFiHjmj6u7CH7F+Ru9yKeNkqlgxYPPM7CEEaGXHbc/pgvqhT2N1CU6LliIutTkiZEKISxY1ZXRPEmqmcvyFCWcWUhvYmgEtjImTqO/xAg+t1KFN1FfLXtD87lzJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717967023; c=relaxed/simple; bh=snGphHJUe+ClJG+1JDmteR989lcPQOPpXI409fVQX/k=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=arFHS/Y6YHtc/1wOoI0jyFWoGOuXwVDiT+2L9jSPdHuMtC/WEWhrByU28wcDzSSUMNKiO/KpPP0eMC4FUS+myUEultY27ZxwvzQMxaO8hrU2xz6hVu4RFZ4to22wX3D0FddxAr1JmTDY1PFNoILjJgHJZi2L2EV/URN0/cBgFmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SBXq32p6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A9DDC2BD10; Sun, 9 Jun 2024 21:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1717967022; bh=snGphHJUe+ClJG+1JDmteR989lcPQOPpXI409fVQX/k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SBXq32p6H/7ickhuNrFoO3gEgYoIeQr/pyGqeAlzxFbLQs0dYYgvFWKSlKBAmWrNW tAQAhRjTr7ccttDKE4J431j2piTjr3rapCyiYmk8guXH/h5Fm464h+l7JwRXF899D9 M8Qxasm9kxcjCRR8T+iPNYtCo/ZPzpWPxDbaocpM= Date: Sun, 9 Jun 2024 14:03:41 -0700 From: Andrew Morton To: Leesoo Ahn Cc: Leesoo Ahn , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: Re: [PATCH] mm: sparse: clarify a variable name and its value Message-Id: <20240609140341.14ba3a1c62029771d60059ed@linux-foundation.org> In-Reply-To: <20240608152114.867961-1-lsahn@wewakecorp.com> References: <20240608152114.867961-1-lsahn@wewakecorp.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Sun, 9 Jun 2024 00:21:14 +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 based on > 'memblock.current_limit'. This can be confusing. Does it? From my reading, this meaning applies to the range end address, in memblock_find_in_range_node()? If your interpretation is correct, this should be documented in the relevant memblock kerneldoc. > To make things clearer, I suggest renaming the variable to > 'limit_or_flag'. This name shows that the variable can either be a > number for limits or an enum for a flag. This way, readers will easily > understand what kind of value is being passed to the memblock API and > how it works without needing to look into the API details. > I think I'll cc Mike and run away ;)