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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 8A1B3C4BA18 for ; Wed, 26 Feb 2020 17:41:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 57AC024680 for ; Wed, 26 Feb 2020 17:41:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57AC024680 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 08B806B0006; Wed, 26 Feb 2020 12:41:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 03C1E6B0008; Wed, 26 Feb 2020 12:41:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E93686B000A; Wed, 26 Feb 2020 12:41:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id CE2896B0006 for ; Wed, 26 Feb 2020 12:41:08 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C8B9B4995E6 for ; Wed, 26 Feb 2020 17:41:08 +0000 (UTC) X-FDA: 76532994216.26.goose67_7e5b3b1d05f4b X-HE-Tag: goose67_7e5b3b1d05f4b X-Filterd-Recvd-Size: 4564 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 17:41:08 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id p9so160770wmc.2 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=EXPe9Bp682NHPvUja4km1jpFhuH4kgemVI8ddXm4l+IVg1J0ZPMlIjuHpAIZ9gbowT K25O6cH/Qet8KX6Zas//ayFsStg5EWjs9bBUJHIsa7oafW5pndlQ8d9MXzC5Dj3uw3RJ U1ueF3i3mNf8LU8KlC2ySck/Ak/bZ4j0PSNcsjPeofy+36BXVFu3lWZ92+uC52iQd59s Ci/O0Q5AjvExIAeLQn6wC1ADaZzNfsgRDqqCDZI7uYEaD8jA6bGazGcJTmpruX526SHM EipE+55Ed95/8DYTZBlBGNMuU40r6F73FgiRfUKP8QZo5xO3DYgjFJofXlgW2JRyUfc6 /Low== X-Gm-Message-State: APjAAAXx322zkjT2k1frhrSabqfAvu37UKgPCAFofcIABhCIT/kuMikt wM+IcoYORizV0wkqZ2wfZnE= X-Google-Smtp-Source: APXvYqylpyZuiLHPl0bgj+fB2vFtlDLbErc4bIIPVmc3BqJ2X95+q5TE1XNn04SZE/cv5ArUb+5fUg== 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: 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 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