Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6832144ybx; Mon, 11 Nov 2019 15:44:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzZJiBeqX2MUPfa5O7zu3gwJIx+izHiIiZafua0j9ZAXm0ITHuqcwhh9re2eYwBKnS2vCqS X-Received: by 2002:a17:906:c44f:: with SMTP id ck15mr25306801ejb.7.1573515884490; Mon, 11 Nov 2019 15:44:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573515884; cv=none; d=google.com; s=arc-20160816; b=XRBm69pVpBXVBToL1gNyD9kTa/4BpPyzYj1ZykW8UomPydaIHictH1RPAxlqB5qn2p pQ1yXN7jZT/07oQMBohmAaQiJpPk1mk4IU2hhVL/veTC+KA9deOdPClphCLORW8jXbsO /5149pX0WV9IOOyKkN6cAw+8x5IA+8ePtGPzQJ2pv9xVzD3HpX8AgHlnXaMhn3MiWQdu KRmL7SpziIlCB0LmzQl6yUabURirsI7rxWw9KJqKhLQwhaLkaqf/+WeoF7LliTtFkh6d Gf/BJUJgJ1ml3OwexRCE7S7/q5iYmFBk0GCA+2UEzNWnvGTqUTOI8WB1o+Idw6tfrcvt y5Bg== 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=AP5bb6JXF94EJBOxdtfuDPxdSO+VKT8Ph17UVgTs2Cs=; b=dtKw+vMtbVyHyQuoMUgd/JTorucpNq4bV5QQphDFP8MvgzMU7GK173CILhhjXcloJz e95nwuJyggLQl0jebytH+/8AK2+r82p7vACpN9oP0xyr6l5nwhvzc/7a4vyBL0gVmb6U /gAxKcdpKKTKhwjzzFqkj6YhkzDE5cOHeNKAi3IfnAxwpWlSjmlSwzZgnqU3/erMwilw p6UFkGMA5l4CklzFRxdTM5uQ3IAD4EYbugzfYbU5Ppxd404iObZK6T/VptbWJprgScTn t0YHlgdbTCRh1scrdP2XdrrFv1bHjhrXz9JaTePTHJIKfuSi4B+uboi1kv4jOpvs0LGl 05sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=pMSPpt+g; 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 d26si9962796ejr.361.2019.11.11.15.44.19; Mon, 11 Nov 2019 15:44:44 -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=pMSPpt+g; 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 S1727126AbfKKXli (ORCPT + 99 others); Mon, 11 Nov 2019 18:41:38 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:15477 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbfKKXli (ORCPT ); Mon, 11 Nov 2019 18:41:38 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 11 Nov 2019 15:40:35 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 11 Nov 2019 15:41:37 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 11 Nov 2019 15:41:37 -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; Mon, 11 Nov 2019 23:41:37 +0000 Subject: Re: [PATCH] mm/debug: To: Andrew Morton CC: , References: <20191111224935.19464-1-rcampbell@nvidia.com> <20191111150211.9f75292d8c057769603edfb7@linux-foundation.org> From: Ralph Campbell X-Nvconfidentiality: public Message-ID: Date: Mon, 11 Nov 2019 15:41:37 -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: <20191111150211.9f75292d8c057769603edfb7@linux-foundation.org> 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=1573515636; bh=AP5bb6JXF94EJBOxdtfuDPxdSO+VKT8Ph17UVgTs2Cs=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=pMSPpt+ggPWMSr6gAynKK6fEgc1rRRnvopLh81yexMSlWwmGyxPDAyg9ZTvhVLK67 m06KzZx/Yzplyw6ya3WdMIXf25XPmiwwQGW4c+PVuuZa3kpeV9KBcbG2UMqQbPeS6q mZFGT3JRzG3dMcNdMnGCoekY9t1mudlgrUi+oiSiamhyKS7NJ+tXrbjgnpr5AXLGyt w8uRHKDHLJwE0YC4Ej8GoUG7d5r7wpYsXbsIQDM49DV55PKAQhO5d0ry1uBKtfrT9u POYfX5n+G7hz2htD+7MFQLyeQbHfORkDypR9206yge3Da+keHc6pKLRpj1w/jOx8TH 7cEDFN2CF70hQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/11/19 3:02 PM, Andrew Morton wrote: > On Mon, 11 Nov 2019 14:49:35 -0800 Ralph Campbell wrote: > >> When dumping struct page information, __dump_page() prints the page type >> with a trailing blank followed by the page flags on a separate line: >> >> anon >> flags: 0x100000000090034(uptodate|lru|active|head|swapbacked) >> >> Fix this by using pr_cont() instead of pr_warn() to get a single line: >> >> anon flags: 0x100000000090034(uptodate|lru|active|head|swapbacked) >> >> Signed-off-by: Ralph Campbell >> --- >> mm/debug.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/debug.c b/mm/debug.c >> index 8345bb6e4769..752c78721ea0 100644 >> --- a/mm/debug.c >> +++ b/mm/debug.c >> @@ -87,7 +87,7 @@ void __dump_page(struct page *page, const char *reason) >> } >> BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); >> >> - pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags); >> + pr_cont("flags: %#lx(%pGp)\n", page->flags, &page->flags); >> >> hex_only: >> print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32, > > This is the case if PageAnon || PageKsm || mapping. If it is, say, > PageSlab then we effectively do > > pr_warn("stuff-with-no-newline"); > pr_cont("\n"); > pr_cont("flags: ...\n"); > > does this work OK? what facility level will that "flags: " line get? I don't see a "\n" in the "mapping" case but the if (mapping->host && mapping->host->i_dentry.first) pr_warn("name:\"%pd\" ", dentry) would end up on a new line. Ugh. I guess the dentry name could be fairly long. I guess I will just convert to using "\n". AFAIK, there is no locking between pr_warn() and pr_cont() so the latter could get appended to any facility level. But that isn't a problem I plan to fix.