From patchwork Sun Dec 1 01:57:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE27117F0 for ; Sun, 1 Dec 2019 01:57:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 71CA12082E for ; Sun, 1 Dec 2019 01:57:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="toYOZA5C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71CA12082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 691066B0378; Sat, 30 Nov 2019 20:57:31 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6427C6B037A; Sat, 30 Nov 2019 20:57:31 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 558326B037B; Sat, 30 Nov 2019 20:57:31 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 3D9666B0378 for ; Sat, 30 Nov 2019 20:57:31 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id D9C52180AD817 for ; Sun, 1 Dec 2019 01:57:30 +0000 (UTC) X-FDA: 76214910660.24.order40_419287a2d5607 X-Spam-Summary: 2,0,0,5134204738c710ef,d41d8cd98f00b204,akpm@linux-foundation.org,:akpm@linux-foundation.org:dan.j.williams@intel.com:dave.hansen@linux.intel.com:fengguang.wu@intel.com::mgorman@suse.de:mhocko@suse.com:mingo@kernel.org:mm-commits@vger.kernel.org:peterz@infradead.org:riel@redhat.com:torvalds@linux-foundation.org:ying.huang@intel.com,RULES_HIT:41:355:379:800:960:966:967:973:988:989:1260:1263:1345:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:2196:2199:2393:2525:2553:2559:2563:2682:2685:2859:2897:2898:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4385:4605:5007:6119:6261:6653:6737:7576:8599:8603:8660:9025:9121:9545:10004:10913:11026:11233:11658:11914:12043:12048:12114:12294:12295:12296:12297:12438:12517:12519:12555:12679:12783:12986:13148:13161:13229:13230:13846:14181:14721:14849:21063:21080:21451:21524:21627:21939:30034:30054: 30064:30 X-HE-Tag: order40_419287a2d5607 X-Filterd-Recvd-Size: 3914 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:57:30 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67B47205ED; Sun, 1 Dec 2019 01:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165449; bh=idAMszw1QipJjTueGsRHrgbfWvc2GZFiUMdabpZkV14=; h=Date:From:To:Subject:From; b=toYOZA5ChrYPH/VbUIDTOQ0h/flPrgj7eCGFDaRbHe1vwguyopj+Ye/YsXcemNj7m UwxBeGrD5qyTYzfd7pwqXJtOmmKG53QpBby5Nk+uYEwI6IB8xsNjT2MVuFntmN21xz IeN0EH/lJ3sWGONR/zdwlQp3N0I0j9m0u2hlQN7o= Date: Sat, 30 Nov 2019 17:57:28 -0800 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, dan.j.williams@intel.com, dave.hansen@linux.intel.com, fengguang.wu@intel.com, linux-mm@kvack.org, mgorman@suse.de, mhocko@suse.com, mingo@kernel.org, mm-commits@vger.kernel.org, peterz@infradead.org, riel@redhat.com, torvalds@linux-foundation.org, ying.huang@intel.com Subject: [patch 139/158] autonuma: fix watermark checking in migrate_balanced_pgdat() Message-ID: <20191201015728.Z9V4wI2df%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 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: From: Huang Ying Subject: autonuma: fix watermark checking in migrate_balanced_pgdat() When zone_watermark_ok() is called in migrate_balanced_pgdat() to check migration target node, the parameter classzone_idx (for requested zone) is specified as 0 (ZONE_DMA). But when allocating memory for autonuma in alloc_misplaced_dst_page(), the requested zone from GFP flags is ZONE_MOVABLE. That is, the requested zone is different. The size of lowmem_reserve for the different requested zone is different. And this may cause some issues. For example, in the zoneinfo of a test machine as below, Node 0, zone DMA32 pages free 61592 min 29 low 454 high 879 spanned 1044480 present 442306 managed 425921 protection: (0, 0, 62457, 62457, 62457) The free page number of ZONE_DMA32 is greater than "high watermark + lowmem_reserve[ZONE_DMA]", but less than "high watermark + lowmem_reserve[ZONE_MOVABLE]". And because __alloc_pages_node() in alloc_misplaced_dst_page() requests ZONE_MOVABLE, the zone_watermark_ok() on ZONE_DMA32 in migrate_balanced_pgdat() may always return true. So, autonuma may not stop even when memory pressure in node 0 is heavy. To fix the issue, ZONE_MOVABLE is used as parameter to call zone_watermark_ok() in migrate_balanced_pgdat(). This makes it same as requested zone in alloc_misplaced_dst_page(). So that migrate_balanced_pgdat() returns false when memory pressure is heavy. Link: http://lkml.kernel.org/r/20191101075727.26683-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman Cc: Michal Hocko Cc: Rik van Riel Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Dave Hansen Cc: Dan Williams Cc: Fengguang Wu Signed-off-by: Andrew Morton --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/migrate.c~autonuma-fix-watermark-checking-in-migrate_balanced_pgdat +++ a/mm/migrate.c @@ -1859,7 +1859,7 @@ static bool migrate_balanced_pgdat(struc if (!zone_watermark_ok(zone, 0, high_wmark_pages(zone) + nr_migrate_pages, - 0, 0)) + ZONE_MOVABLE, 0)) continue; return true; }