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 94A1DC433E0 for ; Fri, 5 Feb 2021 09:17:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EA9D64F46 for ; Fri, 5 Feb 2021 09:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230172AbhBEJQr (ORCPT ); Fri, 5 Feb 2021 04:16:47 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12436 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbhBEJNo (ORCPT ); Fri, 5 Feb 2021 04:13:44 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DX8n06y9CzjJRT; Fri, 5 Feb 2021 17:11:48 +0800 (CST) Received: from [10.174.179.241] (10.174.179.241) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Fri, 5 Feb 2021 17:12:46 +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> <435f3c32-0694-7af4-9032-0653a28a6a99@huawei.com> <20210205085632.GC13848@linux> From: Miaohe Lin Message-ID: <318aa24d-86a7-0a18-c4df-80aa857e5388@huawei.com> Date: Fri, 5 Feb 2021 17:12:45 +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: <20210205085632.GC13848@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/5 16:56, Oscar Salvador wrote: > On Fri, Feb 05, 2021 at 04:39:26PM +0800, Miaohe Lin wrote: >> 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. > > We do not anny more [1] > > [1] https://patchwork.kernel.org/project/linux-mm/patch/20201119112141.6452-1-osalvador@suse.de/ > > Oh, I see. I thought we do it deliberately. Many thanks for your patient answer. :)