Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5102426ybl; Tue, 14 Jan 2020 03:34:08 -0800 (PST) X-Google-Smtp-Source: APXvYqydg2vMY/LfMUDYvu3E1wtyJzdg9ybZPPVfb2LOC8zVzWIt/5gsX9zICxe+yYv9yaEMYa5J X-Received: by 2002:aca:568f:: with SMTP id k137mr16747730oib.63.1579001648228; Tue, 14 Jan 2020 03:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579001648; cv=none; d=google.com; s=arc-20160816; b=uG9GsQXgvLMV7nTIQY7ce9f+pa+W+BgJUDwIBJf9CbWLka+nSNv6AhBO1Ev0GoY0Zn LcejcQztOB3EUQ2Al953KnrSbDWiRK/lH1ibMQalI4gIctcnExk25ARQlb1NArBJ+Gqz 1SAi9VeaqhMAdYz3qHKPw5+LCnTfee0y325HMqytjfI9KclGveAeBKsxeJcOL9dzK6EF +VlRDVIJ/5WitEhkRXKb2apFdxi2i6NyjlHF+5G8b0mJuRUYMxp5BFEWzIka7zELairP YrrxpqzEzG4ctBndRj1KnD0AyEtdQ0c/aLVEMBXZsv6Xl+PTjeVXmACtES+TG80/HI+h R3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pNR3NFApkzwBRWUY1yWsS3r7ps19YeFIKgoV6SnxNc8=; b=wKFX+0e5Y1AMq/ac7U5HdPqK3hz/Ohp8ZM97rXBu1MykhMA8LyevsT+vQ9FAYboV/4 23Q55wp0XFQS63NmCP1AGDsBy3uV1xwEUOANISjmz7y5wU6kD56ZVN4PzDvQlUP9kkOz 9coicgVHXghS8DUiDflnqT0bTIVFTOrf2VJK1OSfHws/lZCXXIXKbgOaD3SFk0sh2jQ3 EnsIhAT1RYMlGK6jRbQZIsVe2WVpAmg00t1/kasaPnhJmCwtx8JXW03FWDssFXlPq/gn mEo8a9Bn2uwoT+M3CRiz6G+ln8f6QIXbC2F1896oXYCl6tk2/9Zg1aP0at+Z7vBJqcqL BE0g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i25si7236721oii.259.2020.01.14.03.33.57; Tue, 14 Jan 2020 03:34:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729534AbgANLce (ORCPT + 99 others); Tue, 14 Jan 2020 06:32:34 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37127 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgANLce (ORCPT ); Tue, 14 Jan 2020 06:32:34 -0500 Received: by mail-wm1-f65.google.com with SMTP id f129so13301060wmf.2 for ; Tue, 14 Jan 2020 03:32:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pNR3NFApkzwBRWUY1yWsS3r7ps19YeFIKgoV6SnxNc8=; b=HtGrddSQCNZl+i8pJWmLQ2naEFW7CFQ8saRw6earkn7JYDbbk0iB3OvyC+d6LV5dHv 93Xac5L/2n8D6Q/FWIho+/09mYYXI1c+x2VzinGHTJC+w9CMoaiyRqb0bmler2LNwj4n hots9gdK0SvTqMYh0pf+8SlDgQWH7TWMHHFKHYe6F01SX3zlpm9yoQ0Zk5uu9MZGtyTk SK7rk7vaJB/RQtZYLz0MHwtXJJxeeNfgJLxLUQD3CTCtsPtCFj4ms/c6zU66VsE78U7s VAJ13BTpZ59Fa6bA2t3Mnq2D5hyskPVDMg97lDY+4cTj4kdtqLk2zTy2I9TO2LuNT0d8 oIQw== X-Gm-Message-State: APjAAAXMBsDlnEDVyMhESAu83TbF6st4C1pJh1apfqm64mo2l8Ngh9DO Mv5a/xx65PCz2KYTqRovF8K4ucIY X-Received: by 2002:a7b:c936:: with SMTP id h22mr25570568wml.115.1579001552048; Tue, 14 Jan 2020 03:32:32 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id i11sm19629688wrs.10.2020.01.14.03.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 03:32:30 -0800 (PST) Date: Tue, 14 Jan 2020 12:32:30 +0100 From: Michal Hocko To: Vlastimil Babka Cc: Anshuman Khandual , David Hildenbrand , Qian Cai , linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org, Ralph Campbell Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() Message-ID: <20200114113230.GM19428@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f3ff7fc-2f6b-d8e5-85a5-078f0e1a0daf@suse.cz> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, > -- Michal Hocko SUSE Labs