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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27603C54EE9 for ; Fri, 9 Sep 2022 01:46:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DF7D8D0003; Thu, 8 Sep 2022 21:46:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98E328D0001; Thu, 8 Sep 2022 21:46:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 855A28D0003; Thu, 8 Sep 2022 21:46:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 75F758D0001 for ; Thu, 8 Sep 2022 21:46:34 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4B2B31A02C4 for ; Fri, 9 Sep 2022 01:46:34 +0000 (UTC) X-FDA: 79890857508.01.A5A9C7D Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf19.hostedemail.com (Postfix) with ESMTP id 85D461A0064 for ; Fri, 9 Sep 2022 01:46:33 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNzJs0bNPzmVJm; Fri, 9 Sep 2022 09:42:53 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 09:46:30 +0800 Received: from [10.174.179.24] (10.174.179.24) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 09:46:29 +0800 Subject: Re: [PATCH v2] mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice To: "Kirill A. Shutemov" References: <20220908035533.2186159-1-liushixin2@huawei.com> <20220908123102.rpihrmisv55j3b2o@box.shutemov.name> <84a82033-ceb5-d8a2-3bae-a31574a5ff28@huawei.com> <20220908132538.kjqas6q2i24mrsug@box.shutemov.name> CC: Andrew Morton , "Kirill A . Shutemov" , Andrea Arcangeli , , , Kefeng Wang From: Liu Shixin Message-ID: Date: Fri, 9 Sep 2022 09:46:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20220908132538.kjqas6q2i24mrsug@box.shutemov.name> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662687993; a=rsa-sha256; cv=none; b=XfaEEAwH2GBb/AA7rNo4ida5HGCWXCZdPgtOGzOX9+gvzt94jT7I9kBymvpT9Wz8vS3HqK xeKFgFhMSw8iRXtIF6E+cvfXt0ZTHrSGgJChZmjHTqJFu2u/Gasq5S1md3OAs4a7YkC0Lh yCqCYwBpFIEzCmou+iI2Uj7XhV6u90o= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662687993; h=from:from:sender: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=2ccdmnFjR/V4PaU6KeI4GCgJWHHjjQe0zzCAg1Cspa0=; b=B2tGkdn1IFKj2Aia5yLoowo8uA4PvSIpiuoEcnpo3HkyqD5Ta3rvLe13LiRb8srt1cMUUB YXiRipQ5eqTnZi/EQpGe3MRJjM9grljKIvnSvQfoze95Lr+lVduJ7f/S9X9neTESDz/deG JHs+2+39g4mUeiO0xo/p1K5LLuay0Q0= Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=liushixin2@huawei.com X-Rspam-User: X-Rspamd-Queue-Id: 85D461A0064 X-Rspamd-Server: rspam09 X-Stat-Signature: kgwub5sngir7trmhgsxcizzhd9q417nj X-HE-Tag: 1662687993-667672 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 2022/9/8 21:25, Kirill A. Shutemov wrote: > On Thu, Sep 08, 2022 at 09:07:04PM +0800, Liu Shixin wrote: >> >> On 2022/9/8 20:31, Kirill A. Shutemov wrote: >>> On Thu, Sep 08, 2022 at 11:55:33AM +0800, Liu Shixin wrote: >>>> If two or more threads call get_huge_zero_page concurrently, >>>> THP_ZERO_PAGE_ALLOC may increased two or more times. But actually, >>>> this should only count as once since the extra zero pages has been >>>> freed. Redefine its meaning to indicate the times a huge zero page >>>> used for thp is successfully allocated. >>> I don't particularly care, but it is not obvoius why the new behaviour is >>> better. >> The user who read the value may be more concerned about the huge zero >> pages that are really allocated using for thp and can indicated the >> times of calling huge_zero_page_shrinker. >> I misunderstood when I first saw it. > Please, explain the motivation in the commit message. Thanks, I add the motivation. https://lore.kernel.org/all/20220909021653.3371879-1-liushixin2@huawei.com/