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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 CF637C10DCE for ; Fri, 13 Mar 2020 19:50:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 833D2206EB for ; Fri, 13 Mar 2020 19:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="L46dV9k/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 833D2206EB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2DA476B0005; Fri, 13 Mar 2020 15:50:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 28A346B0008; Fri, 13 Mar 2020 15:50:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A1126B000A; Fri, 13 Mar 2020 15:50:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id F38EA6B0005 for ; Fri, 13 Mar 2020 15:50:16 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9A373824556B for ; Fri, 13 Mar 2020 19:50:16 +0000 (UTC) X-FDA: 76591380432.24.paper44_25d00f8eab43 X-HE-Tag: paper44_25d00f8eab43 X-Filterd-Recvd-Size: 5371 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Mar 2020 19:50:16 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id p125so10694693oif.10 for ; Fri, 13 Mar 2020 12:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OccFZlfpxWSnstsDfX/t5uC4ktJwbst7Ql+mBPW6PVU=; b=L46dV9k/PzM9QibypV4eC4knKS0FospEIgjO0pKLmL165/ljUyO1wMUpMarNZMSC0L DFLjnQTReeU4uRUinvMYBZKAvzuO5MS7vAiSrMDO6bnlnkunbTzqXVl407N0L2OsHPV5 ReXdVu7++HhTBhMlqfLP+Xq1corIFcIt2I6cVXmVUnRmr22xwa0RNLQs4sXymJxNwJS/ J00GoDl61Vc139H+EDhsYtgQ9KZgNmCDKXFi1ozNo0nmG+Fen/RZf59UG3dH1/3031AV xkoFy2+8AddbRkZVnrP2Egjeo7/JRe+NuUJTjSoX2eyNGLab2W1sTS8rYgYeqAeOldyC /pUQ== 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=OccFZlfpxWSnstsDfX/t5uC4ktJwbst7Ql+mBPW6PVU=; b=UBsX5zqQ9AeuNM4jbWTfLNhToKT3Eh/1+9o48onWFA8U0uOZ92lq3HBAoi+60HphAl ep+/SXQUawwmYEsz0er2wncIAhFfgp/1ICF7ngMMq+l6gOoS2vonkjd1yMlX1YcSnP0O KZhW3JFZd4j+r3YRR2rbGHyit3E03o2NOcyVaRbL78+Kd4tOoVx0hTW4MWuXJ4tGRCCJ aFc5e4yjhD4rqlUCJL/BC/C2KblKqPPGjaq+Ff20bRQKG6XymiZzBTTptb5p02FwDSzv vWvDj4Mtfwpo8BRJ1h8jx1nvyNimK1BalPfkER362at8fj7k9+MYqimQSg5Xgq1LG0LM 0sow== X-Gm-Message-State: ANhLgQ1YXtRkVT0AFzD0ne4ZQ/wL363xpAMr+jIqJClfAq+75qN4cPaX X1jj7OVwFqO3QDEmfQUY07bZAXTBEfYZUfEdSPVzIEE0 X-Google-Smtp-Source: ADFU+vuK5rsLC27IKgedSMZOd3/7MdVEra22iRgF8H1TVNIMVjy3OhlzxllzrbKh/L8EAM3AjLpbkW+q10p4CfDXGys= X-Received: by 2002:aca:ed54:: with SMTP id l81mr8669490oih.69.1584129015069; Fri, 13 Mar 2020 12:50:15 -0700 (PDT) MIME-Version: 1.0 References: <1584124476-76534-1-git-send-email-yang.shi@linux.alibaba.com> <520b3295-9fb8-04a7-6215-9bfda4f1a268@linux.alibaba.com> In-Reply-To: <520b3295-9fb8-04a7-6215-9bfda4f1a268@linux.alibaba.com> From: Shakeel Butt Date: Fri, 13 Mar 2020 12:50:04 -0700 Message-ID: Subject: Re: [PATCH 1/2] mm: swap: make page_evictable() inline To: Yang Shi Cc: Vlastimil Babka , Andrew Morton , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000017, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.