Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp57235pxf; Tue, 9 Mar 2021 23:44:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHrdkTX+Pg3Nz3p+V9t0bDUMjtuwC/58c5FHsWhg6TxKHorTYBp3LXt4C63CHUbwDQjEzW X-Received: by 2002:a17:906:894:: with SMTP id n20mr2240531eje.57.1615362275048; Tue, 09 Mar 2021 23:44:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615362275; cv=none; d=google.com; s=arc-20160816; b=u0v04yYNJOa+mVPg5LARMMHuQMj+WHKQ47RvQs8OLdwOW1bRN3tegWv3EFSdGPJl+g rGnhnWST+/vfv31UfevQo3bXwQrmeNv8q07U8ZOYMU2BHNprplVXQuS3RKTy6xZpLkyA KkiYe5WamHc7S8jaBIHJGaBQH/sFP51KfPQt3Tu1ZG1tQJbl4jynhw/0Ur84m2qklw8T Ht78Y5P6sMpiaDh84Uk3nYhUyKfU2kNFyd0qcahBAcm4t6kMSRLr+tZlIIWcLOj91mGW FfXPhAE5/qu67MocUqEdAYMg1CyBBUcLuYve5WCeYszuyHqSIkBTA5v1xnttwm5UjUqH P8hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=PgzuC8/TNXUF5UZqdDTCIRg3y35yfyPd03qqWgWTsJ4=; b=wjJg7TZZKPgHMgVhzMdzqUMlEEyuRQR7LL8OVISqy71pPsqs52BAKcEOJxdQEQFNyL XTaJaTFnIsmEcT/dAPQ9ewa/n2wouQ8dxB76Mttvv8wD9mitrd7cll8vQW1KnIT1AAzP Phjxa7enLUQp9R8NiQiGVab3eRZDDWpuUQGzuwCUMWuGXlZUR3UsCLgy+/CmY/rOnf13 xEAPeuBb9OyVcv6b2DmFzhphRXHr4hw8AUcqo+pS1a0va+vm+6t5zNQmZ2qmh+8rNC6b ouNs3AUswT6DEDQJys/tal1RFKbO9L/IB6eZlaDbDEEP4fLYpNe6UUmQlLJvusmRW8tj DR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B3az+5aK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp24si11139326ejb.512.2021.03.09.23.44.12; Tue, 09 Mar 2021 23:44:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B3az+5aK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232176AbhCJHnL (ORCPT + 99 others); Wed, 10 Mar 2021 02:43:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbhCJHnA (ORCPT ); Wed, 10 Mar 2021 02:43:00 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61EC5C061760 for ; Tue, 9 Mar 2021 23:42:49 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id a188so11492587pfb.4 for ; Tue, 09 Mar 2021 23:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PgzuC8/TNXUF5UZqdDTCIRg3y35yfyPd03qqWgWTsJ4=; b=B3az+5aKkQv8oKsx41T73ASQ/XRUUv/PD8x3u6627vmTMF9pgVDTDNCtihfrqX8GLp 9UZ8xWnW4M47fsyZG3HbPOJ35IpAlSQjREOb+IzE4MglvzO2ACMgQ+YbramzEmSYSkBk OOi2OvLF2EMt8uDnol4CyLe3JZ/xACiZTcegeOB5kEFVg11hXo3J51dBjGtkHO4ngZxD zkoY1mSLbkhW3mDa7u9VnB4+a9HIdUhqzmZt/6VQL2T3EEu4ACY7k27cL14kEHosDWz6 hmJssGQnKr7A2XXYVr8O2l003iCimXuE9PKq0cZjCL8j3tZ7hlx8RsVQXEIv8OETPZc6 U16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=PgzuC8/TNXUF5UZqdDTCIRg3y35yfyPd03qqWgWTsJ4=; b=HyK1/UapRWma88nvCH7fufXIf26JVNiC4mVHCN8MXNu98Kbu/c+oGZlksTwx4SW4IC PoGaT0lnHFkZskXe0cKa81HFIHhUKlQ3lX7NWpOuAy4zD1cTvW74xnG0DcPbI+dRvNuB omB6WDw9cDjuLyV7TFYbvPJQCAWNAogB4zg9Kp+k4DM0m4G7pghlc240gQn6pyHG0ZDg HuWRnz66PhydX4Yc22+i+PBC2s3qZrld9oWjNL2IVu8JNWIeiVTo1rNqyemIp1bCgbwu igYcmrvZJ53gD/1EeRVmy9tU9WbbsJgivNJyjMF4KZxmQldZ6iTOrEGrtGdm4JakNxgn Kz/Q== X-Gm-Message-State: AOAM533zuIILN6FgkYz5DKTuMTqAnC6ade2eGvS0SCHCYKXWPAf3gBhy 8YF4dbIj1q4ki/zu8RJVNjo= X-Received: by 2002:a63:8f5d:: with SMTP id r29mr1657909pgn.353.1615362168930; Tue, 09 Mar 2021 23:42:48 -0800 (PST) Received: from google.com ([2620:15c:211:201:f896:d6be:86d4:a59b]) by smtp.gmail.com with ESMTPSA id r184sm15608540pfc.107.2021.03.09.23.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 23:42:48 -0800 (PST) Sender: Minchan Kim Date: Tue, 9 Mar 2021 23:42:46 -0800 From: Minchan Kim To: Michal Hocko Cc: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 09, 2021 at 08:15:41AM -0800, Minchan Kim wrote: < snip > > > [...] > > > +void dump_migrate_failure_pages(struct list_head *page_list) > > > +{ > > > + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, > > > + "migrate failure"); > > > + if (DYNAMIC_DEBUG_BRANCH(descriptor) && > > > + alloc_contig_ratelimit()) { > > > + struct page *page; > > > + > > > + WARN(1, "failed callstack"); > > > + list_for_each_entry(page, page_list, lru) > > > + dump_page(page, "migration failure"); > > > + } > > > > 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 > > Make sense. > > > page owner is using even pr_alert. > > Would it make sense to add a loglevel parameter both into __dump_page > > and dump_page_owner? > > Let me try it. I looked though them and made first draft to clean them up. It's bigger than my initial expectaion because there are many callsites to use dump_page and stack_trace_print inconsistent loglevel. Since it's not a specific problem for this work, I'd like to deal with it as separate patchset since I don't want to be stuck on here for my initial goal. FYI, Subject: [RFC 0/5] make dump_page aware of loglevel - Forked from [1] dump_page uses __dump_page and dump_page_owner internally to print various information. However, their printk loglevel are inconsistent in that __dump_page: KERN_WARNING __dump_page_owner: KERN_ALERT stack_trace_print: KERN_DEFAULT To make them consistent from dump_page, this patch introduces pr_loglevel in printk and make the utility functions aware of loglevel. Finally, last patch changes dump_page to support loglevel to make the printing level consistent. [1] https://lore.kernel.org/linux-mm/YEdAw6gnp9XxoWUQ@dhcp22.suse.cz/ Minchan Kim (5): mm: introduce pr_loglevel for __dump_[page]_owner stacktrace: stack_trace_print aware of loglevel mm: page_owner: dump_page_owner aware of loglevel mm: debug: __dump_page aware of loglevel mm: debug: dump_page aware of loglevel drivers/md/dm-bufio.c | 2 +- drivers/virtio/virtio_mem.c | 2 +- fs/btrfs/ref-verify.c | 2 +- fs/fuse/dev.c | 2 +- include/linux/mmdebug.h | 10 ++++++---- include/linux/page_owner.h | 8 ++++---- include/linux/printk.h | 12 +++++++++++ include/linux/stacktrace.h | 4 ++-- kernel/backtracetest.c | 2 +- kernel/dma/debug.c | 3 ++- kernel/kcsan/report.c | 7 ++++--- kernel/locking/lockdep.c | 3 ++- kernel/stacktrace.c | 5 +++-- mm/debug.c | 40 ++++++++++++++++++------------------- mm/filemap.c | 2 +- mm/gup_test.c | 4 ++-- mm/huge_memory.c | 4 ++-- mm/kasan/report.c | 4 ++-- mm/kfence/report.c | 3 ++- mm/kmemleak.c | 2 +- mm/memory.c | 2 +- mm/memory_hotplug.c | 4 ++-- mm/page_alloc.c | 4 ++-- mm/page_isolation.c | 2 +- mm/page_owner.c | 24 +++++++++++----------- 25 files changed, 88 insertions(+), 69 deletions(-)