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 86C5FC38145 for ; Thu, 8 Sep 2022 12:31:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EC7A6B0072; Thu, 8 Sep 2022 08:31:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 09C826B0073; Thu, 8 Sep 2022 08:31:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA5468D0001; Thu, 8 Sep 2022 08:31:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DAF346B0072 for ; Thu, 8 Sep 2022 08:31:05 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B0C8D1219B9 for ; Thu, 8 Sep 2022 12:31:05 +0000 (UTC) X-FDA: 79888852890.04.D671C53 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by imf24.hostedemail.com (Postfix) with ESMTP id 6B85C1800A5 for ; Thu, 8 Sep 2022 12:31:05 +0000 (UTC) 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> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662640265; a=rsa-sha256; cv=none; b=ggJ9YU23erxXqqI7kH8WDMDxhHpQmr38qJRzenZbBUf6T4Zqos9qKzHWOqf9w6XvxuRF5H F6wIUrivhPn0N2TC9TxzLL4jluHG4TMx2D3WgBYPWi4LBk1tbLVkQ06uPjDx8YFaaewnR9 Es+bZZ0pKvh/1lZcebN2Jk3I/cHRn/k= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm3 header.b=K4XWweny; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=A26k42YF; dmarc=none; spf=pass (imf24.hostedemail.com: domain of kirill@shutemov.name designates 66.111.4.28 as permitted sender) smtp.mailfrom=kirill@shutemov.name ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662640265; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MdV0qKoHOlwl2QfutWs5dt4KXVZS5mtyiU/1CzsgRp0=; b=WGTBXKRU+81lrnvmWHLBcI57JXwLIOcizaYMkx7SMCBVL/B2vosgWxpd4oIzx4cS2o2RtB XRK8bK96i2ru++DyHgTmmAxUS5/eFaUwd+HPFio7here24tMS22zX61ZshzLxMFyWN1ksx bohzJ9PHNcpFyaF2js5JdG9ibv27sXc= X-Rspam-User: X-Stat-Signature: np3anjcp7bn9bpbibm49coo36sxcr9i7 X-Rspamd-Queue-Id: 6B85C1800A5 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm3 header.b=K4XWweny; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=A26k42YF; dmarc=none; spf=pass (imf24.hostedemail.com: domain of kirill@shutemov.name designates 66.111.4.28 as permitted sender) smtp.mailfrom=kirill@shutemov.name X-Rspamd-Server: rspam05 X-HE-Tag: 1662640265-130 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 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