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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 42348CA9EA0 for ; Tue, 22 Oct 2019 10:20:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 11A6721783 for ; Tue, 22 Oct 2019 10:20:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11A6721783 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 89A546B0003; Tue, 22 Oct 2019 06:20:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8238F6B0006; Tue, 22 Oct 2019 06:20:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 711486B0007; Tue, 22 Oct 2019 06:20:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 499A06B0003 for ; Tue, 22 Oct 2019 06:20:37 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id D280F180AD81C for ; Tue, 22 Oct 2019 10:20:36 +0000 (UTC) X-FDA: 76071026472.18.cave58_5ca078ad1295b X-HE-Tag: cave58_5ca078ad1295b X-Filterd-Recvd-Size: 3363 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Oct 2019 10:20:36 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 45537ADB5; Tue, 22 Oct 2019 10:20:35 +0000 (UTC) Date: Tue, 22 Oct 2019 12:20:32 +0200 From: Oscar Salvador To: Stefan Priebe - Profihost AG Cc: Vlastimil Babka , Michal Hocko , "linux-mm@kvack.org" , l.roehrs@profihost.ag, cgroups@vger.kernel.org, Johannes Weiner Subject: Re: lot of MemAvailable but falling cache and raising PSI Message-ID: <20191022102028.GA21387@linux> References: <20190910125756.GB2063@dhcp22.suse.cz> <20190910132418.GC2063@dhcp22.suse.cz> <2fe81a9e-5d29-79cf-f747-c66ae35defd0@profihost.ag> <4f6f1bc9-08f4-d53a-8788-a761be769757@suse.cz> <76ad5b29-815b-3d87-cefa-ec5b222279f1@profihost.ag> <1430bb64-ef9b-f6a1-fb2c-1ca351e7950e@profihost.ag> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430bb64-ef9b-f6a1-fb2c-1ca351e7950e@profihost.ag> User-Agent: Mutt/1.10.1 (2018-07-13) 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, Oct 22, 2019 at 12:02:13PM +0200, Stefan Priebe - Profihost AG wrote: > > Am 22.10.19 um 09:48 schrieb Vlastimil Babka: > > On 10/22/19 9:41 AM, Stefan Priebe - Profihost AG wrote: > >>> Hi, could you try the patch below? I suspect you're hitting a corner > >>> case where compaction_suitable() returns COMPACT_SKIPPED for the > >>> ZONE_DMA, triggering reclaim even if other zones have plenty of free > >>> memory. And should_continue_reclaim() then returns true until twice the > >>> requested page size is reclaimed (compact_gap()). That means 4MB > >>> reclaimed for each THP allocation attempt, which roughly matches the > >>> trace data you preovided previously. > >>> > >>> The amplification to 4MB should be removed in patches merged for 5.4, so > >>> it would be only 32 pages reclaimed per THP allocation. The patch below > >>> tries to remove this corner case completely, and it should be more > >>> visible on your 5.2.x, so please apply it there. > >>> > >> is there any reason to not apply that one on top of 4.19? > >> > >> Greets, > >> Stefan > >> > > > > It should work, cherrypicks fine without conflict here. > > OK but does not work ;-) > > > mm/compaction.c: In function '__compaction_suitable': > mm/compaction.c:1451:19: error: implicit declaration of function > 'zone_managed_pages'; did you mean 'node_spanned_pages'? > [-Werror=implicit-function-declaration] > alloc_flags, zone_managed_pages(zone))) > ^~~~~~~~~~~~~~~~~~ > node_spanned_pages zone_managed_pages() was introduced later. On 4.19, you need zone->managed_pages. So, changing zone_managed_pages(zone) to zone->managed_pages in that chunk should make the trick. > > Greets, > Stefan > > > -- Oscar Salvador SUSE L3