Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp122825ybn; Thu, 3 Oct 2019 02:34:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp9HhTZCtGnvCBGC5312PsAkWQBt9pi3NkA+HIWQeRe8q1/s2sxaah4Mfd5FHi+0E0lXR8 X-Received: by 2002:a50:fa9a:: with SMTP id w26mr8432770edr.227.1570095273364; Thu, 03 Oct 2019 02:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570095273; cv=none; d=google.com; s=arc-20160816; b=tE3Nxw/yQqThRMaElZJ4i52nMpOeeKoHDFsT9EWI0+eZcGtmcHgThiJIpkyHSntY4k /JW2JraP/UnXsbz6jlrRsJssWTUKdZatEgXxtwwIUcklGeHrNoMofmHBoK8RnvcXmE0R Dsz+eHo7EZ5jmuRWMxr9FokBPMJiyf7J7mOrPOpW6P1pp8H3uegyXIS1HKXVHb+cqWJo GHL4tA1GRMomcr6Am33IfEgDJYx9lLmP6gWocZI7eCbkL9fZcEI68tVCsTfUY/sGZvMS pP7J9C5sWylbS7zyxlLL1vWwcZ5HEMyk4hJMUjqzTn8P6PV+hcv4586yDsNcdjkyXlT1 4fug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=oQYTO26uW2iakovFBfk2ug6swY6qHZ5L4JhRq71wtKs=; b=cAM054hwvvuhYNz2V7hBF4J6P1DB+6BGHTEVjhYWAbWEMnpoEvjGfWbfL/3b+gF9AX potztBzgKm6AuSF+ph9w1K0oqh8G2f4FDqJ5cK4KP2RHk+m5ZOj2i8ey8xhflnseiSBv BKTehO7tO9hHfrrh0c2CPr27UqNcaNvmWThAFYfOSOB4+aXu2z0n5t0J4BYzJWsRq9Hr 8QENam31pBHvvv72uJHi/EitLH+aIMWYLKAC5ZAsrDalk5IWnyFDajHyMjIHiFIHGwYe FnqN27jGi7wfgA+jsDtlfcOcNOtcMsGbjYOIDKv5hx1AazvufNF/UAPXQCIQKG4BSzAq wPVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si900092ejr.125.2019.10.03.02.34.08; Thu, 03 Oct 2019 02:34:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729041AbfJCJcH (ORCPT + 99 others); Thu, 3 Oct 2019 05:32:07 -0400 Received: from foss.arm.com ([217.140.110.172]:39438 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728743AbfJCJcH (ORCPT ); Thu, 3 Oct 2019 05:32:07 -0400 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 ABCC21000; Thu, 3 Oct 2019 02:32:06 -0700 (PDT) Received: from [10.162.40.180] (p8cg001049571a15.blr.arm.com [10.162.40.180]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B7F433F739; Thu, 3 Oct 2019 02:32:03 -0700 (PDT) Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() To: Qian Cai Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Vlastimil Babka , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org References: <1570090257-25001-1-git-send-email-anshuman.khandual@arm.com> <7FA7CBE1-E0A9-40E2-B3CA-0896F6D491E5@lca.pw> From: Anshuman Khandual Message-ID: <37b43978-5652-576c-8990-451e751b7c67@arm.com> Date: Thu, 3 Oct 2019 15:02:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <7FA7CBE1-E0A9-40E2-B3CA-0896F6D491E5@lca.pw> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03/2019 02:35 PM, Qian Cai wrote: > > >> On Oct 3, 2019, at 4:10 AM, Anshuman Khandual wrote: >> >> 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". > > Isn’t this redundant as it dumps the flags in dump_page() anyway? Even though page flags does contain reserved bit information, the problem is that we are explicitly printing the reason for this page dump. In this case it is caused by the fact that it is a reserved page. page dumped because: The proposed change makes it explicit that the dump is caused because a non movable page with reserved bit set. It also helps in differentiating between reserved bit condition and the last one "if (found > count)". > >> >> 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 >> --- >> 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 >> -- >> 2.20.1 >> >