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=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 518D1C433DB for ; Mon, 11 Jan 2021 14:03:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19E07223E8 for ; Mon, 11 Jan 2021 14:03:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19E07223E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=yH9B7hSvPcvsT+FhhWHZx5yCBCYssWyDcdbeNdkppSo=; b=QhiguGMQA0XOH21itxIpU3YxK 0pkLx6SB40PL2IRcYR2YREY73t24HWW826VelE8wjelFH15Q8RhU6AyYT9FDEvMhILqk315+Tev7Q nbQPpP55g9xKOMmGVkHIlZcaI1nVi5b+YPhDOzAPK+yZAj+NQrM1/GIHmTJt8FOhgl8qNLCGDjx33 3u/txSxkGxQ8TK3nFShfcSm/gyNP8f4ObNN7ZUfHbf5LEyWsoHRUhKH4ew/mgbyuXQPESpCC3cYHZ UDwWuuzsbWszXJaMF5GCnw/0LMxaZSyCOx32nnQw6z4jVy3XhuzfbgV1PPk5MSoCsi3YW4M5JX/yz Ol4g30oCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyxle-0006H9-Jq; Mon, 11 Jan 2021 14:01:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyxlb-0006GJ-O5 for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 14:01:56 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E8692242A; Mon, 11 Jan 2021 14:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610373715; bh=50IG3zR+Q9oxcbVhieDnuu5FgxkxGAFNFUX/rpImuNo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LDweBAoGyGcdo8Q8Z8bdxt61JEm0SV2DUE6HLbw752d+V76R95FuTrxT9fQycKawv Wi8hxok+e6+KdKSNX97rOM1kbhPMaY1S8+8hXQz67FyHjM5uhruT5m6yMODANNDVdY AKRFj73QUdnxLxOgBZ6V+uuJpXq51aHVTlV69KrSG/Hpur51tjxpR0DGa8CSTTQJDZ 6H4kumU/NWhGA0Ks0hbP3YN59eBuRIsWvFNH3kBqUWB01t6msUEQ+FXaO84528YDdI hs5Z8UtK23t0OmOfssqdRj8FOak+MOvmjbhHhBdK/irmCoJX7gF6TCdK8QiStch3Hq SEJ9+aHuxr5BQ== Date: Mon, 11 Jan 2021 14:01:49 +0000 From: Will Deacon To: Linus Torvalds Subject: Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag Message-ID: <20210111140149.GB7642@willie-the-truck> References: <20210108171517.5290-1-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_090155_916410_8E727531 X-CRM114-Status: GOOD ( 21.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , Minchan Kim , Catalin Marinas , Hugh Dickins , Linux Kernel Mailing List , Linux-MM , Vinayak Menon , "Kirill A . Shutemov" , Andrew Morton , Android Kernel Team , Linux ARM 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 Fri, Jan 08, 2021 at 11:42:39AM -0800, Linus Torvalds wrote: > On Fri, Jan 8, 2021 at 11:34 AM Linus Torvalds > wrote: > > > > Yeah, I think that's a side effect of "now the code really makes a lot > > more sense". Your subsequent patches 2-3 certainly are much simpler > > now > > On that note - they could be simpler still if this was just done > entirely unconditionally.. > > I'm taking your word for "it makes sense", but when you say > > On CPUs with hardware AF/DBM, initialising prefaulted PTEs as 'old' > improves vmscan behaviour and does not appear to introduce any overhead. > > in the description for patch 3, it makes me wonder how noticeable the > overhead is on the hardware that _does_ take a fault on old pte's.. > > IOW, it would be lovely to see numbers if you have any like that.. [Vinayak -- please chime in if I miss anything here, as you've posted these numbers before] The initial posting in 2016 had some numbers based on a 3.18 kernel, which didn't have support for hardware AF/DBM: https://lore.kernel.org/lkml/fdc23a2a-b42a-f0af-d403-41ea4e755084@codeaurora.org (note that "Kirill's-fix" in the last column was a quick hack and didn't make the faulting pte young) So yes, for the cases we care about in Android (where the vmscan behaviour seems to be the important thing), then this patch makes sense for non-hardware AF/DBM CPUs too. In either case, we see ~80% reduction in direct reclaim time according to mmtests [1] and double-digit percentage reductions in app launch latency (some of this is mentioned in the link above). The actual fault cost isn't especially relevant. *However...* For machines with lots of memory, the increased fault cost when hardware AF/DBM is not available may well be measurable, and I suspect it would hurt unixbench (which was the reason behind reverting this on x86 [2], although I must admit that the diagnosis wasn't particularly satisfactory [3]). We could run those numbers on arm64 but, due to the wide diversity of micro-architectures we have to deal with, I would like to keep our options open to detecting this dynamically anyway, just in case somebody builds a CPU which struggles in this area. Cheers, Will [1] https://github.com/gormanm/mmtests [2] https://lore.kernel.org/lkml/20160613125248.GA30109@black.fi.intel.com/ [3] https://lore.kernel.org/lkml/20160616151049.GM6836@dhcp22.suse.cz/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel