From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB7AC433E0 for ; Fri, 5 Feb 2021 08:39:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AA3164E0B for ; Fri, 5 Feb 2021 08:39:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AA3164E0B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C9DC26B0070; Fri, 5 Feb 2021 03:39:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C74DA6B0071; Fri, 5 Feb 2021 03:39:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB4AF6B0072; Fri, 5 Feb 2021 03:39:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id A6BF26B0070 for ; Fri, 5 Feb 2021 03:39:41 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 780603635 for ; Fri, 5 Feb 2021 08:39:41 +0000 (UTC) X-FDA: 77783565762.11.net71_150801e275e3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 55F98180F8B80 for ; Fri, 5 Feb 2021 08:39:41 +0000 (UTC) X-HE-Tag: net71_150801e275e3 X-Filterd-Recvd-Size: 2810 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 08:39:40 +0000 (UTC) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DX82K3nNlzjKnQ; Fri, 5 Feb 2021 16:38:17 +0800 (CST) Received: from [10.174.179.241] (10.174.179.241) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Fri, 5 Feb 2021 16:39:27 +0800 Subject: Re: [PATCH v14 6/8] mm: hugetlb: introduce nr_free_vmemmap_pages in the struct hstate To: Oscar Salvador CC: Muchun Song , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20210204035043.36609-1-songmuchun@bytedance.com> <20210204035043.36609-7-songmuchun@bytedance.com> <42c8272a-f170-b27e-af5e-a7cb7777a728@huawei.com> <20210205082211.GA13848@linux> From: Miaohe Lin Message-ID: <435f3c32-0694-7af4-9032-0653a28a6a99@huawei.com> Date: Fri, 5 Feb 2021 16:39:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210205082211.GA13848@linux> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.241] X-CFilter-Loop: Reflected X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi: On 2021/2/5 16:22, Oscar Salvador wrote: > On Fri, Feb 05, 2021 at 03:29:43PM +0800, Miaohe Lin wrote: >>> + if (likely(vmemmap_pages > RESERVE_VMEMMAP_NR)) >>> + h->nr_free_vmemmap_pages = vmemmap_pages - RESERVE_VMEMMAP_NR; >> >> Not a problem. Should we set h->nr_free_vmemmap_pages to 0 in 'else' case explicitly ? > > No, hstate fields are already zeroed. I know hstate fields are already zeroed. What I mean is should we set nr_free_vmemmap_pages to 0 _explicitly_ like nr_huge_pages and free_huge_pages in hugetlb_add_hstate() ? But this is really trival. Many thanks for reply. > >