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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2AD8AC433E0 for ; Thu, 28 Jan 2021 13:06:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9614B64D9D for ; Thu, 28 Jan 2021 13:06:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9614B64D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B20A56B0072; Thu, 28 Jan 2021 08:06:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACFFD6B0073; Thu, 28 Jan 2021 08:06:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E6986B0074; Thu, 28 Jan 2021 08:06:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 88FC36B0072 for ; Thu, 28 Jan 2021 08:06:46 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4F539180AD83B for ; Thu, 28 Jan 2021 13:06:46 +0000 (UTC) X-FDA: 77755208412.08.unit60_260f0cd2759f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 2C0021819E624 for ; Thu, 28 Jan 2021 13:06:46 +0000 (UTC) X-HE-Tag: unit60_260f0cd2759f X-Filterd-Recvd-Size: 6701 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 13:06:45 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id d81so5476004iof.3 for ; Thu, 28 Jan 2021 05:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R5AmyTAxwdCn14G+u2C+YUTCaRy+e3KtKL++CDObPQY=; b=bIInvfI2erl556NcqE26CdvyZS1i0f2lZ4YQ+vrDzBAtJlAQjb0mG73aJqxbAUxrLd twuAXu/a9Tv9a+6hbn1q/eaFYy1yeP2NIRUIcTE+d6Qn+tI9BZn6mmaap9JjDlwCtOWs OCjBhsE7i6beC1aa4nskk1axlHfZPL0NDRFFh6FLshW7htvzO/eveACfWJ50IXjFwpkj C2Gz9CFEMxtk8ZOAIr3jtvIc78zT1CriL5AKz0n5956A2Pghzhd3vsrfGaC/HrBO+W7v dAIDB87NdgeMjoJImIRzQwwLT4TFIBvX+r7hmbKJQs35YcaF6D/ENo1tRokfBB9IduT9 4Szw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R5AmyTAxwdCn14G+u2C+YUTCaRy+e3KtKL++CDObPQY=; b=LiuuYAXIlXNT+tDBqONJDAdKb8VRodeAuShDBA2oHy372A40c7eHMVRrJOekpUVd7Y Xh9ULzgIR4M/zMhNk4zJDRATm9zHr5XridLrYHohi63hxEKrhafFNZ5zUQMc/mDyzFbW zwK2zqSLTM/Yb4HJ3dWu/er98O0wiWP+oSazqTkQ4PkygrZ0qos5mBSZukclqbHaO76u WTRvjjWcAq0ZoVf7BpsMRaRHJJZzhZ5SNCxjcLbhPR8pfKylrikvzP5RSJVZOjcVu5sE lU8RtbtfN6wxMo6nh5YJOfoRK2BYzUMOT48EohK4VDCHdwDLVwjAG3dwucrnZowgeQOo HNEQ== X-Gm-Message-State: AOAM532fP1gMvzgEeiEWdRdkqI+hYsaSofU3qWKzgP7tcvg8VfKMk5KG d4/jJ0Wa+LLmxUy9zBf1HEsOur0h9H23FDQIxVY= X-Google-Smtp-Source: ABdhPJyNsoTx7kPhpc8DTZ+IGBwljtCc0WwblZh+zMI0ljNcvyzmIay/MEoZEU+D874v7s0hm9z1lQ7urL5rDUOhk1M= X-Received: by 2002:a05:6602:224b:: with SMTP id o11mr11251520ioo.10.1611839205042; Thu, 28 Jan 2021 05:06:45 -0800 (PST) MIME-Version: 1.0 References: <20210128021947.22877-1-laoar.shao@gmail.com> <20210128021947.22877-3-laoar.shao@gmail.com> <0b2f4419-06a9-0b6c-067b-8d0848e78c33@suse.cz> In-Reply-To: <0b2f4419-06a9-0b6c-067b-8d0848e78c33@suse.cz> From: Yafang Shao Date: Thu, 28 Jan 2021 21:06:09 +0800 Message-ID: Subject: Re: [PATCH 2/3] mm, slub: don't combine pr_err with INFO To: Vlastimil Babka Cc: David Hildenbrand , Christoph Lameter , penberg@kernel.org, David Rientjes , iamjoonsoo.kim@lge.com, Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , andriy.shevchenko@linux.intel.com, Rasmus Villemoes , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" 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 Thu, Jan 28, 2021 at 6:35 PM Vlastimil Babka wrote: > > On 1/28/21 3:19 AM, Yafang Shao wrote: > > It is strange to combine "pr_err" with "INFO", so let's clean them up. > > This patch is motivated by David's comment[1]. > > > > - before the patch > > [ 8846.517809] INFO: Slab 0x00000000f42a2c60 objects=33 used=3 fp=0x0000000060d32ca8 flags=0x17ffffc0010200(slab|head) > > > > - after the patch > > [ 6312.639698] ERR: Slab 0x000000006d1133b9 objects=33 used=3 fp=0x000000006d0779d1 flags=0x17ffffc0010200(slab|head) > > > > [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a762@redhat.com/#t > > > > Cc: David Hildenbrand > > Signed-off-by: Yafang Shao > > These are usually printed as part of slab_bug() with its prominent banner. In > that sense it's additional details, thus INFO. The details itself are not error, > thus ERR makes little sense imho. How about removing the prefix completely, or > just replacing with an ident to make it visually part of the BUG report. > Thanks for the explanation. I will remove the prefix completely in the next version. > > --- > > mm/slub.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/mm/slub.c b/mm/slub.c > > index 4b9ab267afbc..18b4474c8fa2 100644 > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -615,7 +615,7 @@ static void print_track(const char *s, struct track *t, unsigned long pr_time) > > if (!t->addr) > > return; > > > > - pr_err("INFO: %s in %pS age=%lu cpu=%u pid=%d\n", > > + pr_err("ERR: %s in %pS age=%lu cpu=%u pid=%d\n", > > s, (void *)t->addr, pr_time - t->when, t->cpu, t->pid); > > #ifdef CONFIG_STACKTRACE > > { > > @@ -641,7 +641,7 @@ void print_tracking(struct kmem_cache *s, void *object) > > > > static void print_page_info(struct page *page) > > { > > - pr_err("INFO: Slab 0x%p objects=%u used=%u fp=0x%p flags=%#lx(%pGp)\n", > > + pr_err("ERR: Slab 0x%p objects=%u used=%u fp=0x%p flags=%#lx(%pGp)\n", > > page, page->objects, page->inuse, page->freelist, > > page->flags, &page->flags); > > > > @@ -698,7 +698,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) > > > > print_page_info(page); > > > > - pr_err("INFO: Object 0x%p @offset=%tu fp=0x%p\n\n", > > + pr_err("ERR: Object 0x%p @offset=%tu fp=0x%p\n\n", > > p, p - addr, get_freepointer(s, p)); > > > > if (s->flags & SLAB_RED_ZONE) > > @@ -791,7 +791,7 @@ static int check_bytes_and_report(struct kmem_cache *s, struct page *page, > > end--; > > > > slab_bug(s, "%s overwritten", what); > > - pr_err("INFO: 0x%p-0x%p @offset=%tu. First byte 0x%x instead of 0x%x\n", > > + pr_err("ERR: 0x%p-0x%p @offset=%tu. First byte 0x%x instead of 0x%x\n", > > fault, end - 1, fault - addr, > > fault[0], value); > > print_trailer(s, page, object); > > @@ -3855,7 +3855,7 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, > > for_each_object(p, s, addr, page->objects) { > > > > if (!test_bit(__obj_to_index(s, addr, p), map)) { > > - pr_err("INFO: Object 0x%p @offset=%tu\n", p, p - addr); > > + pr_err("ERR: Object 0x%p @offset=%tu\n", p, p - addr); > > print_tracking(s, p); > > } > > } > > > -- Thanks Yafang