mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	rong.a.chen@intel.com, vbabka@suse.cz,
	kirill.shutemov@linux.intel.com, mhocko@kernel.org,
	willy@infradead.org, ldufour@linux.vnet.ibm.com,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Colin King <colin.king@canonical.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	lkp@01.org
Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1% regression
Date: Mon, 5 Nov 2018 10:28:02 -0800	[thread overview]
Message-ID: <4feae9c4-432d-a362-58e4-11e0cb10b24d@linux.alibaba.com> (raw)
In-Reply-To: <CAHk-=wi8BNNTp+Xt4ROz1TqGgFT-c6-Hmmc9yW0B6p2FTFwJTg@mail.gmail.com>



On 11/5/18 9:50 AM, Linus Torvalds wrote:
> On Sun, Nov 4, 2018 at 9:08 PM kernel test robot <rong.a.chen@intel.com> wrote:
>> FYI, we noticed a -64.1% regression of will-it-scale.per_thread_ops
>> due to commit 9bc8039e715d ("mm: brk: downgrade mmap_sem to read when
>> shrinking")
> Ugh. That looks pretty bad.
>
>> in testcase: will-it-scale
>> on test machine: 8 threads Ivy Bridge with 16G memory
>> with following parameters:
>>
>>          nr_task: 100%
>>          mode: thread
>>          test: brk1
>>          ucode: 0x20
>>          cpufreq_governor: performance
> The reason seems to be way more scheduler time due to lots more
> context switches:
>
>>    34925294 ± 18%    +270.3%  1.293e+08 ±  4%  will-it-scale.time.voluntary_context_switches
> Yang Shi, would you mind taking a look at what's going on?

No problem.

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.

Since the optimization makes more sense to large mapping, how about 
restore the mapping size limit, e.g. just downgrade mmap_sem for >= 1g 
(PUD_SIZE) mapping?

Thanks,
Yang

>
>                Linus


  reply	other threads:[~2018-11-05 18:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  5:08 kernel test robot
2018-11-05 17:50 ` Linus Torvalds
2018-11-05 18:28   ` Yang Shi [this message]
2018-11-05 18:35     ` Linus Torvalds
2018-11-05 20:17       ` Yang Shi
2018-11-05 20:09   ` Vlastimil Babka
2018-11-05 22:14     ` Linus Torvalds
2018-11-05 22:40       ` Waiman Long
2018-12-28  1:31         ` Wang, Kemi
2018-12-28  2:55           ` Waiman Long
2018-12-28  2:55             ` kemi
2019-01-31  0:06             ` Tim Chen
2019-01-31  2:54               ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4feae9c4-432d-a362-58e4-11e0cb10b24d@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=colin.king@canonical.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mhocko@kernel.org \
    --cc=rong.a.chen@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®