Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp377920pxf; Wed, 10 Mar 2021 08:07:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxngF6P9jzxezOTrAlFe+XzxViTPGs9J9kAlOPqVqqCliosTvKCiYqlks/bN5UBVJqxcD/m X-Received: by 2002:a17:907:1693:: with SMTP id hc19mr4454238ejc.28.1615392457911; Wed, 10 Mar 2021 08:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615392457; cv=none; d=google.com; s=arc-20160816; b=VU6EAq5r4l6z/VV2q1qv08dn6EN3UthjnV2/oCl+Bj2dnfJVTG9JGihbLogJFNOkgI ajWTCmEuXcuGorxjtGxhaYXGxGSP++B9hKjvi6CysthHHA+/o+uoXjawWlwjBZKoLf9H pfxN4Tob3SpCSZF2rpev4yTaoc0+qSPqFebyqGr31Se0AzvtHYV1M54cYg0CFiG2v3CS hK/IX3FYzZyTrAFx0R5TOo/DNMyMQaQXcpNviJmm4TS/dXd3XsnqAq8xfYnTiQPdvmk5 uE0dqAnKLZO3xB3G3XjCRo+jF0fFcNrZF+ZfqRYqiA4e/Fxb3fHNYjav3fXHjXc1RZKr jSjg== 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=/IlSQt+JdroGzkdRffXyJXxruj/9j7m6kLbpUsf+B50=; b=quKOYEtyH+yQ30RSQ0j0f0F8EOCu3mWUFoawz0ANDtKD3YLdGrMKDjAWPdzHZvG6+o gtxws3oCj1TtWBWlp2e7g8D4BcN96gUYdaFZAoWjOLmOseFHfokBAMC9MJEhq54mqvRV +f9R2prg8FXyP9GQyDYOIb6x2LMtqoePeoayZTF+hfThaz7RCsN6FVl1y5EUp2X3aVhT 3y1DgnOpHxgMo39NZyk+Sr6BNAm/q0z4rKwFwIByI2Af17a6CAaqHpYAzfGb8oHxata0 ePeF4tPKmE56WL5nRNnnyheq/y2QPMzzddXCS3pSybBRKf/XBcvAsmrhy0YdXautyHVU cR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DfSVPLK4; 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 i10si12019056ejd.325.2021.03.10.08.07.07; Wed, 10 Mar 2021 08:07:37 -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=DfSVPLK4; 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 S233185AbhCJQGM (ORCPT + 99 others); Wed, 10 Mar 2021 11:06:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbhCJQFj (ORCPT ); Wed, 10 Mar 2021 11:05:39 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2719C061760 for ; Wed, 10 Mar 2021 08:05:39 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id p21so11687599pgl.12 for ; Wed, 10 Mar 2021 08:05:39 -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=/IlSQt+JdroGzkdRffXyJXxruj/9j7m6kLbpUsf+B50=; b=DfSVPLK4FHvcXwn0XEJYawc7Fg1vG89qRrbkyKld2NJiUMZ3YmqiPlM8VqDnB9tzTy teSe23q3yqMnsFQ4tWo1bNAtiViMRyNQPqc+NifHhX/RLXGnU4AcvhghaGvGu397wT7w kAaV74/8MaugvamoYbMZK/f4edWPhuVGJsmUN9MWaUSD9hGzhmeIYfyZ2FBxXUzJKyN5 jBTTARCxmk5QzaF/qwgGtUqvODd6YwLYsNVHxerGg7yNxOBlR1rhLwhG66Bo1wZXHIGW RLZNEwJEkbXk1b4RTn3j1RgPlG/Jst1WXgqDjWdck7cPAYPP34Bpu/s8QYDyvw+8HT2h 1mJA== 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=/IlSQt+JdroGzkdRffXyJXxruj/9j7m6kLbpUsf+B50=; b=gablzqFqnd6K7KKDDtIDznbFTvOi4tvo76mnGBb0+ORBEWbQB/XY59szJ3oRkbeg04 UQIGXx2kc0VlJQPW4o4tgmYHsRFw3Pmyu+Wm4IZzu7f6nNu1wbTXu+5qegQWsA9lJaZP pvvvVCpaRNpCIzBDJ1t8xqeNy29/Qeb65bB9kWnNbgXV39rKI2hjf6U+iOA1ZHm2O9pA fqgII2YrZZ2DXotOOuQUqFgLlusZVMj+wxqfr9ipqGsTz/Ymp1Bg3EufiyZMgdnRNX6+ Dvg67drpNsi6fG4k9ULSF10YvEuB3AFE9KvD92CXNVFNZTvY8jIterFZQoWLLpKvdkNT pdgg== X-Gm-Message-State: AOAM531/Ewrcskgg3TT9AOyZftyBMbJxwnFRa/ZJCs9i3rDF3n0DTEru YrRZtIBlm/hNKJBL5Wqk5ak= X-Received: by 2002:a63:f912:: with SMTP id h18mr3377253pgi.287.1615392339167; Wed, 10 Mar 2021 08:05:39 -0800 (PST) Received: from google.com ([2620:15c:211:201:64cb:74c7:f2c:e5e0]) by smtp.gmail.com with ESMTPSA id a21sm17205098pfk.83.2021.03.10.08.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 08:05:38 -0800 (PST) Sender: Minchan Kim Date: Wed, 10 Mar 2021 08:05:36 -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 Wed, Mar 10, 2021 at 02:07:05PM +0100, Michal Hocko wrote: > On Tue 09-03-21 23:42:46, Minchan Kim wrote: > > 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(-) > > The is a lot of churn indeed. Have you considered adding $FOO_lglvl > variants for those so that you can use them for your particular case > without affecting most of existing users? Something similar we have > discussed in other email thread regarding lru_add_drain_all? I thought that way but didn't try since it couldn't make them atomic(For example, other printk place in other context will affect by the $FOO_lglvl).