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=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 5F6B9C32792 for ; Thu, 3 Oct 2019 09:32:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 30AAE218DE for ; Thu, 3 Oct 2019 09:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30AAE218DE 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 B88F36B0007; Thu, 3 Oct 2019 05:32:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B111E6B0008; Thu, 3 Oct 2019 05:32:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A26C96B000A; Thu, 3 Oct 2019 05:32:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id 7A7A06B0007 for ; Thu, 3 Oct 2019 05:32:08 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 2CD7D1525A for ; Thu, 3 Oct 2019 09:32:08 +0000 (UTC) X-FDA: 76001957136.25.cork53_1297de648670a X-HE-Tag: cork53_1297de648670a X-Filterd-Recvd-Size: 3769 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Oct 2019 09:32:07 +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 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: quoted-printable 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 10/03/2019 02:35 PM, Qian Cai wrote: >=20 >=20 >> On Oct 3, 2019, at 4:10 AM, Anshuman Khandual wrote: >> >> Having unmovable pages on a given pageblock should be reported correct= ly >> when required with REPORT_FAILURE flag. But there can be a scenario wh= ere a >> reserved page in the page block will get reported as a generic "unmova= ble" >> reason code. Instead this should be changed to a more appropriate reas= on >> code like "Reserved page". >=20 > Isn=E2=80=99t this redundant as it dumps the flags in dump_page() anywa= y? 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=20 between reserved bit condition and the last one "if (found > count)". >=20 >> >> 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, str= uct page *page, int count, >> >> page =3D pfn_to_page(check); >> >> - if (PageReserved(page)) >> + if (PageReserved(page)) { >> + reason =3D "Reserved page"; >> goto unmovable; >> + } >> >> /* >> * If the zone is movable and we have ruled out all reserved >> --=20 >> 2.20.1 >> >=20