Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp462305pxb; Thu, 21 Jan 2021 11:11:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhoPeF4A1qsLvWfMEQV5AAgISLmSlwNtFcnT8tSRxjbkEwehTjoYdEMuiGjLz1TnbuM7xN X-Received: by 2002:a05:6402:190a:: with SMTP id e10mr524701edz.110.1611256306131; Thu, 21 Jan 2021 11:11:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611256306; cv=none; d=google.com; s=arc-20160816; b=MNcVmTt0POIg2zjNrdLD3JvB8K81YeFWiKwVW7zwfY0UMUx8WsxKlL0/KrPttuLKWs JQcv7pbhfVW3LwmPlSbywICv1PG1XuTy7hyF9WhH38ff1IH+jKNQa5fBfG3oqYYlGnC7 j5rMeZecfnRmeUdBR89FGq8fDQozN7e7Cc5MAT07AjA/ntwglVhaMtqR/ktXyzs8HVY3 aBqCtBwQXx7iJwWOpkjdnST0TWZAFyPzvW4HEULrDmS4PxtBfM/6mSnxaoq6Tv6rxHpz 3fPKKzQtoHNWH9c3K2WE0mE73wFrwYTsOUBSS1FUF+2RQdudDJjxRDZ6ZSgaEdgSnXWy t5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=x7nZZEgrL7uXxwVjcmAzR1xAYllLPOB1KAZOPyB8eu4=; b=qdXMArcWEJGf/I8QFMwA04UWszrgMwwewKqrnI9uMSDvo0C3mwZVdzlB7SgfkdYtgf tjmUlcZzsG2fFKkpJhFXO9ES28hn3Za82GSD+RCsAjFYIvI2fPe1K9KDgoLP9i/t+m8V dbBpqU/4GHB5/+DXA0od5qbKzAkZksT4nGfN6002pclvtFcSU2FUyJgh+3dEKqbBHoMP JXOyhvZ0XrK77wGB+tsGCZraRwb8rUwxkXx6ejmWaoJtI9cUfgf9HA3cdzCeiApdxRux uTCTsCU815+LWl7lScrIyR+s1N8Pi7iXnZv0GQmrxQYQaiHdIl+0XUvH/nNHw7IjSCMq so1g== 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 lx11si2039825ejb.746.2021.01.21.11.11.20; Thu, 21 Jan 2021 11:11:46 -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 S1726177AbhAUTJ2 (ORCPT + 99 others); Thu, 21 Jan 2021 14:09:28 -0500 Received: from foss.arm.com ([217.140.110.172]:44108 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbhAUTIf (ORCPT ); Thu, 21 Jan 2021 14:08:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DBD39139F; Thu, 21 Jan 2021 10:59:40 -0800 (PST) Received: from [10.57.39.58] (unknown [10.57.39.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D91463F66E; Thu, 21 Jan 2021 10:59:38 -0800 (PST) Subject: Re: [PATCH 0/1] mm: Optimizing hugepage zeroing in arm64 To: Will Deacon , Prathu Baronia Cc: Prathu Baronia , Catalin Marinas , 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 References: <20210121165153.17828-1-prathu.baronia@oneplus.com> <20210121174616.GA22740@willie-the-truck> From: Robin Murphy Message-ID: Date: Thu, 21 Jan 2021 18:59:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210121174616.GA22740@willie-the-truck> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Robin.