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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 C5D9BC433DB for ; Wed, 10 Mar 2021 13:55:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4749D64F53 for ; Wed, 10 Mar 2021 13:55:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4749D64F53 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D898A8D01B0; Wed, 10 Mar 2021 08:55:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D604C8D01A6; Wed, 10 Mar 2021 08:55:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDA0B8D01B0; Wed, 10 Mar 2021 08:55:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id A36088D01A6 for ; Wed, 10 Mar 2021 08:55:00 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6321D181AF5EA for ; Wed, 10 Mar 2021 13:55:00 +0000 (UTC) X-FDA: 77904110760.30.DCF462D Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP id A5291C0007CF for ; Wed, 10 Mar 2021 13:54:57 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1615384498; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ynb5w72NY+rJnL7ZUNtb0DAziwv6ypIpu01j5U3oDF0=; b=dtf9xoa8uw+8wPnmhFPI4ktZchNiqWASPNhgFUR1Ci6SA0fkRACyCFyk6Ct5InbOsphh6n Umh4jvgMUcVOyU9qJTE1HxlERdH1YllpJEmJ+NVGVgq0T0QMZSRIhOMbn3l0jL/KqhgDsk n2yeETOVKtHmQyZnOreOVwE5pMiZ9k4= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 69530AEE5; Wed, 10 Mar 2021 13:54:58 +0000 (UTC) Date: Wed, 10 Mar 2021 14:54:57 +0100 From: Michal Hocko To: Matthew Wilcox Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , John Dias , David Hildenbrand , Jason Baron Subject: Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages Message-ID: References: <20210308202047.1903802-1-minchan@kernel.org> <20210310132623.GO3479805@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210310132623.GO3479805@casper.infradead.org> X-Stat-Signature: azr7on3bmtz9xujd7fkf61sy859k38c9 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A5291C0007CF Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615384497-257515 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 Wed 10-03-21 13:26:23, Matthew Wilcox wrote: > On Tue, Mar 09, 2021 at 10:32:51AM +0100, Michal Hocko wrote: > > Apart from the above, do we have to warn for something that is a > > debugging aid? A similar concern wrt dump_page which uses pr_warn and > > page owner is using even pr_alert. > > Would it make sense to add a loglevel parameter both into __dump_page > > and dump_page_owner? > > No. What would make sense is turning __dump_page() inside-out. > Something like printk("%pP\n"); > > In lib/vsprintf.c, there's a big switch statement in the function > pointer() that handles printing things like IPv6 addresses, dentries, > and function symbols. > > Then we can do whatever we want around the new %pP, including choosing > the log level, adding additional information, choosing to dump the page > to a sysfs file, etc, etc. Hmm, __dump_page has grown quite some heavy lifting over time and I am not sure this is a good candidate to put into printk proper (e.g. is it safe/reasonable to call get_kernel_nofault from printk - aka arbitrary context)?. But you've got a point that such a printk format wouldn't need to be 1:1 with the existing __dump_page. There is quite a lot to infer from page count, map count, flags, page type already. Then a question would be what is an actual advantage of %pP over dump_page_info(loglvl, p). One I can see is that %pP would allow to dump the state into a string and so it would be more versatile but I am not aware of a usecase for that (maybe tracing?). -- Michal Hocko SUSE Labs