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 69407C433EF for ; Wed, 27 Apr 2022 01:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356772AbiD0BiG (ORCPT ); Tue, 26 Apr 2022 21:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356760AbiD0BiD (ORCPT ); Tue, 26 Apr 2022 21:38:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 239751749E6; Tue, 26 Apr 2022 18:34:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7BA74B82472; Wed, 27 Apr 2022 01:34:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3176C385AC; Wed, 27 Apr 2022 01:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651023291; bh=dSVYLEetv78FW+gtzyAvwAnMSrgvka4Nww/5vTmvfkY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BtCnxzGfo/fzgOWgJ2FBU1pxuFtz6fkh8N9dLoVanvGlrrQzg1mY0o6uIqwxS2ufl xW5vdTBDw2gaeBAQ26Kho+99RwdWCFM4Qzl5BxZp1oYgpZB+JRWh8bOakHDRvv6aBK d34Ih7NOoILog3q+VC9/CsZ/iXaJPUfzPplEs04s= Date: Tue, 26 Apr 2022 18:34:48 -0700 From: Andrew Morton To: Yu Zhao Cc: Stephen Rothwell , Linux-MM , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Kernel Page Reclaim v2 , "the arch/x86 maintainers" , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?ISO-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh , Vaibhav Jain Subject: Re: [PATCH v10 05/14] mm: multi-gen LRU: groundwork Message-Id: <20220426183448.3538d53eb9aafb48d1bfdb2b@linux-foundation.org> In-Reply-To: References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-6-yuzhao@google.com> <20220411191615.a34959bdcc25ef3f9c16a7ce@linux-foundation.org> <20220426164241.99e6a283c371ed75fa5c12a0@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-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 Tue, 26 Apr 2022 19:18:21 -0600 Yu Zhao wrote: > > For example, lru_gen_add_folio() is huge and has 4(?) call sites. This > > may well produce slower code due to the icache footprint. > > > > Experiment: moving lru_gen_del_folio() into mm/vmscan.c shrinks that > > file's .text from 80612 bytes to 78956. > > > > I tend to think that out-of-line regular old C functions should be the > > default and that the code should be inlined only when a clear benefit > > is demonstrable, or has at least been seriously thought about. > > I can move those functions to vmscan.c if you think it would improve > performance. I don't have a strong opinion here -- I was able to > measure the bloat but not the performance impact. This seems to be more an act of faith than anything else. Unlikely that any difference will be measurable. If there is a difference, the inlined version should win on microbenchmarks because all four copies of the function will be in cache. But a more realistic, broader test might suffer a slowdown due to having to move the larger text in more frequently. And inter-build alignment changes seem to make a larger difference than anything else, thus confounding measurement attempts. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12E0EC433F5 for ; Wed, 27 Apr 2022 01:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kczXOF9WEk9cuVlPyHkIbEu2jb5PRr+io9GOf4GmMeg=; b=eNBmKCXscxXhXU gstdjXsf0mPbEeHVs/k30HtyrkagzIMuBo0QV9P4Vo1lhLBps0dqDxmN63XL4MSj2EW4xushGdkuR BHHsMGxsn2Cdr8icnH7f1AZ9GjPCNBhr+OMRJhxw4m6vsNU/R0evHC/5/YjkCBrVOt1BPnMwCE4bF cENkGwzdgwHgD3Z0cpTxISyfH7SASOOF3BYhARtzV+eM2BC0ehdvaMENOPLZ/TPgGwyiDLW/Wa+oo Z2T8/iaVmO9Et8QQMiETqUuJN6uOi0Ui3ogNSXlac/UjBcgk+BqF2OKLE7j/ZkG9V+4GUsnio3GIB sg0geALSkT28qQV1QulA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njWa2-00Gtmr-HA; Wed, 27 Apr 2022 01:34:58 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njWZy-00Gtl8-1c for linux-arm-kernel@lists.infradead.org; Wed, 27 Apr 2022 01:34:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5D189B823F5; Wed, 27 Apr 2022 01:34:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3176C385AC; Wed, 27 Apr 2022 01:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651023291; bh=dSVYLEetv78FW+gtzyAvwAnMSrgvka4Nww/5vTmvfkY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BtCnxzGfo/fzgOWgJ2FBU1pxuFtz6fkh8N9dLoVanvGlrrQzg1mY0o6uIqwxS2ufl xW5vdTBDw2gaeBAQ26Kho+99RwdWCFM4Qzl5BxZp1oYgpZB+JRWh8bOakHDRvv6aBK d34Ih7NOoILog3q+VC9/CsZ/iXaJPUfzPplEs04s= Date: Tue, 26 Apr 2022 18:34:48 -0700 From: Andrew Morton To: Yu Zhao Cc: Stephen Rothwell , Linux-MM , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Kernel Page Reclaim v2 , "the arch/x86 maintainers" , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?ISO-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh , Vaibhav Jain Subject: Re: [PATCH v10 05/14] mm: multi-gen LRU: groundwork Message-Id: <20220426183448.3538d53eb9aafb48d1bfdb2b@linux-foundation.org> In-Reply-To: References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-6-yuzhao@google.com> <20220411191615.a34959bdcc25ef3f9c16a7ce@linux-foundation.org> <20220426164241.99e6a283c371ed75fa5c12a0@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_183454_407989_A42C3E40 X-CRM114-Status: GOOD ( 20.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 26 Apr 2022 19:18:21 -0600 Yu Zhao wrote: > > For example, lru_gen_add_folio() is huge and has 4(?) call sites. This > > may well produce slower code due to the icache footprint. > > > > Experiment: moving lru_gen_del_folio() into mm/vmscan.c shrinks that > > file's .text from 80612 bytes to 78956. > > > > I tend to think that out-of-line regular old C functions should be the > > default and that the code should be inlined only when a clear benefit > > is demonstrable, or has at least been seriously thought about. > > I can move those functions to vmscan.c if you think it would improve > performance. I don't have a strong opinion here -- I was able to > measure the bloat but not the performance impact. This seems to be more an act of faith than anything else. Unlikely that any difference will be measurable. If there is a difference, the inlined version should win on microbenchmarks because all four copies of the function will be in cache. But a more realistic, broader test might suffer a slowdown due to having to move the larger text in more frequently. And inter-build alignment changes seem to make a larger difference than anything else, thus confounding measurement attempts. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel