Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2164361ybv; Fri, 21 Feb 2020 10:06:15 -0800 (PST) X-Google-Smtp-Source: APXvYqz4CR4WtnjrLdE/DzDhSHg66zj4Ki6QDq314vPaT9VHNJrqQHFhIJXBdHseXtL4CyYcYLTo X-Received: by 2002:a05:6808:251:: with SMTP id m17mr2963016oie.15.1582308375046; Fri, 21 Feb 2020 10:06:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582308375; cv=none; d=google.com; s=arc-20160816; b=VUynEIckeOn5a5HtD1Vv8eJhY6Ay8rxKBu3v23rvuz5uOxUXbNSp24cPFjOQLYJWRp hmjIJdwjDWpxkB1Foj17zojNGuezqD6VJ4v1tH/il+Sh13O1kAXvqNIxaBJ8UIad3qvL FU/Aece9Etq9lhWph9Hw+XPUk+kS3HUaRgmRrdK5lx9JPuRVhMBXIzD4ulpOTnB3lJsp Hw3otfeT/7ukpSHC94pF3zjeJxTp6pbFTtMNFHgfdShFTo27eeCM5Jl+Djrgaf+K/D2E L6oGD0FsoBWQDI9/jID0cov0kxuGgn6pwYItVIZFZCYPkMHz0hqjMaQRHylDEKtzbF5W x8HA== 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=5ZEsDlM59Sj/RHwGNdew8SDtWtfbg/Uljhkjj++yjlw=; b=Fb3FxyoSLYlKbYckjQSW3zHi9PssgLiEYnMsWvAaJYZ1kZ6MEd7J/MHogQGvApKu7s Mm3wftLS+smBNUk1QKnfN8pxikahqzR1zpBvZHl/v9f7Pwwc5sbdlgkhA3hUy/SZxJ/2 781KQN6V99UAarzPDNhSgkBG11y21SYr14RjGu2sz/KN8iZB7nEKE8CF8n5mnnh53JMB myHvIdw4sTytmHbl6+tEzOUgC8jgGxcebkJusRiMB2VRIOTl3KqwAeHCw6vZEeJ50/kU aRocEilvurKHF51mhyzMqXe/qbi2oNuUo+9C81A5Vy4521zyZvrMQjo0rFFXt7qcUQhr Qw8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eFFQKkRW; 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 i23si1723847oto.206.2020.02.21.10.05.59; Fri, 21 Feb 2020 10:06:15 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=eFFQKkRW; 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 S1729533AbgBUSEv (ORCPT + 99 others); Fri, 21 Feb 2020 13:04:51 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:36663 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgBUSEv (ORCPT ); Fri, 21 Feb 2020 13:04:51 -0500 Received: by mail-oi1-f195.google.com with SMTP id c16so2458299oic.3 for ; Fri, 21 Feb 2020 10:04:50 -0800 (PST) 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=5ZEsDlM59Sj/RHwGNdew8SDtWtfbg/Uljhkjj++yjlw=; b=eFFQKkRW6laZCJHyLGg6Zo/2IoFvqvNVm+8KXB4uMV5RjmShgagGZNNPwO9C/pKrip xW8nbsjmSU6ysyqsdm2vFoRbyR4ncl2PXC5xOLTUSUxWZs5f4QV0/iQP1UVsRTxij2mV 4X31O+iLn1g35sQuw7yGB1yhoq6XUgD7daK4X9BVO1TNUK58lBIiX9D5DfAm5DW0nBvt uQgr4uu0BqWfgWWvdDPMehSWqVbYbZyyV5tqJH04ZyGAbOTAd3Dh7SSXTlXKMIpV6WPL UxndENg477sLacS0fQBvL/K6qG34V+GnF/PnGFBsFFRGDuWT0gjU13+kzOKgwEScLp31 34Dg== 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=5ZEsDlM59Sj/RHwGNdew8SDtWtfbg/Uljhkjj++yjlw=; b=gDVL7cWNYT1Sqcnu2W3DuD4YHnA+4IMnpAPY/Xpc69p2cm41txeoyTXlQzUPb8yZsg fH0PxypPuL06sMzEiLQ3m+yaTf1Ak2KykDmrjJvRsqPSVOUtoNN6rtZDC9vAUn4mZ0+p NOgQxUpB5lmaT5ygXqL4lkevZCfgTrQim6OxFMtZ5WHhEfhwvdaj1MdJFkF3F9mlQaO1 +GOY02NWDjHF3XnrxC3NKeQNjnT6L2HhhzhGcckC0YhBlrRC7ZgOboRt16q2T1Hedn/t edVkBvweEHtUbGJJAxoOTWcc0vhBs0jxpbGuIolaAzMmSFSJFUxf0IP2eS80fQvuwP49 jnuA== X-Gm-Message-State: APjAAAXQu175v5dGCRN3ZVNudC/xSnmgHpt1m2wkFHDqiwqjoN+nD1i7 vmVzJLvwcbNdTOh8ZKFnKBTk8Ot7ylyirkGvcvH+VQ== X-Received: by 2002:a05:6808:30d:: with SMTP id i13mr2894335oie.144.1582308289790; Fri, 21 Feb 2020 10:04:49 -0800 (PST) MIME-Version: 1.0 References: <20200219182522.1960-1-sultan@kerneltoast.com> <20200219194006.GA3075@sultan-book.localdomain> <20200219200527.GF11847@dhcp22.suse.cz> <20200219204220.GA3488@sultan-book.localdomain> <20200219214513.GL3420@suse.de> <20200219224231.GA5190@sultan-book.localdomain> <20200220101945.GN3420@suse.de> <20200221042232.GA2197@sultan-book.localdomain> In-Reply-To: <20200221042232.GA2197@sultan-book.localdomain> From: Shakeel Butt Date: Fri, 21 Feb 2020 10:04:38 -0800 Message-ID: Subject: Re: [PATCH] mm: Stop kswapd early when nothing's waiting for it to free pages To: Sultan Alsawaf Cc: Mel Gorman , Michal Hocko , Dave Hansen , Andrew Morton , Linux MM , LKML , Johannes Weiner 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 Thu, Feb 20, 2020 at 8:22 PM Sultan Alsawaf wrote: > > On Thu, Feb 20, 2020 at 10:19:45AM +0000, Mel Gorman wrote: > > I'm not entirely convinced. The reason the high watermark exists is to have > > kswapd work long enough to make progress without a process having to direct > > reclaim. The most straight-forward example would be a streaming reader of > > a large file. It'll keep pushing the zone towards the low watermark and > > kswapd has to keep ahead of the reader. If we cut kswapd off too quickly, > > the min watermark is hit and stalls occur. While kswapd could stop at the > > min watermark, it leaves a very short window for kswapd to make enough > > progress before the min watermark is hit. > > > > At minimum, any change in this area would need to include the /proc/vmstats > > on allocstat and pg*direct* to ensure that direct reclaim stalls are > > not worse. > > > > I'm not a fan of the patch in question because kswapd can be woken between > > the low and min watermark without stalling but we really do expect kswapd > > to make progress and continue to make progress to avoid future stalls. The > > changelog had no information on the before/after impact of the patch and > > this is an area where intuition can disagree with real behaviour. > > > > -- > > Mel Gorman > > SUSE Labs > > Okay, then let's test real behavior. > > I fired up my i5-8265U laptop with vanilla linux-next and passed mem=2G on the > command line. After boot up, I opened up chromium and played a video on YouTube. > Immediately after the video started, my laptop completely froze for a few > seconds; then, a few seconds later, my cursor began to respond again, but moving > it around was very laggy. The audio from the video playing was choppy during > this time. About 15-20 seconds after I had started the YouTube video, my system > finally stopped lagging. > > Then I tried again with my patch applied (albeit a correct version that doesn't > use the refcount API). Upon starting the same YouTube video in chromium, my > laptop didn't freeze or stutter at all. The cursor was responsive and there was > no stuttering, or choppy audio. > > I tested this multiple times with reproducible results each time. > > I will attach a functional v2 of the patch that I used. > Can you also attach the /proc/zoneinfo? Maybe the watermarks are too high.