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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 DB476C433E0 for ; Wed, 17 Feb 2021 17:34:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75CA864E4D for ; Wed, 17 Feb 2021 17:34:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75CA864E4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1493C6B0072; Wed, 17 Feb 2021 12:34:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FA556B0073; Wed, 17 Feb 2021 12:34:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00FFA8D0001; Wed, 17 Feb 2021 12:34:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id DFF016B0072 for ; Wed, 17 Feb 2021 12:34:19 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9E698362C for ; Wed, 17 Feb 2021 17:34:19 +0000 (UTC) X-FDA: 77828458638.08.DB997D2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 054B3E0011D2 for ; Wed, 17 Feb 2021 17:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613583258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qpc/1mlUzLnmcczpO47H6GSp0ZG9steVwoYmgJ68hFo=; b=IBTpvJIObMuZf9apaobn04p4LKxKrgsIQIXTtIdsYrgVLLSdBmc4JURP2JcHw3tamEzzXl xr1GLIP/wT6+vfcb/ijGcp3mtTsQuYLl2/HLTyUUwT0QaFh3XxzX51Ob6Aknrb63H6psaN cDZqj6GD70bMbMut526ulNVJ7rg3iAo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-mrA4KtbZOMiY7rnmbxHPqw-1; Wed, 17 Feb 2021 12:34:16 -0500 X-MC-Unique: mrA4KtbZOMiY7rnmbxHPqw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28D51100962D; Wed, 17 Feb 2021 17:34:15 +0000 (UTC) Received: from [10.36.114.178] (ovpn-114-178.ams2.redhat.com [10.36.114.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE62B5D72F; Wed, 17 Feb 2021 17:34:13 +0000 (UTC) To: Minchan Kim Cc: Andrew Morton , linux-mm , LKML , mhocko@suse.com, joaodias@google.com References: <20210217163603.429062-1-minchan@kernel.org> <854d4ec8-1eb9-3595-b867-3e50f5a0e6a8@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [PATCH] mm: be more verbose for alloc_contig_range faliures Message-ID: <0f201a5a-caaf-2861-59f2-b66152fe9c53@redhat.com> Date: Wed, 17 Feb 2021 18:34:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Stat-Signature: g4xawrz7b3yafuqcbqmg9tbj86ez5e7r X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 054B3E0011D2 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613583258-523337 Content-Transfer-Encoding: quoted-printable 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 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 ac= tually >> considered, we will choke on each end every huge page - and might do s= o over >> and over again. >=20 > 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=20 when they are placed into CMA/ZONE_MOVABLE. Oscar is working on that=20 upstream. >=20 >> >> This might be helpful for debugging, but is unacceptable for productio= n >> systems for now I think. Maybe for now, do it based on CONFIG_DEBUG_VM= . >=20 > 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=20 alloc_contig_range(). For now I didn't do so, because there were not=20 that many messages yet - alloc_contig_range() essentially didn't=20 understand __GFP_NOWARN. We should then also stop printing the "PFNs busy ..." part from=20 alloc_contig_range() with __GFP_NOWARN. >=20 > 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=20 something for CMA? What am I missing? CMA is usually not on ZONE_MOVABLE. --=20 Thanks, David / dhildenb