Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp910624imu; Mon, 5 Nov 2018 10:37:17 -0800 (PST) X-Google-Smtp-Source: AJdET5eq0tYLNwsrLCiU5AuDsBzD57gWdT70luoHLsS+KQ1eXZs0f6Rr4Wlacd6oj21Ch9XYzPJM X-Received: by 2002:a62:ac18:: with SMTP id v24-v6mr23143970pfe.126.1541443037308; Mon, 05 Nov 2018 10:37:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541443037; cv=none; d=google.com; s=arc-20160816; b=F2AvTpqDy+8+TIqdLA8QJ8JNDYdC7qVoB7vP4veix0DSdgOWcxkARzb3L9VpvdnGG7 K7ITLHCv/6jF+4UBrxnnzBh9P4mIZJxcGKQSBeQ7OPKr5RkNyhfQIY32eHPNNgi60a5O gfwW9ipywaN5YdTeke+8r2Ocqc9IPX1xr/v+XNMnu2zp23sXjkUEQO7sLVAyKOKTPj6q ETstUg158O2BDb1Z9+5v9u/L5Pl7sIQPURt2di99Pyk0gDL8aAMj2S3nBe10j6SIEJr1 qf3OjHeijbjiuj2rYNMMmxdFf4e1RNX1lkYyOJCdNzow/Chu6s6YhhnxmeXrktKE/VJ3 JrNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+6Oj6LMobWv0rkTof5rn6OOvXppEv/CSmsab7vzk7/0=; b=YE3xyvQKRmW0qc4mu56ejR34Jky4pVAhNxmv8Rp5YIpnVd7VvTigy+AaF+laQkPG7J tnCSMzMqelwTnFVG9oW5iWSAyhY0+mRmadquCWTaId+2Ad5tb8BCvEpOLWKXemS6L6NW cTagcpBbXveLboawl+dMprfthbK8TfakOs1ESRKgMfoTQ+BAih6KMfGi/072j1CFRbjE 2M/HJjH789xchHGDV61wx0JsZaNdWzTSmH+KQ9hYc82qGFxndPrsTqHKYwCHwvPkhqKm tuM9DIzYiHfwKtnniIxWGwBgwGGLyGsaX6AnrveVBIAf5ZWWe6YBq4QE6ZmxpGJ3iSRE ndSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aJ6BOD5b; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si21150111pgl.235.2018.11.05.10.37.01; Mon, 05 Nov 2018 10:37:17 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aJ6BOD5b; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387893AbeKFD4t (ORCPT + 99 others); Mon, 5 Nov 2018 22:56:49 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41837 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387702AbeKFD4t (ORCPT ); Mon, 5 Nov 2018 22:56:49 -0500 Received: by mail-lj1-f196.google.com with SMTP id z80-v6so8994730ljb.8 for ; Mon, 05 Nov 2018 10:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+6Oj6LMobWv0rkTof5rn6OOvXppEv/CSmsab7vzk7/0=; b=aJ6BOD5bAFpSuDwGt4t0l4mmxy+pJ/6vgu2RA7wyR3ictd7NuKn9euJ8h4AmX61deW 4NPL0rRYfAaiVmhfhNSY+12YRRZcCalNo8+b3ts6EpwppZC7hJo6deOInasyftrmABMb CvtdKZHtowF+trV+FA1/R6R5ew3j0OqazcNAQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+6Oj6LMobWv0rkTof5rn6OOvXppEv/CSmsab7vzk7/0=; b=pbsWtklm4yzYBs/x1nFTVc5+iR/0ywSEaKtqwAwpg+u7zTQvLXvSGvFJ3uoWBIYLHU m3ZrdoBMGatwAPfDb7bj1QkksSYZM1n113AGgqXKEIG5aSwMieJ0TnK2MsQezeKxqAdg uy6YNIenH9YD7+Pk4Ll/3RTZ/XSxHZApyaIUKFOiwvGHqg3MRrGMiIC65GA+RE/H/4Ep bfZ9Xc29wS2/qQFCzdz/s45F3mCMGMHWdoEDuwq0PSje8gBeiA11Nh3nciTZi4qG1Gi4 hXolhN7aSrPKMcRiaxjHt2lzvvdcFIahW7Y5DgNaWyJC6rgiPq9pybmuPoBUULjPOW3I Tu8Q== X-Gm-Message-State: AGRZ1gIqHFz3RyyYWXhYr5fkY2M2A6zNG8sRG2j6e2didnSfENou0EqF ZtEj+lg+yuTNj4dUccdmT/ay/MX3W2mWRw== X-Received: by 2002:a2e:9a56:: with SMTP id k22-v6mr11380664ljj.17.1541442949984; Mon, 05 Nov 2018 10:35:49 -0800 (PST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id b5-v6sm1899487lfi.40.2018.11.05.10.35.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 10:35:49 -0800 (PST) Received: by mail-lj1-f181.google.com with SMTP id u6-v6so9033626ljd.1 for ; Mon, 05 Nov 2018 10:35:48 -0800 (PST) X-Received: by 2002:a2e:3e06:: with SMTP id l6-v6mr11443510lja.148.1541442947860; Mon, 05 Nov 2018 10:35:47 -0800 (PST) MIME-Version: 1.0 References: <20181105050813.GP24195@shao2-debian> <4feae9c4-432d-a362-58e4-11e0cb10b24d@linux.alibaba.com> In-Reply-To: <4feae9c4-432d-a362-58e4-11e0cb10b24d@linux.alibaba.com> From: Linus Torvalds Date: Mon, 5 Nov 2018 10:35:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1% regression To: yang.shi@linux.alibaba.com Cc: rong.a.chen@intel.com, vbabka@suse.cz, kirill.shutemov@linux.intel.com, mhocko@kernel.org, Matthew Wilcox , ldufour@linux.vnet.ibm.com, Andrew Morton , Colin King , Linux Kernel Mailing List , lkp@01.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 5, 2018 at 10:28 AM Yang Shi wrote: > > Actually, the commit is mainly for optimizing the long stall time caused > by holding mmap_sem by write when unmapping or shrinking large mapping. > It downgrades write mmap_sem to read when zapping pages. So, it looks > the downgrade incurs more context switches. This is kind of expected. > > However, the test looks just shrink the mapping with one normal 4K page > size. It sounds the overhead of context switches outpace the gain in > this case at the first glance. I'm not seeing why there should be a context switch in the first place. Even if you have lots of concurrent brk() users, they should all block exactly the same way as before (a write lock blocks against a write lock, but it *also* blocks against a downgraded read lock). So no, I don't want just some limit to hide this problem for that particular test. There's something else going on. Linus