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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CAE5C04E69 for ; Fri, 28 Jul 2023 17:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232938AbjG1RYK (ORCPT ); Fri, 28 Jul 2023 13:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232735AbjG1RYJ (ORCPT ); Fri, 28 Jul 2023 13:24:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 398E42135; Fri, 28 Jul 2023 10:24:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C1E6D621B0; Fri, 28 Jul 2023 17:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC92C433C9; Fri, 28 Jul 2023 17:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1690565047; bh=F8PyAvW7AlD89TIBCGrOIiLigKuhVWKEHS84huiz2HA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sFJd3MIMmW6vuBJv2YzUTpDJnSy3XvPNyIJCTyTWM+hJHpTqSR2u6vpmUp+fzAGNr v/UuYxprIai3L+04NHsC7FO0ulr8pk5uMzz243gYipF9/I7AP7yOzkkTvmevmExjgW FUZIM0B5+4Mj0SJXgqXhRym6YTaeNWnQ5wzUgdH8= Date: Fri, 28 Jul 2023 10:24:05 -0700 From: Andrew Morton To: Yin Fengwei Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, willy@infradead.org, vishal.moola@gmail.com, wangkefeng.wang@huawei.com, minchan@kernel.org, yuzhao@google.com, david@redhat.com, ryan.roberts@arm.com, shy828301@gmail.com Subject: Re: [PATCH 0/2] don't use mapcount() to check large folio sharing Message-Id: <20230728102405.7b456eb87fb46042fbce5e4b@linux-foundation.org> In-Reply-To: <20230728161356.1784568-1-fengwei.yin@intel.com> References: <20230728161356.1784568-1-fengwei.yin@intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 Jul 2023 00:13:54 +0800 Yin Fengwei wrote: > In madvise_cold_or_pageout_pte_range() and madvise_free_pte_range(), > folio_mapcount() is used to check whether the folio is shared. But it's > not correct as folio_mapcount() returns total mapcount of large folio. > > Use folio_estimated_sharers() here as the estimated number is enough. What are the user-visible runtime effects of these changes? (and please try to avoid using the same Subject: for different patches)