lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4feae9c4-432d-a362-58e4-11e0cb10b24d@linux.alibaba.com>
Date:   Mon, 5 Nov 2018 10:28:02 -0800
From:   Yang Shi <yang.shi@...ux.alibaba.com>
To:     Linus Torvalds <torvalds@...ux-foundation.org>,
        rong.a.chen@...el.com, vbabka@...e.cz,
        kirill.shutemov@...ux.intel.com, mhocko@...nel.org,
        willy@...radead.org, ldufour@...ux.vnet.ibm.com,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Colin King <colin.king@...onical.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        lkp@...org
Subject: Re: [LKP] [mm] 9bc8039e71: will-it-scale.per_thread_ops -64.1%
 regression



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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ