From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 895D8C10DCE for ; Fri, 13 Mar 2020 19:54:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B6EA206E2 for ; Fri, 13 Mar 2020 19:54:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B6EA206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E97136B0007; Fri, 13 Mar 2020 15:54:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E47576B0008; Fri, 13 Mar 2020 15:54:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D84936B000A; Fri, 13 Mar 2020 15:54:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id C43D56B0007 for ; Fri, 13 Mar 2020 15:54:12 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 73B0545A3 for ; Fri, 13 Mar 2020 19:54:12 +0000 (UTC) X-FDA: 76591390344.08.girl55_249a4085c1735 X-HE-Tag: girl55_249a4085c1735 X-Filterd-Recvd-Size: 4373 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Mar 2020 19:54:11 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0TsVCDSU_1584129245; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TsVCDSU_1584129245) by smtp.aliyun-inc.com(127.0.0.1); Sat, 14 Mar 2020 03:54:07 +0800 Subject: Re: [PATCH 1/2] mm: swap: make page_evictable() inline To: Shakeel Butt Cc: Vlastimil Babka , Andrew Morton , Linux MM , LKML References: <1584124476-76534-1-git-send-email-yang.shi@linux.alibaba.com> <520b3295-9fb8-04a7-6215-9bfda4f1a268@linux.alibaba.com> From: Yang Shi Message-ID: <94283259-a0ee-d134-48da-cf5400baaba1@linux.alibaba.com> Date: Fri, 13 Mar 2020 12:54:04 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 3/13/20 12:50 PM, Shakeel Butt wrote: > On Fri, Mar 13, 2020 at 12:46 PM Yang Shi wrote: >> >> >> On 3/13/20 12:33 PM, Shakeel Butt wrote: >>> On Fri, Mar 13, 2020 at 11:34 AM Yang Shi wrote: >>>> When backporting commit 9c4e6b1a7027 ("mm, mlock, vmscan: no more >>>> skipping pagevecs") to our 4.9 kernel, our test bench noticed around 10% >>>> down with a couple of vm-scalability's test cases (lru-file-readonce, >>>> lru-file-readtwice and lru-file-mmap-read). I didn't see that much down >>>> on my VM (32c-64g-2nodes). It might be caused by the test configuration, >>>> which is 32c-256g with NUMA disabled and the tests were run in root memcg, >>>> so the tests actually stress only one inactive and active lru. It >>>> sounds not very usual in mordern production environment. >>>> >>>> That commit did two major changes: >>>> 1. Call page_evictable() >>>> 2. Use smp_mb to force the PG_lru set visible >>>> >>>> It looks they contribute the most overhead. The page_evictable() is a >>>> function which does function prologue and epilogue, and that was used by >>>> page reclaim path only. However, lru add is a very hot path, so it >>>> sounds better to make it inline. However, it calls page_mapping() which >>>> is not inlined either, but the disassemble shows it doesn't do push and >>>> pop operations and it sounds not very straightforward to inline it. >>>> >>>> Other than this, it sounds smp_mb() is not necessary for x86 since >>>> SetPageLRU is atomic which enforces memory barrier already, replace it >>>> with smp_mb__after_atomic() in the following patch. >>>> >>>> With the two fixes applied, the tests can get back around 5% on that >>>> test bench and get back normal on my VM. Since the test bench >>>> configuration is not that usual and I also saw around 6% up on the >>>> latest upstream, so it sounds good enough IMHO. >>>> >>>> The below is test data (lru-file-readtwice throughput) against the v5.6-rc4: >>>> mainline w/ inline fix >>>> 150MB 154MB >>>> >>> What is the test setup for the above experiment? I would like to get a repro. >> Just startup a VM with two nodes, then run case-lru-file-readtwice or >> case-lru-file-readonce in vm-scalability in root memcg or with memcg >> disabled. Then get the average throughput (dd result) from the test. >> Our test bench uses the script from lkp, but I just ran it manually. >> Single node VM should be more obvious showed in my test. >> > Thanks, I will try this on a real machine Real machine should be better. Our test bench is bare metal with NUMA disabled. On my test VM it is not that obvious.