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 48519C433DB for ; Fri, 5 Feb 2021 09:13:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B24B764F38 for ; Fri, 5 Feb 2021 09:12:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B24B764F38 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 20AFA6B0005; Fri, 5 Feb 2021 04:12:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1997E6B006C; Fri, 5 Feb 2021 04:12:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05E466B0075; Fri, 5 Feb 2021 04:12:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id DFCC86B0005 for ; Fri, 5 Feb 2021 04:12:58 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A2B15181AEF1E for ; Fri, 5 Feb 2021 09:12:58 +0000 (UTC) X-FDA: 77783649636.01.bite01_630843a275e3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 876771004CE40 for ; Fri, 5 Feb 2021 09:12:58 +0000 (UTC) X-HE-Tag: bite01_630843a275e3 X-Filterd-Recvd-Size: 3223 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 09:12:57 +0000 (UTC) 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 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: 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. :)