Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22926573rwd; Fri, 30 Jun 2023 15:00:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHQtsN3gqJnhxcU1BZX38IWHDFeicXNpbED4eVRQJDqtUcg6DlltzeVb1bDFoEUt89sQxWe X-Received: by 2002:a17:903:22ce:b0:1b8:4ec2:5200 with SMTP id y14-20020a17090322ce00b001b84ec25200mr3425939plg.2.1688162444632; Fri, 30 Jun 2023 15:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688162444; cv=none; d=google.com; s=arc-20160816; b=o7swNqfFxjhS5/gbSTJZu8I+EISB1h0hpoi0qeR/QFHvzPBBNub0U5f7jQ5Vj++kJw 6T3+AP5jzmidfzOD4ZXIUIlti7pL3TUbKwh37UB/Yl5i5qlrIe61ni8GRPnr/pPg3bSZ pAm7Mha8g4QWY6f8xvHw1rZWibYsMdObTSagoAq/Hp9Go4NLdFB1ctBXihUlEUZDkzVR GWYCB+NklZKEmZtVGeIdUlW1cfNFygGGvC/rGD3DPSKHIZnCtH1uDaiFYulNfv7REF0/ 4M7Mjf3S3YNFnOlv04AAkjSesuJfrL5z2ksiIqRCMUYtgOhYCwyIeMFbQ1kyTIYWEWBS /3kg== 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:dkim-signature; bh=+cB9Vy4PGBCg00Ikr+gnSUEOhOgkOBzDU9EJ0vrWwfE=; fh=jGhu3d0uaHO3PUlHHdlmDfzqnqvwM35yTNWWVA9EhjM=; b=0WzpQOTiVMQAGDzaf7HTXhxPFE6jNbk2oFZ12JfupmDnJUTsk7QRHF/RjAAnCBViUN B4zafHAwZNGLyEo9l9mMXdfhLNyldFD3UXeZ3oqFI3Yun2505cInb8A0D9CeghFlOQ8X EUBXAwB0GvxEF/j+Nrg+AMOWIaQGlIzgN/8r6T2b3kTOYN/2/xTLm24J0Hdd+vOM58fF ym+z2ng2MlXGa9no9QJYSjOhqbjB0YzWHOpR703CLlU0rN/TcRnmCxU0xtxK7aa6mxQl +DfSClIoQVG8nbFT2d3NUoUvf3aQNAvcUK5Td5Byw3nkjYAxs6eJwi+CQ9/beI0k/1M5 9p1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NwfAsxr+; 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 j13-20020a170902c3cd00b001b045d65af0si4527243plj.76.2023.06.30.15.00.24; Fri, 30 Jun 2023 15:00:44 -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=@infradead.org header.s=casper.20170209 header.b=NwfAsxr+; 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 S232172AbjF3VpD (ORCPT + 99 others); Fri, 30 Jun 2023 17:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjF3Vo7 (ORCPT ); Fri, 30 Jun 2023 17:44:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C5672D78; Fri, 30 Jun 2023 14:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+cB9Vy4PGBCg00Ikr+gnSUEOhOgkOBzDU9EJ0vrWwfE=; b=NwfAsxr+tiUQkGXB2OgurImbgT kArhJcKlMjiPJJ1RV6tuQO0aFk2Ri9ssoAyfpPoxLKMdyo6ViviRBytG1sxLOSS+zuWFLg6GBloZT JBSz2kdkrXtfDfk+FsYdXaIOo/xoszMs3AgfTS+pRdo9AuvkrPiFdteT7r0BSntHNtmFTA03O+afE ij39sXJZr4wmrH75D4JV+GkFSDWD316XfN/hnEkhq39Q32bMTCqz3Yde7dPbzPmtp904ADw8QpQ9h S71ZR23ENShAwsRtgirWCO8Aiwsg2vOW1m4+vsYH4tjV3yxNbfaYMERUipgjV/FjrjXEyP9jnbxS4 VjkycUKg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qFLv3-0062Yq-7k; Fri, 30 Jun 2023 21:44:45 +0000 Date: Fri, 30 Jun 2023 22:44:45 +0100 From: Matthew Wilcox To: zenghongling Cc: hch@infradead.org, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, zhongling0719@126.com Subject: Re: [PATCH] fs: Optimize unixbench's file copy test Message-ID: References: <1688117303-8294-1-git-send-email-zenghongling@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1688117303-8294-1-git-send-email-zenghongling@kylinos.cn> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, Jun 30, 2023 at 05:28:23PM +0800, zenghongling wrote: > The iomap_set_range_uptodate function checks if the file is a private > mapping,and if it is, it needs to do something about it.UnixBench's > file copy tests are mostly share mapping, such a check would reduce > file copy scores, so we added the unlikely macro for optimization. > and the score of file copy can be improved after branch optimization. > > - if (page_has_private(page)) > + if (unlikely(page_has_private(page))) This changelog shows a complete misunderstanding of the code you're changing. page_has_private() has nothing to do with whether the file is "a private mapping", whatever that means. The test is whether the filesystem has added private data to the page. As Darrick said, this code has been completely rewritten in a current kernel. You should test with something recent.