Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2100062ybh; Fri, 13 Mar 2020 12:51:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtJAqzC2rjV9x74uEni/PdMKHafH6fWuO60NaH6DjKqAgDYCbBqAu8KsDS9mWK6layOZMTJ X-Received: by 2002:a9d:5607:: with SMTP id e7mr12972341oti.196.1584129083413; Fri, 13 Mar 2020 12:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584129083; cv=none; d=google.com; s=arc-20160816; b=cy2m1f3iHl8AlYeTumXFJF5U/OeppLHQ23ry0XvmZICXXexmctVWVm2iSN3FVkECjd i8G5p0yhV32z06SOa+33UdYdHWfXRVNmH/eSksuRePEMZPRQ50+WiMNZRIPLWcFBhyGg lzfO1Fu/SVUAWVebxyJ3uY9R7F9i38VzIR9KJkQOxgByZzxRfOSd/PuP0dcImYgUqKae BTEFQDnll2Yt6wIigrfP4aVK+wzPdr31+BCHTNN//aA20A6hdZxn3s9sjszHKQjEypxJ 6v+GJ+LpHG3+8KnzfZP1dWVrMmWedsAClUqobLiXjw38+DTEv7/JUj4kERq7U0dbv5RO K3jQ== 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=OccFZlfpxWSnstsDfX/t5uC4ktJwbst7Ql+mBPW6PVU=; b=I6kzNzhFjtrKJ2mXvtPPr5ZyF6CzGxTGk7oJfjRzhpkzfqwmdaF3Zijlx8QQK1rKus U0a6fKRziaYXFWKgZuAzKTISQElbtZ65SDTdzUHLmsZK2vUjaccaG3IfbjqzdrNq0/aC 5zeJaSCsHtWhGgTrQMNCg9kWxQe9zu+ltMZYsxx9Q1EhsJOtvW5iWjOMDdOQWJC0Kvnk qo526gy5i1Ug3yC2t/ppO768Y31/lLl2K5VVqqbDz2A7+0qdV5lAugMMhz1x1L4EhmiL WG01BfiFIV54VBDw+FktwJFhCRf/yE0UeV/i4xJUYkNsV7TLkPP5i1NAEASJ4bWaxF2r B/4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="L46dV9k/"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si5173655oii.2.2020.03.13.12.51.09; Fri, 13 Mar 2020 12:51:23 -0700 (PDT) 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=@google.com header.s=20161025 header.b="L46dV9k/"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbgCMTuR (ORCPT + 99 others); Fri, 13 Mar 2020 15:50:17 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:42691 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgCMTuR (ORCPT ); Fri, 13 Mar 2020 15:50:17 -0400 Received: by mail-oi1-f193.google.com with SMTP id 13so1769396oiy.9 for ; Fri, 13 Mar 2020 12:50:15 -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=Y7JxK9QPPNCLKdTCDRdG7mZ39S5AJVXOZCPfmGPuC+1RfZOhH2iBuky7Ea0orA010h PIp1HbyTvlFWgpxy+t7S6fPBI8EcqWd7LD6YqiUUK956/z6yGizNoPYWQP48lGe8aJKO sZB1IBvetH0RNzKSGmy14o0S5moOBUKfZj233NKTOSSOYYDb3SjSgSsv8mVShMRQarvq hYulL3dzlIAUa/Xz/905PS/vugnEPoeIyt6QnSQNvOha8cNEtczEDrDwWuNbEr0ksFiE P/AuONWLyvXwkKyK4xrF3DY/fo5wqXYjN7dS4/3h32K+ZpP95iwE7bv/nMWQJx3y4CAE lb5w== X-Gm-Message-State: ANhLgQ0EN5j6rZ2toxyi1l29dAd+7ox/hnw7sqSbRr7fbufAL6dUaE4m WaXHICWlFi1rmhUAvCpulDaLR7JrBXP/1lVKSeG/7w== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.