Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1042966ybv; Wed, 19 Feb 2020 14:46:30 -0800 (PST) X-Google-Smtp-Source: APXvYqww2re+H/+pxC6a6MV7v3ZIL0m9JCVLQJGktzpgHB++W3/ZkfkC1QlX9p/JYNHfBF8iPsxK X-Received: by 2002:a05:6830:1047:: with SMTP id b7mr22509280otp.77.1582152390458; Wed, 19 Feb 2020 14:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582152390; cv=none; d=google.com; s=arc-20160816; b=X5u14o33TfztXcXo7WdAjT4tmWRdiujJgGsRzbmNMC0qTrF82xesUDBBxTcXmCzVm2 JF9etBn6Hi/EiXSFQetCK17AZt1BR+18PChyYZItd6aBRz07+bbWSI/15pVQGi49T145 3U5eo98VNncVoekv8sXS0r9Xft07n0KquAn09Omn4aMg4XnIuk76DMxWQCOguPJMq1Wg dtGAOtjqyMIMYecOobxVe35sDDaigGij22jbdfR0S6fQZi6M159ACTp0ZKMKeg8sUOJh bOAXk6WQm/jQOKG99GADcGEOOThD6RNZhk41Q086O9f+1D44lXupiy0GFfJJ/+7Xhcdz ce4w== 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; bh=lLbGCApp0kw/cxO3wVgRURONxiOtR+9Pq112uDjPMic=; b=wlh0WwcwEMda75GiiB5agUGMv2DE7akaOlG731psHAH4rrl/oQCG9znn/s0lZwoIiH dnG9BTfYppVL0E7clz2SOgZTsZaiEHLmHg4TkHBCE/WDhYBzmkJV6WPq/485kWrAG/+8 sssRAW/Kvb0Uaw0UxCRH+MC2m4tWfcORTeRfgxoFkwo3H9qsgSDVOG7F7fNyvd4Kw/Jt s3hTxpHgWMCRWvv6/b5yJq9nPWphXiwIcL8WEDgWdVvShd9i43R/ABvLt5nPVP85B9Tr h8LkWpavaKH1Jrfjx6X5XRS7Co3wKArV2hITALFEigM+qLY6clttJZbEXZJmuzoyq6k5 roIA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si669415otq.122.2020.02.19.14.46.18; Wed, 19 Feb 2020 14:46:30 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbgBSWpG (ORCPT + 99 others); Wed, 19 Feb 2020 17:45:06 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:52265 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727232AbgBSWpG (ORCPT ); Wed, 19 Feb 2020 17:45:06 -0500 Received: by mail-pj1-f65.google.com with SMTP id ep11so1639pjb.2 for ; Wed, 19 Feb 2020 14:45:06 -0800 (PST) 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=lLbGCApp0kw/cxO3wVgRURONxiOtR+9Pq112uDjPMic=; b=FWHHth5cXf9YwDIY1a770hHPFHPmIGuR7k15yKwf/YNxBM3ikR1BLuh2il5meJ+NZq Ruzoz4Lvj0dU0aOIJhFRCd5vJ8LCUVaNG4cZgBibkIRe48bFppmTASKq5RBbJbNU8lif 3JprgUoubXqlZLsxazvq2wUvQMbyNugGR9O58MeUaY+zWj+3Yjy33+8Lq0Ck1guRDCL4 sCvfrWqp2Z/udJTquE4S54MydG1SEeLCX0WYYOGEOgmQfZisbNj3yk6HRYf9TUqSbMf+ AEv0CGtSARl46lS2107oVJKG3PzKJnpxA+TwNuty83Di6JHQGZeaSTjBlsEf8dFl+whT b5KA== X-Gm-Message-State: APjAAAUYB/+fwvg1laS0E/ABoIDw45i6Kl6SKtUUd5u36tgeqSJaQtMP qm0QeyL4k7vPmZsoVUVI1auApb14 X-Received: by 2002:a17:902:123:: with SMTP id 32mr28771095plb.38.1582152305677; Wed, 19 Feb 2020 14:45:05 -0800 (PST) Received: from sultan-book.localdomain ([104.200.129.62]) by smtp.gmail.com with ESMTPSA id o9sm652686pfg.130.2020.02.19.14.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 14:45:05 -0800 (PST) Date: Wed, 19 Feb 2020 14:45:03 -0800 From: Sultan Alsawaf To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Stop kswapd early when nothing's waiting for it to free pages Message-ID: <20200219224503.GB5190@sultan-book.localdomain> References: <20200219182522.1960-1-sultan@kerneltoast.com> <20200219112653.116de9db314dade1f6086696@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200219112653.116de9db314dade1f6086696@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2020 at 11:26:53AM -0800, Andrew Morton wrote: > On Wed, 19 Feb 2020 10:25:22 -0800 Sultan Alsawaf wrote: > > > Keeping kswapd running when all the failed allocations that invoked it > > are satisfied incurs a high overhead due to unnecessary page eviction > > and writeback, as well as spurious VM pressure events to various > > registered shrinkers. When kswapd doesn't need to work to make an > > allocation succeed anymore, stop it prematurely to save resources. > > Seems sensible. > > Please fully describe the userspace-visible runtime effects of this > change? > FWIW, it looks like the refcount API doesn't allow refcounts to be zero, so I'd have to update this patch to use just plain atomic_t instead. But since there doesn't seem to be much interest in this, I'll only send an updated patch if it's desired. Sultan