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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS 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 A61C3C433E0 for ; Tue, 9 Mar 2021 02:23:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 11C40652B2 for ; Tue, 9 Mar 2021 02:23:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11C40652B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 80D778D00A8; Mon, 8 Mar 2021 21:23:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BD858D007F; Mon, 8 Mar 2021 21:23:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 636C88D00A8; Mon, 8 Mar 2021 21:23:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 4B94F8D007F for ; Mon, 8 Mar 2021 21:23:22 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0C1938249980 for ; Tue, 9 Mar 2021 02:23:22 +0000 (UTC) X-FDA: 77898739044.14.87CA070 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf19.hostedemail.com (Postfix) with ESMTP id 6B64F90009F0 for ; Tue, 9 Mar 2021 02:23:20 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id d23so2601012plq.2 for ; Mon, 08 Mar 2021 18:23:21 -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=jDz13J2Ic/rseTFIgsbUpalTQ6rauQ94sMWBebPKNBo=; b=B+wrMG148xSOQut1zLdIYxfkmA51sRhXQ+CwydWsxglnLUyzJyebOmenhOa8xHU3mp mNNnPKLl1WGr/+2lh9ba6v7qkFbi3nLgIsZ+IEVthGzaT8uhigxlnYxnTsivDaJ7eTi/ +r9ra1NKqvkNF99kTBcX2V5W+FgjMid0lp3zaFQQjqrB3MkZ5XONDAbzVyXbMkejWcae uJo6fkiIlSzJ5tFA1Rr1b7gM0PTTm0hLSYmQLYoHAkhEJl8tsCSbcRwMTO5oRQdj3bN6 vCZzpTSQ/lbpyZ1l2wEWQAq2hpARC+to2RQQQAquhG0nqzwk18boerwG3Usi09/o/o1O BDAw== 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=jDz13J2Ic/rseTFIgsbUpalTQ6rauQ94sMWBebPKNBo=; b=aMRootduBS5GO78u0/kwExUvD1JLsky8C61aWU6C1LjVwcG9xSNmkoPEplczfPTcPr nk/5f5pshP13zvkLAx6EoFUd6NP8Xh3AwOSpxgQOc+SrIlre09eueJVnmpTOwOUYSF2u HHyQEIu8PCCvtJ8XR2U6iygCdpPmNjD+NNKOsrAinGlHWNi+tiSItYdo6cBO1gd/9Bko /MdmIcZAMXt1w9pWAiouWBC5q33YCcwDlwuVPndLrMNPjt+9CbQ71M7+GVQKuuh+r8fz c4tyXmH8AElvtsYULOu3S+F2f5F5BrVftc3UkfO7iei6gqTVpnnDpvYySB2g2Mffu9kZ EDJA== X-Gm-Message-State: AOAM530fab7gMnFUXwtvU/fvNUHnvf/AzpILVnZD12yChf4N7+rCOO6m 8CVFNq1QKfhZskw2tx287Yk= X-Google-Smtp-Source: ABdhPJw1SxvmBDIvoxd/6zwjhMPEI1fV9zrHpkxtKLybJOelTcIN23xLNhCzyA8UKRMZAyo3RmGO8w== X-Received: by 2002:a17:902:c317:b029:e4:aecd:8539 with SMTP id k23-20020a170902c317b02900e4aecd8539mr23798801plx.61.1615256600587; Mon, 08 Mar 2021 18:23:20 -0800 (PST) Received: from google.com ([2620:15c:211:201:4ccc:acdd:25da:14d1]) by smtp.gmail.com with ESMTPSA id s200sm11440914pfs.53.2021.03.08.18.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 18:23:19 -0800 (PST) Date: Mon, 8 Mar 2021 18:23:17 -0800 From: Minchan Kim To: Rong Chen Cc: kernel test robot , Andrew Morton , kbuild-all@01.org, Linux Memory Management List , LKML , John Dias , Michal Hocko , David Hildenbrand , Jason Baron Subject: Re: [kbuild-all] Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages Message-ID: References: <20210308202047.1903802-1-minchan@kernel.org> <202103090555.LtLPf1Ho-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6B64F90009F0 X-Stat-Signature: 1czf11y8i6uyo1aai19wgrkdkayp6dgt Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=mail-pl1-f170.google.com; client-ip=209.85.214.170 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615256600-853116 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 Tue, Mar 09, 2021 at 08:41:44AM +0800, Rong Chen wrote: > > > On 3/9/21 6:29 AM, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 05:29:30AM +0800, kernel test robot wrote: > > > Hi Minchan, > > > > > > I love your patch! Perhaps something to improve: > > > > > > [auto build test WARNING on hnaz-linux-mm/master] > > > > > > url: https://github.com/0day-ci/linux/commits/Minchan-Kim/mm-page_alloc-dump-migrate-failed-pages/20210309-042205 > > > base: https://github.com/hnaz/linux-mm master > > > config: m68k-allmodconfig (attached as .config) > > > compiler: m68k-linux-gcc (GCC) 9.3.0 > > > reproduce (this is a W=1 build): > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # https://github.com/0day-ci/linux/commit/3c635af37b862e9c601ee8d5818f7da9cd3e2e57 > > > git remote add linux-review https://github.com/0day-ci/linux > > > git fetch --no-tags linux-review Minchan-Kim/mm-page_alloc-dump-migrate-failed-pages/20210309-042205 > > > git checkout 3c635af37b862e9c601ee8d5818f7da9cd3e2e57 > > > # save the attached .config to linux build tree > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k > > > > > > If you fix the issue, kindly add following tag as appropriate > > > Reported-by: kernel test robot > > > > > > All warnings (new ones prefixed by >>): > > > > > > arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra] > > > 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory) > > > | ^~ > > > include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' > > > 78 | # define unlikely(x) __builtin_expect(!!(x), 0) > > > | ^ > > > include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON' > > > 143 | BUG_ON(!virt_addr_valid(buf)); > > > | ^~~~~~ > > > include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid' > > > 143 | BUG_ON(!virt_addr_valid(buf)); > > > | ^~~~~~~~~~~~~~~ > > > In file included from arch/m68k/include/asm/page.h:60, > > > from arch/m68k/include/asm/thread_info.h:6, > > > from include/linux/thread_info.h:38, > > > from include/asm-generic/preempt.h:5, > > > from ./arch/m68k/include/generated/asm/preempt.h:1, > > > from include/linux/preempt.h:78, > > > from include/linux/spinlock.h:51, > > > from include/linux/mmzone.h:8, > > > from include/linux/gfp.h:6, > > > from include/linux/mm.h:10, > > > from mm/page_alloc.c:19: > > I am not sure this is triggered by the patch since I could see the > > warn with reverting the patch. > > Hi Minchan, > > Only the lines prefixed by ">>" are related with the patch: > > > > mm/page_alloc.c:8348:5: warning: no previous prototype for 'alloc_contig_ratelimit' [-Wmissing-prototypes] > > 8348 | int alloc_contig_ratelimit(void) > | ^~~~~~~~~~~~~~~~~~~~~~ > > > > mm/page_alloc.c:8353:6: warning: no previous prototype for 'dump_migrate_failure_pages' [-Wmissing-prototypes] > > 8353 | void dump_migrate_failure_pages(struct list_head *page_list) > Thanks for the clarification. Then, below should fix the warning. I will respin it at next revision once I get more feedback. +#if defined(CONFIG_DYNAMIC_DEBUG) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) +static void dump_migrate_failure_pages(struct list_head *page_list) +{ + static DEFINE_RATELIMIT_STATE(_rs, + DEFAULT_RATELIMIT_INTERVAL, + DEFAULT_RATELIMIT_BURST); + + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, + "migrate failure"); + if (DYNAMIC_DEBUG_BRANCH(descriptor) && __ratelimit(&_rs)) { + struct page *page; + + WARN(1, "failed callstack"); + list_for_each_entry(page, page_list, lru) + dump_page(page, "migration failure"); + } +} +#else +static inline void dump_migrate_failure_pages(struct list_head *page_list) +{ +} +#endif + /* [start, end) must belong to a single zone. */ static int __alloc_contig_migrate_range(struct compact_control *cc, unsigned long start, unsigned long end) @@ -8496,6 +8520,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, NULL, (unsigned long)&mtc, cc->mode, MR_CONTIG_RANGE); } if (ret < 0) { + dump_migrate_failure_pages(&cc->migratepages); putback_movable_pages(&cc->migratepages); return ret; }