From patchwork Thu Oct 3 08:10:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11172283 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 DBDD676 for ; Thu, 3 Oct 2019 08:10:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1D8221A4C for ; Thu, 3 Oct 2019 08:10:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1D8221A4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DE6A86B0005; Thu, 3 Oct 2019 04:10:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D98576B0006; Thu, 3 Oct 2019 04:10:58 -0400 (EDT) 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 CADBE6B0007; Thu, 3 Oct 2019 04:10:58 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id A95196B0005 for ; Thu, 3 Oct 2019 04:10:58 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 4C2EB4FF7 for ; Thu, 3 Oct 2019 08:10:58 +0000 (UTC) X-FDA: 76001752596.24.trail79_254074f398a09 X-Spam-Summary: 2,0,0,2ba5ce06871e63e3,d41d8cd98f00b204,anshuman.khandual@arm.com,::anshuman.khandual@arm.com:akpm@linux-foundation.org:mhocko@suse.com:vbabka@suse.cz:osalvador@suse.de:mgorman@techsingularity.net:rppt@linux.ibm.com:dan.j.williams@intel.com:pavel.tatashin@microsoft.com:linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1345:1431:1437:1534:1541:1711:1730:1747:1777:1792:1963:1981:2194:2198:2199:2200:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3871:4321:5007:6261:7688:8634:8957:10004:11026:11658:11914:12043:12114:12296:12297:12555:12895:13069:13141:13230:13311:13357:14096:14181:14384:14394:14721:21080:21451:21627:30012:30054:30064:30070,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: trail79_254074f398a09 X-Filterd-Recvd-Size: 2618 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Oct 2019 08:10:55 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AA7EB28; Thu, 3 Oct 2019 01:10:54 -0700 (PDT) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.40.180]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 384443F739; Thu, 3 Oct 2019 01:10:50 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , Michal Hocko , Vlastimil Babka , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org Subject: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() Date: Thu, 3 Oct 2019 13:40:57 +0530 Message-Id: <1570090257-25001-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 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: Having unmovable pages on a given pageblock should be reported correctly when required with REPORT_FAILURE flag. But there can be a scenario where a reserved page in the page block will get reported as a generic "unmovable" reason code. Instead this should be changed to a more appropriate reason code like "Reserved page". Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Pavel Tatashin Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Ralph Campbell --- mm/page_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 15c2050c629b..fbf93ea119d2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8206,8 +8206,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, page = pfn_to_page(check); - if (PageReserved(page)) + if (PageReserved(page)) { + reason = "Reserved page"; goto unmovable; + } /* * If the zone is movable and we have ruled out all reserved