Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2787814pxu; Mon, 14 Dec 2020 10:53:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLMvsh4hnyMnrnO61A+9SddulMTBElGAAucLQCpv5JN/yCHyzbl1z6fbcdnACSyRtX8mhv X-Received: by 2002:a17:906:27d1:: with SMTP id k17mr24543533ejc.325.1607971983817; Mon, 14 Dec 2020 10:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607971983; cv=none; d=google.com; s=arc-20160816; b=QPjfQmGFIiAbPcu6DFPNV5od1O31LVAFx8dEx1O6y3WkmdRdPnDHvWoGUeoPav0ERE DMD5X8RLsDeU+XJd1QU4ZjAKAKVqPQI7jVFUlS5veezDKTHGQXhQGtlqhwVboXKvRP1F z98V2bukzH5aCrWpl5XUKnuMG2nPWaqWDGVZ/5yPU0Z5a7cdPlbTekjU3qhf2o65x7MM UiQjvfRutZz7003Aln40VIqhoQNN7HeEZWX5zciAKDRjchD9b6tYK4w6vARy9U3FaZwY +CjbUU7k3zaoeIGdCuIiG8p4vz7E+VFJt8QbBPUkt+MX0iFZtLDoULSiKIJY5bT6jV1N 8A9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=80A3v/WEjVbaiRbX2zqJ242KMRN7qmG3DpyY691VhNU=; b=a2xgZGPRXwdLAkCXLS60kOrbOJGUqI92GItdTqHuKfZhjmchqPZUKONmSC6TS46VC1 oXdN0As+XRg3eaMuYc4CxcadnXRN2wuIFFyy6e1H8TR08/283bA1ApJcf/O/iGutx5RY oJxVBwYNDOuen4iRWqaWtwGlRDPdd54lERt2aTDeZuF0uebn3MB3fjnEC9MfjtqTGo3I Ijnz+6ABTCdL3x40MmXG9UjXAZqemGm3oH3ViHuKUOP5K1pS8hTAkJpLpsxbj266blXj urk+TtPMEjOVyWY/eodImIabbq3/6vCo9aQzPUJMiKqFlO4b/Ln40IU2d5FKT7NDl7P1 aEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="IrTGKI/n"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq8si10484482ejc.750.2020.12.14.10.52.40; Mon, 14 Dec 2020 10:53:03 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b="IrTGKI/n"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408613AbgLNSLV (ORCPT + 99 others); Mon, 14 Dec 2020 13:11:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408612AbgLNSLM (ORCPT ); Mon, 14 Dec 2020 13:11:12 -0500 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D27C0613D3 for ; Mon, 14 Dec 2020 10:10:23 -0800 (PST) Received: by mail-qk1-x742.google.com with SMTP id 22so6252692qkf.9 for ; Mon, 14 Dec 2020 10:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=80A3v/WEjVbaiRbX2zqJ242KMRN7qmG3DpyY691VhNU=; b=IrTGKI/n7ayvbWMN0a7X/KHMS9wogZpz8jXczVP3WHMLZ2OioqQf8rwZllbIOzir+t sEehucHHdhqGg1HiD4LHnj3oQN1C+HBI6SoP8p8tqD+mZQ5fFFEKtrGaaBMzERcJdPvM 9bIFtqhqJVo8i4kNOZFi0T7+9sY9Rwpb/0OIw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=80A3v/WEjVbaiRbX2zqJ242KMRN7qmG3DpyY691VhNU=; b=beNyYqGPwWVGtAniyoZIYS/t7HhOup+txO5Vs/SfwIVnXXOH34BiSySG0y+pLyS23b 1tfInfmvL8RHdc2PSey/ARQyh1UxYRVO243ZpgtNb9G91ZuDRDp+14D3K5DI9Vt1Gv2E O4HaZv5r28WlJMFtCIeKEb8axZU4LJc4vTNBpWkq/NxQnwV61d+VV8xG8/vxMgSe+l4c cx57gijB6gXDowWD31Bx8Vkt/2eTYnKmf0HmNWBUOfylqaZEUEdy2c3+SS4yhaU5BxmX E9Rf3uFVcVbsDNxpFXawB2/2PPRhAlAKZsHbxdih0UmLqVTXj1TcoAnwF4WGgvl2/XRw 9bTg== X-Gm-Message-State: AOAM5320LzaSsjfndYD8P+5HWLB6qO4ucmoGLdTdaZKZLwryJSD4JzaB vpFW58LzT6q5HS/2aco3gU68sQ== X-Received: by 2002:ae9:e10d:: with SMTP id g13mr33504576qkm.444.1607969422214; Mon, 14 Dec 2020 10:10:22 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id i13sm5321115qkk.83.2020.12.14.10.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 10:10:20 -0800 (PST) Date: Mon, 14 Dec 2020 13:10:20 -0500 From: Joel Fernandes To: Laurent Dufour Cc: Chinwen Chang , Haiyan Song , akpm@linux-foundation.org, mhocko@kernel.org, peterz@infradead.org, kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , aneesh.kumar@linux.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi , zhong jiang , Balbir Singh , sj38.park@gmail.com, Michel Lespinasse , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org, miles.chen@mediatek.com Subject: Re: [PATCH v12 00/31] Speculative page faults Message-ID: References: <20190416134522.17540-1-ldufour@linux.ibm.com> <20190606065129.d5s3534p23twksgp@haiyan.sh.intel.com> <3d3cefa2-0ebb-e86d-b060-7ba67c48a59f@linux.ibm.com> <1c412ebe-c213-ee67-d261-c70ddcd34b79@linux.ibm.com> <20190620081945.hwj6ruqddefnxg6z@haiyan.sh.intel.com> <1594027500.30360.32.camel@mtkswgap22> <490c0811-50cd-0802-2cbc-9c031ef309f6@linux.ibm.com> <1594099897.30360.58.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 10:36:29AM +0100, Laurent Dufour wrote: > Le 14/12/2020 ? 03:03, Joel Fernandes a ?crit?: > > On Tue, Jul 07, 2020 at 01:31:37PM +0800, Chinwen Chang wrote: > > [..] > > > > > Hi Laurent, > > > > > > > > > > We merged SPF v11 and some patches from v12 into our platforms. After > > > > > several experiments, we observed SPF has obvious improvements on the > > > > > launch time of applications, especially for those high-TLP ones, > > > > > > > > > > # launch time of applications(s): > > > > > > > > > > package version w/ SPF w/o SPF improve(%) > > > > > ------------------------------------------------------------------ > > > > > Baidu maps 10.13.3 0.887 0.98 9.49 > > > > > Taobao 8.4.0.35 1.227 1.293 5.10 > > > > > Meituan 9.12.401 1.107 1.543 28.26 > > > > > WeChat 7.0.3 2.353 2.68 12.20 > > > > > Honor of Kings 1.43.1.6 6.63 6.713 1.24 > > > > > > > > That's great news, thanks for reporting this! > > > > > > > > > > > > > > By the way, we have verified our platforms with those patches and > > > > > achieved the goal of mass production. > > > > > > > > Another good news! > > > > For my information, what is your targeted hardware? > > > > > > > > Cheers, > > > > Laurent. > > > > > > Hi Laurent, > > > > > > Our targeted hardware belongs to ARM64 multi-core series. > > > > Hello! > > > > I was trying to develop an intuition about why does SPF give improvement for > > you on small CPU systems. This is just a high-level theory but: > > > > 1. Assume the improvement is because of elimination of "blocking" on > > mmap_sem. > > Could it be that the mmap_sem is acquired in write-mode unnecessarily in some > > places, thus causing blocking on mmap_sem in other paths? If so, is it > > feasible to convert such usages to acquiring them in read-mode? > > That's correct, and the goal of this series is to try not holding the > mmap_sem in read mode during page fault processing. > > Converting mmap_sem holder from write to read mode is not so easy and that > work as already been done in some places. If you think there are areas where > this could be done, you're welcome to send patches fixing that. > > > 2. Assume the improvement is because of lesser read-side contention on > > mmap_sem. > > On small CPU systems, I would not expect reducing cache-line bouncing to give > > such a dramatic improvement in performance as you are seeing. > > I don't think cache line bouncing reduction is the main sourcec of > performance improvement, I would rather think this is the lower part here. > I guess this is mainly because during loading time a lot of page fault is > occuring and thus SPF is reducing the contention on the mmap_sem. Thanks for the reply. I think I also wrongly assumed that acquiring mmap rwsem in write mode in a syscall makes SPF moot. Peter explained to me on IRC that tere's still perf improvement in write mode if an unrelated VMA is modified while another VMA is faulting. CMIIW - not an mm expert by any stretch. Thanks! - Joel