Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp690689ybg; Thu, 19 Mar 2020 07:06:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvRp2+rvqsMnhO7ieJi2LkhG2asg2RXnBUZXK0qCJjMXkn1keS8dL4r0xjIOME/nzZEp/l X-Received: by 2002:a9d:7750:: with SMTP id t16mr2366783otl.333.1584626795359; Thu, 19 Mar 2020 07:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584626795; cv=none; d=google.com; s=arc-20160816; b=jB9KnoOOcVXH5LUT6e6hqTrFzUy8IdJUVyQEv7wMWclg6lIBRCmxB4ILPKb9qrEjE2 RRQvj80bMH0VDALyoOF9cpH3k0NKSGJHdQWNh7cRrKB1HvfMIzHLFaNXYUNOspJy0aeF 2jiZD1EzOa9EeM7UmNYp/7z6nnbwIQYifJXjjk8OjU7O2noy3GniXJ3u6dcV+wQEl6pd vuZjw77/W639+1WhRWI8GJN1IJDIQssMg+fCNpbGG+VBTZXPXtR92ngZWuyG+0DAjej9 NEBaP7pQnl7y8foIOv8ohXFXbPEd0lBDUkjQKn0Q/i5P2VMKcvL8qye/USXIyZ6+OhXC orXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zVUeEVeA4E7oLTV0ECgEEG2/YC9N9vz1pl7acrL5ucE=; b=r9wHGmys7uS2Zlrj9gQQwDhXIjnZZtoy2LHtOIBEuNfnNX8si+g+PITG0fmLnn7VEz nnbBt39yW5hgVNaxhMDnLeHI9yElg3V5TtVdXlu/Z8k27bJgb7KquV0EXXRz1vPnv1F7 wZzGri6nLm/bKLiVygBKMlXAehVzbgXR1g1L4sD2x8eHWSrrhcNXEz/xdUSVWID2r2Rw UcM5us1JN1orU7BKohZwy/h5pt16lLBnRa/JlA1MtyRWT4wa5MOQgkpKiYCiIYzJVO7Q wNbQdYTFYx4sExOfuqChxauYwsvfVMWBwfT65XstsDjSoOlgj3WAFByYwhbWOY6kgTDM sffw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=El9P5SNt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w203si1096631oig.54.2020.03.19.07.06.21; Thu, 19 Mar 2020 07:06:35 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=El9P5SNt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727256AbgCSODJ (ORCPT + 99 others); Thu, 19 Mar 2020 10:03:09 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39126 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbgCSODI (ORCPT ); Thu, 19 Mar 2020 10:03:08 -0400 Received: by mail-qt1-f196.google.com with SMTP id f20so1840290qtq.6 for ; Thu, 19 Mar 2020 07:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zVUeEVeA4E7oLTV0ECgEEG2/YC9N9vz1pl7acrL5ucE=; b=El9P5SNtEcEMu0/AvqR3cV/68A6G4L9fJEmMnnqpaU4OQ0wcTdBipT8Bjk/L5TvYnK /YL4acdcAJuhnKMNx0cl+WEKziQpCPoY3OjDWtb47SHlI7rduYTGncQtgQnMtTmSc3gb bn25hHomNvKLlQomjdaA2ii9mUxMS9BaOqh8BNJaKHhzw9QuFFuoEPXWF0Y/X3plqVc6 X7jn63Dn6pV8Jy3ta1wdTLHyIWH5Qz1KXtVElDpZMM+ljYohZYegpCWNm6tlhJrbyUm3 +uxKb16MMa1Uq/lY4C1lh2IgjjujBMM0uU/o/bA7L7iXRo7UzAaPpvKZB0hLC7dOlQRO bWVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zVUeEVeA4E7oLTV0ECgEEG2/YC9N9vz1pl7acrL5ucE=; b=cpQgHPIUCsQLfGXqV0GEWbXacDuplfzya/wLTb+w1ViEPMcWzyH6VqxQsDB9/2TwpZ 53y6EIX8XdF95wQ/c8wBW2zCPj4kBE19++FJSnso6LVwrt/hQfo30WblWUYihqRed0r8 jNOa35h+Z1dC+JLgIHVst+V8Rx9r9aZlRPNn8MSLctvxOog7gg7sprKYZhlHutZS56e2 JfDXs2GpwhNcwHG+t9GmsZc05U7cD0MRIsElRtyYkGJvDCG0yVW4Oa61jLqSCwTnhnXH +XDEx9SULbFYdkC6+cZ2QcswamRXA4ByU3bodxNwVdegf2f8Mae6hnyx+7J2gh20rXlF nwow== X-Gm-Message-State: ANhLgQ2JnuOi26GWLtrInb/5n5Qf58vF5P85+vZCTVRg6dKHuvCVbylJ WBH9dLn5W3lNAMg/NYRDIhB/uA== X-Received: by 2002:ac8:6f19:: with SMTP id g25mr3135902qtv.346.1584626586982; Thu, 19 Mar 2020 07:03:06 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:a9a9]) by smtp.gmail.com with ESMTPSA id p35sm1611812qtk.2.2020.03.19.07.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 07:03:06 -0700 (PDT) Date: Thu, 19 Mar 2020 10:03:05 -0400 From: Johannes Weiner To: Yang Shi Cc: shakeelb@google.com, vbabka@suse.cz, willy@infradead.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [v4 PATCH 2/2] mm: swap: use smp_mb__after_atomic() to order LRU bit set Message-ID: <20200319140305.GC187654@cmpxchg.org> References: <1584500541-46817-1-git-send-email-yang.shi@linux.alibaba.com> <1584500541-46817-2-git-send-email-yang.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1584500541-46817-2-git-send-email-yang.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 11:02:21AM +0800, Yang Shi wrote: > Memory barrier is needed after setting LRU bit, but smp_mb() is too > strong. Some architectures, i.e. x86, imply memory barrier with atomic > operations, so replacing it with smp_mb__after_atomic() sounds better, > which is nop on strong ordered machines, and full memory barriers on > others. With this change the vm-scalability cases would perform better > on x86, I saw total 6% improvement with this patch and previous inline > fix. > > The test data (lru-file-readtwice throughput) against v5.6-rc4: > mainline w/ inline fix w/ both (adding this) > 150MB 154MB 159MB > > Fixes: 9c4e6b1a7027 ("mm, mlock, vmscan: no more skipping pagevecs") > Acked-by: Vlastimil Babka > Reviewed-and-Tested-by: Shakeel Butt > Signed-off-by: Yang Shi Acked-by: Johannes Weiner