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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 74BC4C34051 for ; Wed, 19 Feb 2020 15:02:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 398BD2465D for ; Wed, 19 Feb 2020 15:02:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 398BD2465D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E56AB6B0006; Wed, 19 Feb 2020 10:02:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB9776B0007; Wed, 19 Feb 2020 10:02:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C81646B0008; Wed, 19 Feb 2020 10:02:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id AB4876B0006 for ; Wed, 19 Feb 2020 10:02:21 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 51A8D9410 for ; Wed, 19 Feb 2020 15:02:21 +0000 (UTC) X-FDA: 76507192482.14.fall82_4ea1a0785b753 X-HE-Tag: fall82_4ea1a0785b753 X-Filterd-Recvd-Size: 3669 Received: from outbound-smtp06.blacknight.com (outbound-smtp06.blacknight.com [81.17.249.39]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 15:02:20 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp06.blacknight.com (Postfix) with ESMTPS id CD4C5C2A93 for ; Wed, 19 Feb 2020 15:02:18 +0000 (GMT) Received: (qmail 8528 invoked from network); 19 Feb 2020 15:02:18 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.18.57]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 19 Feb 2020 15:02:18 -0000 Date: Wed, 19 Feb 2020 15:02:15 +0000 From: Mel Gorman To: Alexander Duyck Cc: kvm@vger.kernel.org, david@redhat.com, mst@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, yang.zhang.wz@gmail.com, pagupta@redhat.com, konrad.wilk@oracle.com, nitesh@redhat.com, riel@surriel.com, willy@infradead.org, lcapitulino@redhat.com, dave.hansen@intel.com, wei.w.wang@intel.com, aarcange@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, mhocko@kernel.org, alexander.h.duyck@linux.intel.com, vbabka@suse.cz, osalvador@suse.de Subject: Re: [PATCH v17 8/9] mm/page_reporting: Add budget limit on how many pages can be reported per pass Message-ID: <20200219150215.GU3466@techsingularity.net> References: <20200211224416.29318.44077.stgit@localhost.localdomain> <20200211224719.29318.72113.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20200211224719.29318.72113.stgit@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Tue, Feb 11, 2020 at 02:47:19PM -0800, Alexander Duyck wrote: > From: Alexander Duyck > > In order to keep ourselves from reporting pages that are just going to be > reused again in the case of heavy churn we can put a limit on how many > total pages we will process per pass. Doing this will allow the worker > thread to go into idle much more quickly so that we avoid competing with > other threads that might be allocating or freeing pages. > > The logic added here will limit the worker thread to no more than one > sixteenth of the total free pages in a given area per list. Once that limit > is reached it will update the state so that at the end of the pass we will > reschedule the worker to try again in 2 seconds when the memory churn has > hopefully settled down. > > Again this optimization doesn't show much of a benefit in the standard case > as the memory churn is minmal. However with page allocator shuffling > enabled the gain is quite noticeable. Below are the results with a THP > enabled version of the will-it-scale page_fault1 test showing the > improvement in iterations for 16 processes or threads. > > Without: > tasks processes processes_idle threads threads_idle > 16 8283274.75 0.17 5594261.00 38.15 > > With: > tasks processes processes_idle threads threads_idle > 16 8767010.50 0.21 5791312.75 36.98 > > Signed-off-by: Alexander Duyck Seems fair. The test case you used would have been pounding on the zone lock at fairly high frequency so it represents a worst-case scenario but not necessarily an unrealistic one Acked-by: Mel Gorman -- Mel Gorman SUSE Labs