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_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 D922AC433DB for ; Wed, 17 Feb 2021 17:45:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8170960249 for ; Wed, 17 Feb 2021 17:45:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8170960249 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 E246C6B0006; Wed, 17 Feb 2021 12:45:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAF186B006C; Wed, 17 Feb 2021 12:45:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C770A6B0071; Wed, 17 Feb 2021 12:45:31 -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 AE4C86B0006 for ; Wed, 17 Feb 2021 12:45:31 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7C7DB908B for ; Wed, 17 Feb 2021 17:45:31 +0000 (UTC) X-FDA: 77828486862.08.shame91_40031a82764e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 60E391819E62B for ; Wed, 17 Feb 2021 17:45:31 +0000 (UTC) X-HE-Tag: shame91_40031a82764e X-Filterd-Recvd-Size: 6423 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Feb 2021 17:45:30 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id z7so7798758plk.7 for ; Wed, 17 Feb 2021 09:45:30 -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=Th2rBrQf0xivjZpxGz4MWrvo0rVQSj3VaD7SN2MtDyY=; b=lBHLQReA/7O65lJ3ZtEEu7KLtKIx1UBxtaP7rQeRMdHAQg43bRyKwbQNKvWuSncR81 UCfTsoe8QIq2BWF/qYGoDEj1DhK1bGLM6yXkeX9/Xg6USw83GT9C7KPMIqIZVBmT56dT cA7PNtEOwXK+GpoDF+O7esVIGyzr6kCgNPljWpNWcHxYFa79XiGJNeJOTA4IzBlnbxeX WflX3qYq7LXGGdAPTAW+/q5L/mB5rpAqeMn9qEVcSaIeZW+rJC4crDKM45YuFOiqZbZ7 3JWZf/L+XVfI+hWvOGUJALYB8WVqIR+7rLMxmMU4xhCljll0XpIekjGI8fKLVOjlPt/U AITg== 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=Th2rBrQf0xivjZpxGz4MWrvo0rVQSj3VaD7SN2MtDyY=; b=Kb0edlDI8qeT6XU5bhUiyzvBREQ6gPDXBlkAo7Gx3Erb+dqGO0dFne+P8CPfChJFmI CBkmqsKKarF6sQjXp21Uz87fm/vXYrxjkxqUbCrVUtNM9ynVIf/AwVxVPnKcGxnsS+32 JPexmeIM0pgwjaq7V60i+rHEXF9J+NUTNzuvYl2Y1xjrObHAnAkCzdnaZEbAdDqx8mjr s0BoTo93Wd6sB+EqzApNdTAwSXRiz9gIuiXWIYZwXEEbGKQ8Kz96lN1kkU/KI20+ecdA D8WkTkvM9W1ZVXHI2sbyb86VA2JM9w2x2M9qxD+dSnUYKULP9eStHV/srNvFAydhSZNe nopA== X-Gm-Message-State: AOAM5320vOgoxGTtWmQpZOt3z6sukB1YTBoI0hT9ATcgsXZYro6guNVC L5sdCbFXYb2odxP/g8wuAas= X-Google-Smtp-Source: ABdhPJz/p6j4HMadmLD6c+JI0OqrpX+YSC4dsnRiAD2jV7j9ebD3NuDSpQDonFErz5Q9zDqe4VrObg== X-Received: by 2002:a17:902:ac88:b029:e3:8a26:35bb with SMTP id h8-20020a170902ac88b02900e38a2635bbmr377944plr.45.1613583929836; Wed, 17 Feb 2021 09:45:29 -0800 (PST) Received: from google.com ([2620:15c:211:201:cdf7:1c5d:c444:e341]) by smtp.gmail.com with ESMTPSA id k24sm2992496pfg.40.2021.02.17.09.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 09:45:28 -0800 (PST) Date: Wed, 17 Feb 2021 09:45:27 -0800 From: Minchan Kim To: David Hildenbrand Cc: Andrew Morton , linux-mm , LKML , mhocko@suse.com, joaodias@google.com Subject: Re: [PATCH] mm: be more verbose for alloc_contig_range faliures Message-ID: References: <20210217163603.429062-1-minchan@kernel.org> <854d4ec8-1eb9-3595-b867-3e50f5a0e6a8@redhat.com> <0f201a5a-caaf-2861-59f2-b66152fe9c53@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0f201a5a-caaf-2861-59f2-b66152fe9c53@redhat.com> 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 Wed, Feb 17, 2021 at 06:34:13PM +0100, David Hildenbrand wrote: > On 17.02.21 18:26, Minchan Kim wrote: > > On Wed, Feb 17, 2021 at 05:51:27PM +0100, David Hildenbrand wrote: > > > On 17.02.21 17:36, 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 like memory_hotplug unless user > > > > specifiy __GFP_NOWARN. > > > > > > > > Signed-off-by: Minchan Kim > > > > --- > > > > mm/page_alloc.c | 16 +++++++++++++++- > > > > 1 file changed, 15 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > > > index 0b55c9c95364..67f3ee3a1528 100644 > > > > --- a/mm/page_alloc.c > > > > +++ b/mm/page_alloc.c > > > > @@ -8486,6 +8486,15 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, > > > > NULL, (unsigned long)&mtc, cc->mode, MR_CONTIG_RANGE); > > > > } > > > > if (ret < 0) { > > > > + if (!(cc->gfp_mask & __GFP_NOWARN)) { > > > > + struct page *page; > > > > + > > > > + list_for_each_entry(page, &cc->migratepages, lru) { > > > > + pr_warn("migrating pfn %lx failed ret:%d ", > > > > + page_to_pfn(page), ret); > > > > + dump_page(page, "migration failure"); > > > > + } > > > > > > This can create *a lot* of noise. For example, until huge pages are actually > > > considered, we will choke on each end every huge page - and might do so over > > > and over again. > > > > I am not familiar with huge page status at this moment but why couldn't > > they use __GFP_NOWARN if they are supposed to fail frequently? > > any alloc_contig_range() user will fail on hugetlbfs pages right now when > they are placed into CMA/ZONE_MOVABLE. Oscar is working on that upstream. Until then, how about adding this under !CONFIG_HUGETLBFS? > > > > > > > > > This might be helpful for debugging, but is unacceptable for production > > > systems for now I think. Maybe for now, do it based on CONFIG_DEBUG_VM. > > > > If it's due to huge page you mentioned above and caller passes > > __GFP_NOWARN in that case, couldn't we enable always-on? > > It would make sense to add that for virito-mem when calling > alloc_contig_range(). For now I didn't do so, because there were not that > many messages yet - alloc_contig_range() essentially didn't understand > __GFP_NOWARN. > > We should then also stop printing the "PFNs busy ..." part from > alloc_contig_range() with __GFP_NOWARN. Yub. > > > > > Actually, I am targeting cma allocation failure, which should > > be rather rare compared to other call sites but critical to fail. > > If it's concern to emit too many warning message, I will scope > > down for site for only cma allocation. > > If you add "__GFP_NOWARN" when !ZONE_MOVABLE, how would you ever print > something for CMA? What am I missing? CMA is usually not on ZONE_MOVABLE. If the caller of cma_alloc passed __GFP_NOWARN, I don't care since caller explictly declare it's not critical. What I'd like to catch up is cma_alloc with !__GFP_NOWARN sites.