Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5527886ybl; Tue, 14 Jan 2020 10:24:51 -0800 (PST) X-Google-Smtp-Source: APXvYqw3B+d8KBca1bAGhkz+Um/1r6CIQkV5ha+yoYqdW/HQaoMX/yXHbti1xdeA5pyMJtlGMlDu X-Received: by 2002:a9d:7f83:: with SMTP id t3mr16791642otp.115.1579026291892; Tue, 14 Jan 2020 10:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579026291; cv=none; d=google.com; s=arc-20160816; b=vToa7ep9KYnvFC5+N+nBN6rHTHvpmbmPgIY6Sn9icg4Mnt2KCXIUz1vMvBr1jYV4pN mfFtGxItbRK2QHvv7zmyim2QyoG171C9VmWfgBBkWVQT8HXytuMbXIcz0CRV2CMeqrE/ qBsPU2KCaXaPyK9hlTHY2sEWPvnqeKS+hB4OguRVsTds8EumtT32QgzHmljzWxudqE5O ldS5Zas/D8KVvRSo8bVYLjyLEG6fAvdmRa0Q6VPDOf0Fx2oUAejRXL5VZksBGDYGj5gh mw4jOdrGm4lhz5XG2s27RqQbDZPRFzE6CWThEYvCPdnDAnMRf+kSs1E5jqzVeQi5Uvix RC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=AZqymOqr9EyUGtO2Cg1HbIfDXScrw+fAop2z07tend0=; b=K90uAqegJw6X9KRyQM88L5h8//1P8DLZDSDYJlWi4HJ9RMdteq/VPmZu/GVjUv2hpp CXHSaqpnHm+5NsNCVst/vTMJMgq2HhYA/x+kvHDVds7Mwg8EcKIosK8KkQZjXcUHFWC6 3uaVNbMbQNrOVv21OVUOIS5jR1WjAL2wABoqxxp3ZwfQVKy7tuqYtYughK5fA0+DiW4j 0wA6J2X/xp+I+HFo2JoN/q89DD5NBbVwE7OA+JbWPiZTuRRoF/mfdo4Av7Wu/CGMs3+5 EbnPJ3DPpUeaQ5IIa2V2dUYTwzEmrADcG1YYP90sMhkEVA2ibEDvGFqx0ZwrRLEhZjLd Q5aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=HV4Ss7qA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q28si7596665oij.149.2020.01.14.10.24.39; Tue, 14 Jan 2020 10:24:51 -0800 (PST) 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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=HV4Ss7qA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728668AbgANSWu (ORCPT + 99 others); Tue, 14 Jan 2020 13:22:50 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:6052 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbgANSWt (ORCPT ); Tue, 14 Jan 2020 13:22:49 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 14 Jan 2020 10:22:28 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 14 Jan 2020 10:22:48 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 14 Jan 2020 10:22:48 -0800 Received: from rcampbell-dev.nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 14 Jan 2020 18:22:48 +0000 Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() To: Michal Hocko , Vlastimil Babka CC: Anshuman Khandual , David Hildenbrand , Qian Cai , , Andrew Morton , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , References: <49fa7dea-00ac-155f-e7b7-eeca206556b5@arm.com> <6A58E80B-7A5F-4CAD-ACF1-89BCCBE4D3B1@lca.pw> <20200114091013.GD19428@dhcp22.suse.cz> <1f3ff7fc-2f6b-d8e5-85a5-078f0e1a0daf@suse.cz> <20200114113230.GM19428@dhcp22.suse.cz> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <958fa7cd-0e88-3387-d4bf-e8bfcfdb256b@nvidia.com> Date: Tue, 14 Jan 2020 10:22:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20200114113230.GM19428@dhcp22.suse.cz> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1579026148; bh=AZqymOqr9EyUGtO2Cg1HbIfDXScrw+fAop2z07tend0=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=HV4Ss7qAUWmz8CskpNaubXEos1oKIpA0V4O/+wwsexFWDkalTnlcHm3kauygHymrb BJlzzzwjc5yflpWlHvlkHMxCNomUcX63rEni6aOeGVqDkZf/7vxT9QQ6T1DSWzgd5d rruiNfdxBmH8y45lbE0lWOSaOZQ5TcuGhrafzzhySpU56jjPuzHX1TymPqoCN524zd ROWn9lc03dLL6fkYiPlF9Ajs7UacHzEH3OfJGEyzY585zZK5VmGuJkHMxnr7HBiP1y FPyb17pugR97pum5qLHhwoBd08ALeS5ywwknomS0vv/quXnLRwPMvG1Wa56EU2ke9O ZVayeAg3wzBwg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/14/20 3:32 AM, Michal Hocko wrote: > On Tue 14-01-20 11:23:52, Vlastimil Babka wrote: >> On 1/14/20 10:10 AM, Michal Hocko wrote: >>> [Cc Ralph] >>>> The reason is dump_page() does not print page->flags universally >>>> and only does so for KSM, Anon and File pages while excluding >>>> reserved pages at boot. Wondering should not we make printing >>>> page->flags universal ? >>> >>> We used to do that and this caught me as a surprise when looking again. >>> This is a result of 76a1850e4572 ("mm/debug.c: __dump_page() prints an >>> extra line") which is a cleanup patch and I suspect this result was not >>> anticipated. >>> >>> The following will do the trick but I cannot really say I like the code >>> duplication. pr_cont in this case sounds like a much cleaner solution to >>> me. >> >> How about this then? > > Yes makes sense as well. > >> diff --git mm/debug.c mm/debug.c >> index 0461df1207cb..6a52316af839 100644 >> --- mm/debug.c >> +++ mm/debug.c >> @@ -47,6 +47,7 @@ void __dump_page(struct page *page, const char *reason) >> struct address_space *mapping; >> bool page_poisoned = PagePoisoned(page); >> int mapcount; >> + char *type = ""; >> >> /* >> * If struct page is poisoned don't access Page*() functions as that >> @@ -78,9 +79,9 @@ void __dump_page(struct page *page, const char *reason) >> page, page_ref_count(page), mapcount, >> page->mapping, page_to_pgoff(page)); >> if (PageKsm(page)) >> - pr_warn("ksm flags: %#lx(%pGp)\n", page->flags, &page->flags); >> + type = "ksm "; >> else if (PageAnon(page)) >> - pr_warn("anon flags: %#lx(%pGp)\n", page->flags, &page->flags); >> + type = "anon "; >> else if (mapping) { >> if (mapping->host && mapping->host->i_dentry.first) { >> struct dentry *dentry; >> @@ -88,10 +89,11 @@ void __dump_page(struct page *page, const char *reason) >> pr_warn("%ps name:\"%pd\"\n", mapping->a_ops, dentry); >> } else >> pr_warn("%ps\n", mapping->a_ops); >> - pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags); >> } >> BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); >> >> + pr_warn("%sflags: %#lx(%pGp)\n", type, page->flags, &page->flags); >> + >> hex_only: >> print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32, >> sizeof(unsigned long), page, >> > Looks good to me. Thanks for the clean up. Reviewed-by: Ralph Campbell