Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1369163rwn; Thu, 8 Sep 2022 18:58:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4JjabltV7JNcKHeG+YphGopIm0bmTR86pVkmxQWtfHBhI3heXHwsJ1SPTG/m9th7foYNw0 X-Received: by 2002:a05:651c:10cc:b0:26a:c073:9962 with SMTP id l12-20020a05651c10cc00b0026ac0739962mr3314952ljn.32.1662688685334; Thu, 08 Sep 2022 18:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662688685; cv=none; d=google.com; s=arc-20160816; b=YpvKFVQ9uhEJtyhEmEO9vGd3Tmld5ydl3ZKoa+cWpOqS7uxkYJK1J4+0rnXvhKSlhG DpR7gA/5pozIxVhjY7NBy7NzW3FFGnFeeCzIwJ6az4+C9PDKzepZB3MsChU3R365qG08 Y/i/vWsIrlafdQmw3dXaAV4A77aaOFSXee9ie4G3TVESrlW2otGy+sbxSEpqRFrJO5ZN ypnVfmkRva6XonGceipCqfhbU/62e868Zof2egvPLUeMNA+xnGdC4AOHxTopIxqLsCS4 BFyUUMhW+KbSz8CMGEC+MrA388DNGTdAdh0FuEtPxA2nZ+Ftlo0c2gaIva2UOQjrmzsS RZnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=2ccdmnFjR/V4PaU6KeI4GCgJWHHjjQe0zzCAg1Cspa0=; b=zaC05aA9+mr2OE6qVZQv/NLmr8IFf1KT7oFuiIXuZ/A/M4S3D5VfRijPcwZEYH9OlP rrFaVZs2gEmrOLSyDQSTnPxQ079/BsSzhBsOvNBXwGUAa8fQE85tFtWMcDQYydtopJfu vFPgYmRKa6QTZOPG7QrCRBhRowMmstihk8rNlTz8Vh4dQKEVFEbYaX7G9pOH9lAwAwSv VV39HtSbhBMjkAvjhhjXhuxV+ZfEOJH9enzlt4VZbQ8eRS6aPRxIFhXXu3ExOcwomm7J MjhA/Qa5+Jy+HCnp4hgD6FBwGukATIWBTa7YYScahcaMsYjrYGavZ7abO23RiW9UEVIK BQiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a056512054500b004946a751e74si200984lfl.184.2022.09.08.18.57.35; Thu, 08 Sep 2022 18:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbiIIBqn (ORCPT + 99 others); Thu, 8 Sep 2022 21:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbiIIBql (ORCPT ); Thu, 8 Sep 2022 21:46:41 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E837E3D68 for ; Thu, 8 Sep 2022 18:46:32 -0700 (PDT) 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 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SCC_BODY_URI_ONLY,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/