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 05A2BC38145 for ; Thu, 8 Sep 2022 13:25:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DE5E6B0073; Thu, 8 Sep 2022 09:25:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78EFB6B0074; Thu, 8 Sep 2022 09:25:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6092D8D0002; Thu, 8 Sep 2022 09:25:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 533516B0073 for ; Thu, 8 Sep 2022 09:25:42 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2D15F1C7508 for ; Thu, 8 Sep 2022 13:25:42 +0000 (UTC) X-FDA: 79888990524.28.CB12F99 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by imf17.hostedemail.com (Postfix) with ESMTP id 7E86540081 for ; Thu, 8 Sep 2022 13:25:41 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 14B625C00E0; Thu, 8 Sep 2022 09:25:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 08 Sep 2022 09:25:41 -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=1662643541; x=1662729941; bh=gY 1SWywSbeqL1ZxBzUPSUoPO0D7KLRt+vB7M8GKgOOs=; b=OGzXvNCfi9k5EyTrtc 5LTPeuoh0+VY/JRG0/PMY/K/ePIMcom92t5S0oVtzFF0XM+z3nE/VIUp51Wq1gEa sCVYnY1sVoauz98t/u6fMDgNqG/x81gfQ5IfE3beomc1PV3OM/lt8Xa6Xm/lL0qL u/KGzurRLZ+GykVLlejg4g5WSz5jliUivPoNRN4+2neIUejxig8vH6KuJatba/uA Ywa9MbpJkkGb9ujVG8oqFBVg5woFEj63NEjxALhByWAKuAswVsybodJF4fHrQXb8 Pw1Lp0oleVuKzDx50Tp35c9esgoYyrswOXm95Im7D9AOpHPz00gsoKi7nAgAwYmR i1Mg== 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=1662643541; x=1662729941; bh=gY1SWywSbeqL1ZxBzUPSUoPO0D7K LRt+vB7M8GKgOOs=; b=dM/71gWgQMtuTcsckmy8ldsCTgrc4ije2/ONvgEvSh8W ucOOOaNkL27mriN95ZRWwbcihbIVvE7zuedx0J7Z46qOAZzn8h2SCE3H0hpVj3Zx mvwETvYkA5PfhhSzFZAAS+kVzHH/6vb2B1BWKZGM8hDdf+zVS/IWJakK45DtyGnh vNxEEMZ6i2JpSd9wAv+lda7EpfvmA14DorERJPFlWNlELDk9D7wkM01sqPaGXh2+ 1mBHM+Wl2CtGR1CjN3te/6JiuqU83ISzO8aD8dE5h6NXjziYF7arfRbtLftHiF7o AxOMRP+ubxcMRbR9GA2XALWZJ92dSi8XTpVIonVV0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedtfedgtdehucetufdoteggodetrfdotf 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 09:25:40 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 376081037A1; Thu, 8 Sep 2022 16:25:38 +0300 (+03) Date: Thu, 8 Sep 2022 16:25:38 +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: <20220908132538.kjqas6q2i24mrsug@box.shutemov.name> References: <20220908035533.2186159-1-liushixin2@huawei.com> <20220908123102.rpihrmisv55j3b2o@box.shutemov.name> <84a82033-ceb5-d8a2-3bae-a31574a5ff28@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84a82033-ceb5-d8a2-3bae-a31574a5ff28@huawei.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662643541; a=rsa-sha256; cv=none; b=yaJJVs2TD1gIGFPdRPD/PUtkMoPQUuwl1vlBE1iXIMNhtrEG1kO7uWKYWbsQVvAtudrU89 dn26LGoeJBzbdvvZQmo0pF3ef9x6WatWw6DjnHMyvQe3uAdHEBLQrctNmsYpdPG38IQr2r 7Og0jUKTf4yldN92TpOaYdVl5iL17PQ= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm3 header.b=OGzXvNCf; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="dM/71gWg"; dmarc=none; spf=pass (imf17.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=1662643541; 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=gY1SWywSbeqL1ZxBzUPSUoPO0D7KLRt+vB7M8GKgOOs=; b=rGscTFyg6zmBPEsnDQW17WY2Mr8sKcBQYhLugClH10fcgpMl8HfZDDAHMl/m9RTu4OC8WE p4+VJShn39f5BnyL1+Hc2ApZICdasckvoT+JuwwgXsOsonNPSqSZzDWaXBk1D8fwCjMUYw PMQuqx3LceV11CMbPIcq0tz8r17oKn4= X-Rspam-User: X-Stat-Signature: 4yyy1hh94wozopuznb9596853dscjz1e X-Rspamd-Queue-Id: 7E86540081 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm3 header.b=OGzXvNCf; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="dM/71gWg"; dmarc=none; spf=pass (imf17.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: 1662643541-928916 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 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. -- Kiryl Shutsemau / Kirill A. Shutemov