Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6763017pxb; Wed, 17 Feb 2021 12:45:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnrO9bFAOAPXNDtfIauxj1kr69hzKOVoTFKi4JjNlEE9yZrhmOFOdCBdOdU23jAM3bRMNP X-Received: by 2002:a17:906:2293:: with SMTP id p19mr768966eja.206.1613594719335; Wed, 17 Feb 2021 12:45:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613594719; cv=none; d=google.com; s=arc-20160816; b=RE+Q04ZDQK/aL22oF0H8pKwuDZzjUncmvB4xmlMf2GJQ1C85HGo1vA+8VkXqwZpXi3 wsV+5IXDVeyu2X7wXjJg5LEF/nP/sGhTSqG9j79ATikphwFh0QOEwHg/jkXf32cZy/MU Yfre5RlwcZiBPoSTJy4ErWmntwB/0dTq4d6r57grlfdXbGKGUN1AO5S5ttjGVX1Sc3ae eg9iXx2oXm8d/tNc4WnuJ0QoBq8n/MF1gHA/Ar9PgjV3dPImrO7gulfdS+ipxAGe+lgi oF8uOw0LmLPHwMpxOq0bK+bKiKmLu6yozUcgu8GGCUUgUcE4LP875RavpJDYZhVKclbz kZeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:from:references:cc:to:dkim-signature; bh=qpc/1mlUzLnmcczpO47H6GSp0ZG9steVwoYmgJ68hFo=; b=yar8/m2UvwDqJq65IChKNPOekZGpVNeRWrg8NV6k8QWsWppXdodt1hFhw1RDIatmnX ug+k1MmVc3sDw2YfjYobiJZPVQoEI43fB6qnCa+5p4g4xMc3bhQdSFfUeTe0e2Z5BfAx 7WzpRIFnPbIVTDuG+2pS+AS6NDMfzpQUxulHxfCdKeSzofuu8tHbByb9tOVNXiAVURUg PBYspDapqJz04XdBFcYcmcEUEObq0bqgM0OI0Ky9pJ1z4IWYUyCkA8CKdBGhfXi+BB4G 1DmdNvtLeyAFl4jwuJA1aUSfhINyRvBrGueeCqSAYiyhkQ9jSmuEI5LX59ThD04o/X19 pZFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IBTpvJIO; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si2010559eds.116.2021.02.17.12.44.55; Wed, 17 Feb 2021 12:45:19 -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=@redhat.com header.s=mimecast20190719 header.b=IBTpvJIO; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234509AbhBQRlA (ORCPT + 99 others); Wed, 17 Feb 2021 12:41:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26447 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234453AbhBQRfo (ORCPT ); Wed, 17 Feb 2021 12:35:44 -0500 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > >> >> 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. > > 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. -- Thanks, David / dhildenb