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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 43E06C433E0 for ; Tue, 9 Mar 2021 17:28:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0CAD6523C for ; Tue, 9 Mar 2021 17:28:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0CAD6523C 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 40F4E8D011E; Tue, 9 Mar 2021 12:28:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E5C18D007F; Tue, 9 Mar 2021 12:28:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 286A58D011E; Tue, 9 Mar 2021 12:28:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 0BE268D007F for ; Tue, 9 Mar 2021 12:28:10 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BA75B181AF5C3 for ; Tue, 9 Mar 2021 17:28:09 +0000 (UTC) X-FDA: 77901019098.09.03E842A Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf04.hostedemail.com (Postfix) with ESMTP id 65CFB3CB for ; Tue, 9 Mar 2021 17:28:05 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id u18so6913170plc.12 for ; Tue, 09 Mar 2021 09:28:00 -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=RgCAC8soedBAR4QV6xrwRz7z96hXnQfIsjeHL6pqe5I=; b=neFB4ap49LsR/+Ea8ax5epXOkyWa4xXrzFKkoAMpt7upOSctyqk+0Znslr3U5Thf0G UkedV76CyXkyNkUD505gwubYQbvFedbL773bhgVpfauWpGD7Kr52RJeMQhzMzXRN0Or4 HibQ5z3ETpIFtOF3yZUS94v1IVqNO2KGgXePMLGxr8wFNHjNH0pMePO40l5ebSwD5SFB x0KZY231Kqy7GfPBHRwugE1BXgQ8/C0S9GjzmVPDINz2tbsH0wzsQPtGqEfWDij0bTDT T2LLFeHo2v/0oC0NaLt+qlkqUPBQP294Wml1/VhONdDh3j/jGBcfJ+XFiipiX7zHivw7 2zRw== 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=RgCAC8soedBAR4QV6xrwRz7z96hXnQfIsjeHL6pqe5I=; b=d99rIS2AsalT1BGN4zkGT6ugwF5epe2XYJ8z5SudZQye/FhyxXIpFyxhnLKQ53DyOq yensaoMev8ssbhpF7yr9zbBk8Mqln2qcc753YQ3WGEJ/30v3IKFc8rIvWN7Ii2wCuOyH 7KpCiQc/4fsPJ/zmdbNmZ838Z7SGY6xDgWI3tD/3cbFwSHX7trTTuhqB+fJaO2aw4djs QSPhEyjc3uzaFUlwPvhoYMvE2GRUDTuz2OddF45aUGC1/F8M2z1ZS6JCDghDj160ZTdi ZZgERQ/lNURT9YOgWajypOS8g20KHt4/xof2VLJ3EL9ukxkcwhYKJPRMWCNBX8Cndaay 1oXA== X-Gm-Message-State: AOAM532cNqEOaYeAm9oET4Mu4kMWV8x67IPKYXs1I26VxOle+LNSJzHl xHDo14dPk+F+shGhVxkBZT0= X-Google-Smtp-Source: ABdhPJyD8Z2B4M1dFVTdJp5evU8UPdMy5k3IS9vQ4jFRKfoj4IZVuV0T3UZWyAZASZ7TZ8MPVIwIzw== X-Received: by 2002:a17:90a:5587:: with SMTP id c7mr5549405pji.5.1615310874689; Tue, 09 Mar 2021 09:27:54 -0800 (PST) Received: from google.com ([2620:15c:211:201:f896:d6be:86d4:a59b]) by smtp.gmail.com with ESMTPSA id e83sm6038999pfh.80.2021.03.09.09.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 09:27:53 -0800 (PST) Date: Tue, 9 Mar 2021 09:27:51 -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: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 65CFB3CB X-Stat-Signature: qw7uoh83tf68drwfjtg7izsw7a8htzqq Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-pl1-f178.google.com; client-ip=209.85.214.178 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615310885-416397 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 05:32:08PM +0100, Michal Hocko wrote: > On Tue 09-03-21 08:15:41, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 10:32:51AM +0100, Michal Hocko wrote: > > > On Mon 08-03-21 12:20:47, Minchan Kim wrote: > > > > alloc_contig_range is usually used on cma area or movable zone. > > > > It's critical if the page migration fails on those areas so > > > > dump more debugging message. > > > > > > I disagree with this statement. alloc_contig_range is not a reliable > > > allocator. Any user, be it CMA or direct users of alloc_contig_range > > > have to deal with allocation failures. Debugging information can be > > > still useful but considering migration failures critical is > > > overstatement to say the least. > > > > Fair enough. Let's change it. > > > > "Currently, debugging CMA allocation failure is too hard > > due to lacking of page information. alloc_contig_range is > > proper place to dump them since it has migrate-failed page > > list." > > "Currently, debugging CMA allocation failures is quite limited. The most > commong source of these failures seems to be page migration which > doesn't provide any useful information on the reason of the failure by > itself. alloc_contig_range can report those failures as it holds a list > of migrate-failed pages." Will take it. Thanks. < snip > > > > Somebody more familiar with the dynamic debugging infrastructure needs > > > to have a look but from from a quick look it seems ok. > > > > > > Do we really need all the ugly ifdefery, though? Don't we want to have > > > this compiled in all the time and just rely on the static branch managed > > > by the dynamic debugging framework? > > > > I have no further idea to make it simple while we keep the flexibility > > for arguments and print format. > > > > #if defined(CONFIG_DYNAMIC_DEBUG) || \ > > (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) > > static void alloc_contig_dump_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 alloc_contig_dump_pages(struct list_head *page_list) > > { > > } > > #endif > > First, you would be much better off by droping the rate limitting. I am > nt really convinced this is really necessary as this is a debugging aid > enabled on request. A single list can be large enough to swamp logs so > why bother? No problem. Just added since David mentioned hugetlb pages are easily fail to mgirate at this moment. Yes, We could add the ratelimit if we get complain. > > Also are all those CONFIG_DYNAMIC_DEBUG* ifdefs necessary? Can we > simply enable DYNAMIC_DEBUG for page_alloc as I've suggested above? They are different usecases. With DYNAMIC_DEBUG_MODULE with CONFIG_DYNAMIC_DEBUG_CORE, it works for only specific compile flags as you suggested. (CONFIG_DYNAMIC_DEBUG_CORE is requirement to work DYNAMIC_DEBUG_MODULE. With CONFIG_DYNAMIC_DEBUG, user could enable/disable every dynamic debug places without needing DYNAMIC_DEBUG_MODULE flags for source files. Both usecase makes sense to me.