Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1396825rdd; Wed, 10 Jan 2024 19:35:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPAmu3jUqqdx7v6pChvqPvVHFa2g9Pce6kZcz7WM+KItXvBVTd/Hs3EUYSzHT6hMiI53r9 X-Received: by 2002:a05:620a:821f:b0:783:167f:1677 with SMTP id ow31-20020a05620a821f00b00783167f1677mr779682qkn.23.1704944111864; Wed, 10 Jan 2024 19:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704944111; cv=none; d=google.com; s=arc-20160816; b=qI/jBnIDMxwiAiQneRU38Tg47hwciFkqdbAD7ZUWYah8qsLKYKCcEOlWFlZQMjhdEU +hmBP0hTDXWu4b9HN1INNkhB2noQWMukvoVSjwQBtWqZCb/OqQ9liP71QItSH07Z/f4r BZuW/pMFl1JrHqOEf51B+wZLPAhx9811aJssC3hcjRjTM9DFMYVL5CrbJ5KPxhmYUDSL M5AlC8i4j2iUytXN6m1xBZ+y7Y99tjx+CaXswjYrO9UdkDDHEFJVJRYBptW0SW3YXnO2 N0fx6Wbm1CZJtZzxaGeuIF5ysE8B8y/1Ac7W8MHG8t/e22Qda/YZLtnUDPK0iPbrxXCc ZTPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=EhHrSgkO7aZS8gS4QgDVlSfOXoB9Gg7ntyWbIFGpcNg=; fh=EtOIirwc6Cu+Ppf65utr+Agbko9mSR04w2DUXoDmk38=; b=Y9cY2jWWVNxImZ0Osve1i8FzJ/BmusfWqhCB85JNVzFMQvf8GEnnuJMxQCSD9wOxru IGZWkFKwCpqxzeLTNYDXmBXyhjSaKvbTjjn1x5JalYYeT+dy+vHzcKa0q2zBsBZ8rjuC w/cotba0hgmKAGG7Qs01ijaMYlrL9ihzHSbtnMt0AzdYwf+nEMoJiTtFvaS1Rebp2JAF 1/4yX8JXdexgGp4kq21HEPWDvSXqbnjpscOJrKYDt/iKXciTY840PggNOFQP9arJK4FI NU0lzeWEeP8zs0UTUQKu/WOY/ftN0Wf3Rh+cQA24DgfYA9AJbldl+qQglYU/03B1ko+C bsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SigsKEqd; spf=pass (google.com: domain of linux-kernel+bounces-23034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id os27-20020a05620a811b00b007832fa54a5csi146553qkn.716.2024.01.10.19.35.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 19:35:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SigsKEqd; spf=pass (google.com: domain of linux-kernel+bounces-23034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 9E5411C22FC4 for ; Thu, 11 Jan 2024 03:35:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E163ED4; Thu, 11 Jan 2024 03:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="SigsKEqd" Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 3E141EC0 for ; Thu, 11 Jan 2024 03:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704944101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EhHrSgkO7aZS8gS4QgDVlSfOXoB9Gg7ntyWbIFGpcNg=; b=SigsKEqdmubuTyBpozylpZPLXPD8HcrWElSpfXXYbNRHuzskLowdEcJ/ElaFn35L3+LB79 91ynDlfmbds/omwHe0ohPC5FxscOWaDoIXDc8LGXUfY26QdnJdtCjpvSaGUfAZ1vLxNtmS l1z7T/zA0iklA3Xm/0/P+8EHrRWIYcI= Date: Thu, 11 Jan 2024 11:34:32 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 1/7] hugetlb: code clean for hugetlb_hstate_alloc_pages Content-Language: en-US To: Tim Chen Cc: linux-mm@kvack.org, Mike Kravetz , David Rientjes , linux-kernel@vger.kernel.org, David Hildenbrand , ligang.bdlg@bytedance.com, Muchun Song , Andrew Morton References: <20240102131249.76622-1-gang.li@linux.dev> <20240102131249.76622-2-gang.li@linux.dev> <46769d44703b2f8d2e279d6e95db960c8a87e39c.camel@linux.intel.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Gang Li In-Reply-To: <46769d44703b2f8d2e279d6e95db960c8a87e39c.camel@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2024/1/11 05:55, Tim Chen wrote: > On Tue, 2024-01-02 at 21:12 +0800, Gang Li wrote: >> The readability of `hugetlb_hstate_alloc_pages` is poor. By cleaning the >> code, its readability can be improved, facilitating future modifications. >> >> This patch extracts two functions to reduce the complexity of >> `hugetlb_hstate_alloc_pages` and has no functional changes. >> >> - hugetlb_hstate_alloc_pages_node_specific() to handle iterates through >> each online node and performs allocation if necessary. >> - hugetlb_hstate_alloc_pages_report() report error during allocation. >> And the value of h->max_huge_pages is updated accordingly. > > Minor nit, I think hugetlb_hstate_alloc_pages_errcheck() is more > descriptive than hugetlb_hstate_alloc_pages_report(). Thanks! This looks more intuitive. > > Otherwise > > Reviewed-by: Tim Chen >