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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 869A7C433E0 for ; Fri, 22 Jan 2021 12:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E9052343E for ; Fri, 22 Jan 2021 12:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbhAVMQz (ORCPT ); Fri, 22 Jan 2021 07:16:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:40310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbhAVMOc (ORCPT ); Fri, 22 Jan 2021 07:14:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5A7323437; Fri, 22 Jan 2021 12:13:37 +0000 (UTC) Date: Fri, 22 Jan 2021 12:13:35 +0000 From: Catalin Marinas To: Robin Murphy Cc: Will Deacon , Prathu Baronia , Prathu Baronia , Anshuman Khandual , linux-kernel@vger.kernel.org, chintan.pandya@oneplus.com, "glider@google.com" , Andrey Konovalov , Geert Uytterhoeven , Andrew Morton , Vincenzo Frascino , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 0/1] mm: Optimizing hugepage zeroing in arm64 Message-ID: <20210122121334.GC8567@gaia> References: <20210121165153.17828-1-prathu.baronia@oneplus.com> <20210121174616.GA22740@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 06:59:37PM +0000, Robin Murphy wrote: > On 2021-01-21 17:46, Will Deacon wrote: > > On Thu, Jan 21, 2021 at 10:21:50PM +0530, Prathu Baronia wrote: > > > This patch removes the unnecessary kmap calls in the hugepage zeroing path and > > > improves the timing by 62%. > > > > > > I had proposed a similar change in Apr-May'20 timeframe in memory.c where I > > > proposed to clear out a hugepage by directly calling a memset over the whole > > > hugepage but got the opposition that the change was not architecturally neutral. > > > > > > Upon revisiting this now I see significant improvement by removing around 2k > > > barrier calls from the zeroing path. So hereby I propose an arm64 specific > > > definition of clear_user_highpage(). > > > > Given that barrier() is purely a thing for the compiler, wouldn't the same > > change yield a benefit on any other architecture without HIGHMEM? In which > > case, I think this sort of change belongs in the core code if it's actually > > worthwhile. > > I would have thought it's more the constant manipulation of the preempt and > pagefault counts, rather than the compiler barriers between them, that has > the impact. Either way, if arm64 doesn't need to be atomic WRT preemption > when clearing parts of hugepages then I also can't imagine that anyone else > (at least for !HIGHMEM) would either. I thought the kmap_local stuff was supposed to fix this unnecessary preemption disabling on 64-bit architectures: https://lwn.net/Articles/836144/ I guess it's not there yet. -- Catalin