Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp110308ybf; Wed, 26 Feb 2020 09:42:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxfkUDgwJM4k/OKoayDf6DXL5lA4+hHynCk6krzCpoUR6vuy16hFaVVXDaaFJwQsgUoXnxm X-Received: by 2002:a9d:20c1:: with SMTP id x59mr4210576ota.286.1582738964128; Wed, 26 Feb 2020 09:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582738964; cv=none; d=google.com; s=arc-20160816; b=ZFmEZBQxBZB6y20TesYPOVVU5WJ4kFm/+AUEV0h5KO3sxvnzms17svenF1DcwXRzIp g5WFAbolzDbKD4TiHvX6hhYQ4dK6Pl//DI75QapVu/eJMm4f3FBHBp2+LmjOe8jMNtTw 4D95X8VU77D+kBsIeuqj07PIvL/GghIlllcJzbQUOFM8HGyGhDc8/IGvCZnqFTTk8pQ8 wLqcr0JuliwSlu/FjRuxg04+ji+KJV4P0YypXQKE8cKvReCjV/TA6c9EbC/0rhfuD+F7 OB8MHcyLt4kne01Yd8OYXHuN3mjPw4sUGflOmSaI+7aMx5TnpDYEj1MCKbdkXgb/PfTf zSvg== 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=GLdXH3d/s4CzQ24AaP/4zwhvm9lsjM7QDg7JcTBxQ2M=; b=PezgcOjK6XnYVcz4DdJjZ5Cte1HtDxZWAyWSTOCb2pJTYDU6v/8/kwW/RsRC7rGARt BV9svNZoNZbmHKC8kflCWMKyvIa8ErU6DGhVQ7TqnpY2ujkWFmQBOyhljjhqPOCBTDkG GRqeTNg3sCuetnin0ag/tLyGni1NnCpzqhWKaqgBA112Tkq5GAPdpHux3nq9+RkldUCp 9iPUlXZbLvCllejIy4mmAlImEIWtaHoFYg5J2pyO5a8o8SEIcQw3d7yxAY5LRwlBa4yd zuQml60zcQwwopoGRkNWntcJUSKL0kLjSjUe/qwBiVXT2xLaO6lygSmQO6VOIGflHzSB a+kA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c67si1453545oib.276.2020.02.26.09.42.31; Wed, 26 Feb 2020 09:42:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgBZRlJ (ORCPT + 99 others); Wed, 26 Feb 2020 12:41:09 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54891 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgBZRlI (ORCPT ); Wed, 26 Feb 2020 12:41:08 -0500 Received: by mail-wm1-f65.google.com with SMTP id z12so143298wmi.4 for ; Wed, 26 Feb 2020 09:41:07 -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=GLdXH3d/s4CzQ24AaP/4zwhvm9lsjM7QDg7JcTBxQ2M=; b=V4i4OJoXKeHm/Fj0ckpzwWzn6GHKN0nUgwAkoPJcgP2q7jRU1rm+GHMM8iZf+h8sLx pvjpJ3iKFpY8p+uSu/AgooNFMOZ1koHN17hcncelAQn3RbDTLnNS1voAQMSfeC1Ie50f CYKCYZ/dfIqwIYXpmNyoi+kDM3D2FVVmRwFf0K/nSnM0xBYqYXajq3C0RKZRB/YpBd8v 8vUQixdrZ0TtDGRUpxFiegmIRcxokD83lSRxawWg1GGjIg3pATMWK2rYQvmB+2dhq6uL HRG320hzQSthwXlRdeI226wIkMGRSyhkWOS4gcQLeFaBvCiIRjWrBoRcM9RzIrQIOVnA b7uw== X-Gm-Message-State: APjAAAWUeddIUbeerIa9KO9mfGYZ5PpYcC2wbw3hso4OjOcqVrPT4lTj fb5FuObvpQikwxqPMvs8XPE= X-Received: by 2002:a7b:cc82:: with SMTP id p2mr6474200wma.159.1582738866620; Wed, 26 Feb 2020 09:41:06 -0800 (PST) Received: from localhost (ip-37-188-190-100.eurotel.cz. [37.188.190.100]) by smtp.gmail.com with ESMTPSA id e1sm4136706wrt.84.2020.02.26.09.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 09:41:05 -0800 (PST) Date: Wed, 26 Feb 2020 18:41:04 +0100 From: Michal Hocko To: Shakeel Butt Cc: Sultan Alsawaf , Mel Gorman , Dave Hansen , Andrew Morton , Linux MM , LKML , Johannes Weiner Subject: Re: [PATCH] mm: Stop kswapd early when nothing's waiting for it to free pages Message-ID: <20200226174104.GO3771@dhcp22.suse.cz> References: <20200219214513.GL3420@suse.de> <20200219224231.GA5190@sultan-book.localdomain> <20200220101945.GN3420@suse.de> <20200221042232.GA2197@sultan-book.localdomain> <20200221080737.GK20509@dhcp22.suse.cz> <20200221210824.GA3605@sultan-book.localdomain> <20200225090945.GJ22443@dhcp22.suse.cz> <20200226090853.GC3771@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 26-02-20 09:00:57, Shakeel Butt wrote: > On Wed, Feb 26, 2020 at 1:08 AM Michal Hocko wrote: > > > > On Tue 25-02-20 14:30:03, Shakeel Butt wrote: > > > On Tue, Feb 25, 2020 at 1:10 AM Michal Hocko wrote: > > > > > > > [snip] > > > > > > > > The proper fix should, however, check the amount of reclaimable pages > > > > and back off if they cannot meet the target IMO. We cannot rely on the > > > > general reclaimability here because that could really be thrashing. > > > > > > > > > > "check the amount of reclaimable pages" vs "cannot rely on the general > > > reclaimability"? Can you clarify? > > > > kswapd targets the high watermark and if your reclaimable memory (aka > > zone_reclaimable_pages) is lower than the high wmark then it cannot > > simply satisfy that target, right? Keeping reclaim in that situations > > seems counter productive to me because you keep evicting pages that > > might be reused without any feedback mechanism on the actual usage. > > Please see my other reply. > > > > I understand and agree with the argument that if reclaimable pages are > less than high wmark then no need to reclaim. Regarding not depending > on general reclaimability, I thought you meant that even if > reclaimable pages are over high wmark, we might not want to continue > the reclaim to not cause thrashing. Is that right? That is a completely different story. I would stick with the pathological problem reported here. General threshing problem is much more complex and harder to provide a solution for without introducing a lot of policy into the reclaim. -- Michal Hocko SUSE Labs