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 A3976C77B78 for ; Thu, 4 May 2023 11:48:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0D276B0075; Thu, 4 May 2023 07:48:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABDD46B0078; Thu, 4 May 2023 07:48:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AD426B007B; Thu, 4 May 2023 07:48:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by kanga.kvack.org (Postfix) with ESMTP id 8355D6B0075 for ; Thu, 4 May 2023 07:48:32 -0400 (EDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 211675C00F0; Thu, 4 May 2023 07:48:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 04 May 2023 07:48:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type: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=fm2; t=1683200912; x= 1683287312; bh=v1arjcxRGb7y6urCjIFazVRLepNa1WdVDT4A6Neokr8=; b=Y M3SdRfoWNROdtk4zN+s6UsPbbouMDxtQtBUh6QYHRLo4DUIpby/n44Pi06w8Epll 9/LWrzNUgh9dTS+SyIz8c6CN03BkMPJctGf6E8YywptZK31b2sd5d4aTk2iwpfEY P5X5A2Ov3GrHSEm4jo7Qd2AapS+q9CCgX/EkFruMTQBPr8JijUl0z/k/toWl4EtC j7VBYSKg7avFkmaJ8ShH5q/5jOgwofW8EevLK6+1AKWWxiTCatk/s8KTDQHAR0Yr P3DUVzDDet3ppeMbubsKtRLOcNmqAKJ8hoVsMuLDwAUaNJ4YKpSCj+xCRuIlzago dbPQNWketYBks+nxxQymg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=fm3; t=1683200912; x=1683287312; bh=v1arjcxRGb7y6 urCjIFazVRLepNa1WdVDT4A6Neokr8=; b=hm0vo1rtWGQuwv9j3tp+qazU9oriY TwLFAYbHPPaqLaQRMVNTH+N5U9j6FTqGESiroJai1+/kmqfNmCkKDWCNeOEWEmf9 NcLlaSczR7oJpiXD3HbeQLh2ysoqaxQPpsQY4b9/UY+WXwGK6K96i1c5KAJgHmDB ZFnXI0HGubm+WeqY/BCM3gyT8lx1UEA1y1fJQ+vvnQnktc9qN12jOWYclDvYf2J7 M2hgScF5sy6rmRwI4+ZjmzJuZafH9zqGHfSjJ05ICpXQqsZyw0+poTtOHk1cqvCC EURbom6Sl03Jpty+3UWxZNuZIthQnnr3pue/e+9PBfPJXx0p3MtpZo2Sw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeftddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepkhhirhhi lhhlsehshhhuthgvmhhovhdrnhgrmhgvnecuggftrfgrthhtvghrnhepheelveevjeduje ekveeuveetveffhfekjefgheelteehhfeujedvheeijefghffhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhirhhilhhlsehshhhuthgvmh hovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 May 2023 07:48:31 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id E834810CE5D; Thu, 4 May 2023 14:48:27 +0300 (+03) Date: Thu, 4 May 2023 14:48:27 +0300 From: kirill@shutemov.name To: Yin Fengwei Cc: linux-mm@kvack.org, akpm@linux-foundation.org, willy@infradead.org, yuzhao@google.com, ryan.roberts@arm.com, ying.huang@intel.com Subject: Re: [PATCH v3 1/2] THP: avoid lock when check whether THP is in deferred list Message-ID: <20230504114827.tkvvlmpo33p2jpc4@box.shutemov.name> References: <20230429082759.1600796-1-fengwei.yin@intel.com> <20230429082759.1600796-2-fengwei.yin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230429082759.1600796-2-fengwei.yin@intel.com> 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 Sat, Apr 29, 2023 at 04:27:58PM +0800, Yin Fengwei wrote: > free_transhuge_page() acquires split queue lock then check > whether the THP was added to deferred list or not. It brings > high deferred queue lock contention. > > It's safe to check whether the THP is in deferred list or not > without holding the deferred queue lock in free_transhuge_page() > because when code hit free_transhuge_page(), there is no one > tries to add the folio to _deferred_list. > > Running page_fault1 of will-it-scale + order 2 folio for anonymous > mapping with 96 processes on an Ice Lake 48C/96T test box, we could > see the 61% split_queue_lock contention: > - 63.02% 0.01% page_fault1_pro [kernel.kallsyms] [k] free_transhuge_page > - 63.01% free_transhuge_page > + 62.91% _raw_spin_lock_irqsave > > With this patch applied, the split_queue_lock contention is less > than 1%. > > Signed-off-by: Yin Fengwei Acked-by: Kirill A. Shutemov -- Kiryl Shutsemau / Kirill A. Shutemov