Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7732329imu; Fri, 28 Dec 2018 04:01:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uo5RAZI93mFEy8b5cwG3IllR6trDjj684LMijYJ9Gcsb1b5fabirogpkNcvqPCFOicM80A X-Received: by 2002:a62:6b8a:: with SMTP id g132mr27478355pfc.201.1545998510684; Fri, 28 Dec 2018 04:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545998510; cv=none; d=google.com; s=arc-20160816; b=DLcfo9uKPeO4n/S7RGbGJSMCXtl66D+ehZyN3Nn2WGfmCsHiN3U36tmbbfySijNO9T DmtC0S2iwfOCrONYmY474sHsFtIjlXOuJF+NQb0CCwEw69eQ5PdcoWl3jw/JghT9K4YW cQZgAHPP7a4r69xp3f66L639+YrWRZ8L6e94nQ+5qIZFmERB2gbo+6AaJUaSF7tZTRnH j5LVJ8f7WI6l4xo9ynYqmqbGDznApplWYdBcl+8SdxKhhvMk81FsC+k+gH35h5Jnhnkf Qp6t6ydUgx4DqIPpSSIzJp2FzusBus4YkOnjmatF/iRCbrfPAHX3hKEazwOZDkQHeY0c ahEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=AZEypn1ucVEimO2hhAdsFl0W6xAb81RU8mUfDX98K8Q=; b=sNFSq8kY8/X932dfiv2fAh9WhHuRsKbbQwBOdMH5n7ZZBfU4rBiroqRUFCMb+KPlP4 r/buQ+dIdrZkAKMHJbo2xnevht8nkuMn171879TNPY0XCmMZJBOvLYmXylfQWtmGnPH5 Mm+OAsdNz2PYlbxwbiFBRv9W12MOgUX8d/ivyRzTatY3itHlM02+Rsh8em+VZdeZVOrB h3DoxhYjhYCEQqHwhbkaURXb7JqtlBuq4/tjg5SllagiHa2E5r4+KUJJ3sHoI5PwVFcy 38akHoHPy53glkyEp64y89Ysph/jRC4aO5nLiUJtd56TeroKg9HDTQ5srVE9i3In5zzG Sj3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v190si38624259pfv.8.2018.12.28.04.01.35; Fri, 28 Dec 2018 04:01:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728578AbeL1Czx (ORCPT + 99 others); Thu, 27 Dec 2018 21:55:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbeL1Czx (ORCPT ); Thu, 27 Dec 2018 21:55:53 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E8AC3D15; Fri, 28 Dec 2018 02:55:51 +0000 (UTC) Received: from llong.remote.csb (ovpn-120-3.rdu2.redhat.com [10.10.120.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A6C761527; Fri, 28 Dec 2018 02:55:48 +0000 (UTC) Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1% regression To: "Wang, Kemi" , Linus Torvalds , "vbabka@suse.cz" , Davidlohr Bueso Cc: "yang.shi@linux.alibaba.com" , Linux Kernel Mailing List , Matthew Wilcox , "mhocko@kernel.org" , Colin King , Andrew Morton , "ldufour@linux.vnet.ibm.com" , "lkp@01.org" , "kirill.shutemov@linux.intel.com" References: <20181105050813.GP24195@shao2-debian> <60ef3584-6f3a-1a9a-94d1-3d4a5b9f1e56@redhat.com> <25017BF213203E48912DB000DE5F5E1E76365678@SHSMSX101.ccr.corp.intel.com> From: Waiman Long Openpgp: preference=signencrypt Autocrypt: addr=longman@redhat.com; prefer-encrypt=mutual; keydata= xsFNBFgsZGsBEAC3l/RVYISY3M0SznCZOv8aWc/bsAgif1H8h0WPDrHnwt1jfFTB26EzhRea XQKAJiZbjnTotxXq1JVaWxJcNJL7crruYeFdv7WUJqJzFgHnNM/upZuGsDIJHyqBHWK5X9ZO jRyfqV/i3Ll7VIZobcRLbTfEJgyLTAHn2Ipcpt8mRg2cck2sC9+RMi45Epweu7pKjfrF8JUY r71uif2ThpN8vGpn+FKbERFt4hW2dV/3awVckxxHXNrQYIB3I/G6mUdEZ9yrVrAfLw5M3fVU CRnC6fbroC6/ztD40lyTQWbCqGERVEwHFYYoxrcGa8AzMXN9CN7bleHmKZrGxDFWbg4877zX 0YaLRypme4K0ULbnNVRQcSZ9UalTvAzjpyWnlnXCLnFjzhV7qsjozloLTkZjyHimSc3yllH7 VvP/lGHnqUk7xDymgRHNNn0wWPuOpR97J/r7V1mSMZlni/FVTQTRu87aQRYu3nKhcNJ47TGY evz/U0ltaZEU41t7WGBnC7RlxYtdXziEn5fC8b1JfqiP0OJVQfdIMVIbEw1turVouTovUA39 Qqa6Pd1oYTw+Bdm1tkx7di73qB3x4pJoC8ZRfEmPqSpmu42sijWSBUgYJwsziTW2SBi4hRjU h/Tm0NuU1/R1bgv/EzoXjgOM4ZlSu6Pv7ICpELdWSrvkXJIuIwARAQABzR9Mb25nbWFuIExv bm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7anSgIkL+doXDaG21DgCYTD wGA5uquIgb8p3/ENgYpDPrsZ72CxVC2NEJjJwwnRBStjJOGQX4lV1uhN1XsZjBbRHdKF2W9g weim8xU= Organization: Red Hat Message-ID: <9a6fdc15-4ce1-9c55-d660-a9825b9ae104@redhat.com> Date: Thu, 27 Dec 2018 21:55:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <25017BF213203E48912DB000DE5F5E1E76365678@SHSMSX101.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 28 Dec 2018 02:55:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/27/2018 08:31 PM, Wang, Kemi wrote: > Hi, Waiman > Did you post that patch? Let's see if it helps. I did post the patch a while ago. I will need to rebase it to a new baseline. Will do that in a week or 2. -Longman > > -----Original Message----- > From: LKP [mailto:lkp-bounces@lists.01.org] On Behalf Of Waiman Long > Sent: Tuesday, November 6, 2018 6:40 AM > To: Linus Torvalds ; vbabka@suse.cz; Davidlohr Bueso > Cc: yang.shi@linux.alibaba.com; Linux Kernel Mailing List ; Matthew Wilcox ; mhocko@kernel.org; Colin King ; Andrew Morton ; ldufour@linux.vnet.ibm.com; lkp@01.org; kirill.shutemov@linux.intel.com > Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1% regression > > On 11/05/2018 05:14 PM, Linus Torvalds wrote: >> On Mon, Nov 5, 2018 at 12:12 PM Vlastimil Babka wrote: >>> I didn't spot an obvious mistake in the patch itself, so it looks >>> like some bad interaction between scheduler and the mmap downgrade? >> I'm thinking it's RWSEM_SPIN_ON_OWNER that ends up being confused by >> the downgrade. >> >> It looks like the benchmark used to be basically CPU-bound, at about >> 800% CPU, and now it's somewhere in the 200% CPU region: >> >> will-it-scale.time.percent_of_cpu_this_job_got >> >> 800 +-+-------------------------------------------------------------------+ >> |.+.+.+.+.+.+.+. .+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+..+.+.+.+. .+.+.+.| >> 700 +-+ +. + | >> | | >> 600 +-+ | >> | | >> 500 +-+ | >> | | >> 400 +-+ | >> | | >> 300 +-+ | >> | | >> 200 O-O O O O O O | >> | O O O O O O O O O O O O O O O O O O | >> 100 +-+-------------------------------------------------------------------+ >> >> which sounds like the downgrade really messes with the "spin waiting >> for lock" logic. >> >> I'm thinking it's the "wake up waiter" logic that has some bad >> interaction with spinning, and breaks that whole optimization. >> >> Adding Waiman and Davidlohr to the participants, because they seem to >> be the obvious experts in this area. >> >> Linus > Optimistic spinning on rwsem is done only on writers spinning on a > writer-owned rwsem. If a write-lock is downgraded to a read-lock, all > the spinning waiters will quit. That may explain the drop in cpu > utilization. I do have a old patch that enable a certain amount of > reader spinning which may help the situation. I can rebase that and send > it out for review if people have interest. > > Cheers, > Longman > > > _______________________________________________ > LKP mailing list > LKP@lists.01.org > https://lists.01.org/mailman/listinfo/lkp