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 AE74CC4BA0B for ; Wed, 26 Feb 2020 09:08:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 797902084E for ; Wed, 26 Feb 2020 09:08:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 797902084E 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 1BE786B0003; Wed, 26 Feb 2020 04:08:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 170536B0005; Wed, 26 Feb 2020 04:08:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0848D6B0006; Wed, 26 Feb 2020 04:08:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E14B06B0003 for ; Wed, 26 Feb 2020 04:08:56 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B90CE83FA for ; Wed, 26 Feb 2020 09:08:56 +0000 (UTC) X-FDA: 76531703472.08.stage73_13d7969847f2f X-HE-Tag: stage73_13d7969847f2f X-Filterd-Recvd-Size: 4220 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 09:08:56 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id q9so2050331wmj.5 for ; Wed, 26 Feb 2020 01:08:55 -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=WFEIr9nnOW1UYtZBYSkNlGUPhLd1mBP0PtrFmzLzvzo=; b=YaMVZw17dCrfg05gGt1UPY5ZIF4ppFexwwstyrFzLBodzzSb9tXg0bM7D3mqwd91wx X98EX+pz3XrCqT26pX8i3rugg0wLhOnsBgzUguVaLNbl1Cu9U/kdv/aXDF8R/lXmPFSg ug9gFO13ZQnLvxsOnM9HzVuVCV/GWtp5VkG6vUe1qRiPR4ec3oU2Ct3yXmhX0DMlf7FZ BOIaeOGzjKF0Iemg7LT7FG2TzQhlanyXKz4VJQZbD2Op6zFos0jYiXrmTnlApH1tKEOI nWBsSE7RYUvjf42SpXhOBUtEOBkUPhOa1SOVCMVUzSvVNegTwYxKV2Ymelw2L8oFYt6J qEkQ== X-Gm-Message-State: APjAAAVKy2afdqTGJixA3OgNW4fFNS3oejwcVFvkMMaLw6/BRtmwV1j9 xL3Sy7S3y+Wx2SKAKJ+dJiA= X-Google-Smtp-Source: APXvYqznaluSdyT5HEc2CI7VtV7sDRhSBWd3vC/0MUtPYUuvnUN9CWBfBs4yohy3o2BHDi7VByo5ug== X-Received: by 2002:a7b:cc82:: with SMTP id p2mr4146905wma.159.1582708135122; Wed, 26 Feb 2020 01:08:55 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id a7sm2353805wrm.29.2020.02.26.01.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 01:08:54 -0800 (PST) Date: Wed, 26 Feb 2020 10:08:53 +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: <20200226090853.GC3771@dhcp22.suse.cz> References: <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> <20200221080737.GK20509@dhcp22.suse.cz> <20200221210824.GA3605@sultan-book.localdomain> <20200225090945.GJ22443@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 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. > BTW we are seeing a similar situation in our production environment. > We have swappiness=0, no swap from kswapd (because we don't swapout on > pressure, only on cold age) and too few file pages, the kswapd goes > crazy on shrink_slab and spends 100% cpu on it. I am not sure this is the same problem. It seems that the slab shrinkers are not really a bottle neck here. I would recommend you to identify which shrinkers are eating the cpu time in your case. -- Michal Hocko SUSE Labs