Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp557059rwn; Thu, 8 Sep 2022 05:52:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qcSLVdJ95wqvz0tUeZ5k42yPN9gh90m+xA5zV5jmQ4PF8RO8WMTo8y8T28G4GzzlDGgAm X-Received: by 2002:a17:907:31c9:b0:740:ef93:2ffd with SMTP id xf9-20020a17090731c900b00740ef932ffdmr5957037ejb.584.1662641561125; Thu, 08 Sep 2022 05:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662641561; cv=none; d=google.com; s=arc-20160816; b=rYYOEBRrPVlppQNca+6eDTmLwD2/mVLAyqT7AvMH+yxw8ezSJvRsmt5vnml7fufbPO 9aXn/wfn4X04iuu8LAOG1Jr+i57NuzFr2djPG0Vql+GXrJEqP23EWvfj8vcDw7doHvgL EQK3FHIX6HcH/afna2BpreKBfLKnAU2OOY31zK3O5++4Ysz17OQVdEmQOTfadVQGzwSM nN7/SCf/2HW3Fr/8emlT9m8XGJ3xJjcY7o7RCdnlMYDCLSXP2t1+BiZhVcWvt4w+cT2n hSPZtv3jp1eVBS7NvqfVn156/UB2lF2A2xASVDTIO/svB0O6L0K4PEw7CxIcQy8sssV3 RPtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=MdV0qKoHOlwl2QfutWs5dt4KXVZS5mtyiU/1CzsgRp0=; b=rHGKUvGczkd4wdRnqueL5/DV/PDbXjcwFN39S/xn8MhdvQoiwFi450Xw9z4cGhm7wC FZC7biETYZAXMvg7sbg72y1pU3n1ORCGhsgUSXxP6AKwQ8fpPR9n9W4Jg05HyWBUD0Gc BPmbsVB1eR4Q92o1b/4CXjd2/KoIampl0PfKN1DtKQz07mGNMBqermte/ntSv2VIrIX9 WCzHYrEXntdXJH9H0ou/mOeIwLnjnevx74wJXXdRIWNn0N9MTHcriLaSNGARjyw3JRAJ 7hovKVdaQiKMiuVvt4cjAE2hg5S5XFBo7EppYhbo/xI8Ef54aTqBOhrl2SzY/gWCQ8KW FWww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm3 header.b=K4XWweny; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=A26k42YF; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a170906950300b007307fd1b9bbsi1428802ejx.589.2022.09.08.05.52.15; Thu, 08 Sep 2022 05:52:41 -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; dkim=pass header.i=@shutemov.name header.s=fm3 header.b=K4XWweny; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=A26k42YF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbiIHMbX (ORCPT + 99 others); Thu, 8 Sep 2022 08:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbiIHMbG (ORCPT ); Thu, 8 Sep 2022 08:31:06 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD16FFD233 for ; Thu, 8 Sep 2022 05:31:05 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1CCF65C009F; Thu, 8 Sep 2022 08:31:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 08 Sep 2022 08:31:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1662640265; x=1662726665; bh=Md V0qKoHOlwl2QfutWs5dt4KXVZS5mtyiU/1CzsgRp0=; b=K4XWwenyfokwJHOJMX rC7lO6bhF8C8DHkZ22Aa2A45k3CQ4VW9U52oPByZA24zk/5RlcYFQfxNzLIGlyX5 TxKmog2y0LBxmR17X6mGlpVTYiZ8Gsab0WmS/jpUkqeFGhscfYklrjrm3BK6deUu 9939z5wzvTvnYLSQ3L+g2Kgx2mujtk1Ckqe/MEWygS0P6JfmIZNhLhHPMGINCOLr Mc/0AD3HSwYfqF4vViRMx6c+idh7nseWQ4XHpRy8U1JNlRvLylWI9LeUlKPHjXPr IcwHA7WFaFhUQxkmPpY+J9IMfR/6imkGWyqDnyuUQLzVYmCc7bK39nF2PL4WW+es nF3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1662640265; x=1662726665; bh=MdV0qKoHOlwl2QfutWs5dt4KXVZS 5mtyiU/1CzsgRp0=; b=A26k42YFpzUq5qLZHmPK0fUqcYknidcmqAEetm9GTQfS pG1YIK9T87DrOzRxsGTCcZJPLfgG3ffeYuijnYdm/HYsy+uW2zwwHrDFpTFxdCWu D9YzOARL6x6wetvaD3hWlAKzSfgrzWoCF4SpeIoUfrEm5HW0tbt1jxZRrzlmGXnr xo7oacXYdnCLWZExCJ1ugefWR7XTgaoIQVVILJPpZfIFKDw3CLp6bb+MGHWLRAIf btmRmtAsHP94AnykzszzsYiJqBs/A/gTJiQ/KpqVgCQbaLHUfh6nOqg2LRqBTU8B vlAS6OtN2dMPRnaLl796B9X4495KVrke3F2LhuwG5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedtvddgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Sep 2022 08:31:04 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id E53B21037A1; Thu, 8 Sep 2022 15:31:02 +0300 (+03) Date: Thu, 8 Sep 2022 15:31:02 +0300 From: "Kirill A. Shutemov" To: Liu Shixin Cc: Andrew Morton , "Kirill A . Shutemov" , Andrea Arcangeli , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kefeng Wang Subject: Re: [PATCH v2] mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice Message-ID: <20220908123102.rpihrmisv55j3b2o@box.shutemov.name> References: <20220908035533.2186159-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908035533.2186159-1-liushixin2@huawei.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 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. All huge zero pages are freed apart from possibly the last one allocated. -- Kiryl Shutsemau / Kirill A. Shutemov