Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp979082pxb; Fri, 22 Jan 2021 04:19:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB7QFCbztwjpUbWDmc1oNWd0+ovq+6CsyePTsvg4rJCG0EQi3fHPb1w/Npo2chy4MbMYTk X-Received: by 2002:a17:906:a851:: with SMTP id dx17mr2622980ejb.537.1611317987505; Fri, 22 Jan 2021 04:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611317987; cv=none; d=google.com; s=arc-20160816; b=s+4dbpV0HqO4H19BTUoySngX7UbXBPZrknXX7OGrlnSee+RqYNBTzSw8ljRiI7po2O vJ/JNN1ETdFPInHE+UUOxouMZ6wLmhpdx73YPLPY8BJRo+YfdlxK7rdV+p/wAPPkQfcx K62tf0wNSi0CTL0t+A2P1QLk3N1Uy93Jjvy9nVKN1hL9OG/irpviK2EaMsIPp8HjEpnY eXhUdXooFwvGE2KxLNDMHi3gr2wDZ3I7PUgN9U24Y+ILqFL0JUYDis0cA4actMan0IJ/ 9drCvAovwym4tnaQciMmIpmwtwfHrvZR0b+Jn5nIjOgWFxLEQA6EanmQY/msJbCldUdJ oTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=x2VOvcQCRQK9uxo2eAkD2WGpcleg6lFR4Fm+o5+iSwg=; b=EUYmf7xo9kO7uPtcaCXemJotPcgZ9u3b99Ng4Obz8xbV9MYKfBZMmdmIds/4/MPfnM 5ZQdq9henyzGzSFFEtD+7mZGa2gXbLD9GaqeBoPcS5MKZjV+USb9eUYvAEbRM769t+bZ 6NzAjjDjsxidtwdsryprYzOnInjvHaqRwSIYuEEr2AAckBzfgobDLVuW8Q3OaeEyrTxD lm6HS2Qe1OwfhsGsU0lr+39gLieZboOOTOQjkHoTwwjBvj94MOHXb/MfeFAXNJyKVshw EoQs1d6WjsHlcyZIVvuV+9O9pvuBjuQmHQlKUvjG0mMw9W731Tw3RfJ5E7IazMYLHKbE M2AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3095719eji.157.2021.01.22.04.19.23; Fri, 22 Jan 2021 04:19:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727204AbhAVMQs (ORCPT + 99 others); Fri, 22 Jan 2021 07:16:48 -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