Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6738010rwd; Tue, 6 Jun 2023 00:52:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6S7y5kQJY2+p217SSBnwZidDnD5MCQue3lghnwhfvpN0QYp/8sQTr9x2d0A0ctK5wS8qLt X-Received: by 2002:a05:6359:315:b0:123:1a41:3d8 with SMTP id ef21-20020a056359031500b001231a4103d8mr1776627rwb.29.1686037961803; Tue, 06 Jun 2023 00:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686037961; cv=none; d=google.com; s=arc-20160816; b=efEK5ZpYptIivlw1u5GIpQPmyiqA3WuKlb+W8l27ENkXM4JsS/ujArEjGZ44gqjhZ0 zqbptDmSj+a2daMhMBE3ItqRSr+PcF7K3gfa6kCPcAZXCZK5GuyjQCqYoOY1KclN8Txi OXzBpc1X2ObutmYw4yxUm79cTFjNTLwP1YdB/m3TikAAVbe9yZVbHaYya+BtXA/Tz3Mk RChv9f9yeAXtBpfR0apAHT7WX935ZIgGzcu3ixfzrsHMB51D7PBKJ9lwzxKshtmwt1jp C93stsM+oHshlxpuCs0qQKheIXQtF6us0N+3gKRwM2WDKC0TDd9WLhoAZM0+MajLWGAT rH/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=u9hoKMrz96Ll5ESBHtQB3MXK47tj0oxLzUbKMv/mlKw=; b=ffm654aIXrl7XeWeU4/k8TQB8qKWXunA49hvulIC8YiVDbZmPYuNzLWgNr7/tLRp51 ipog9lhAv9Tke2SRxIoe9WwXJ54C8n4KOxU98bwwkRXtaOlC87W0FnhLUi6eZRdxcHGB +kkvr3lZeC3bryq0Wjqk6NO0izqdLTrIxPv62F5bWHr1Ad+Rr2EtuEIrIbsRLBjJhwtP L7HTxbs9yW5jztzdwPN5Wbuzul8fQpjzJ7qB5bp07CsZGlb7YtHvs89Q0ZuDS6OLL0Gb /fqOkCAQLCJINm9rt10SrrBrK3Lkxf8nmOfuucjAUVkWw6G53pB+6ePfeRVoGKgaOTnc XI/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q6CLA2nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a17090ac90b00b00258996c09e4si8747444pjt.22.2023.06.06.00.52.30; Tue, 06 Jun 2023 00:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q6CLA2nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233176AbjFFHfm (ORCPT + 99 others); Tue, 6 Jun 2023 03:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbjFFHfk (ORCPT ); Tue, 6 Jun 2023 03:35:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A72C11B for ; Tue, 6 Jun 2023 00:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686036892; 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=u9hoKMrz96Ll5ESBHtQB3MXK47tj0oxLzUbKMv/mlKw=; b=Q6CLA2nn/9fnyk7E5zqZDq0mpzEFYvld4KMycCcvRV5d5cQba6JER3L8n7wUXEl+OBjd9D jD6cQHfrnGZ1DaEKd3nZUeRN3zmAeJ79ulsrvIpVAcwGumiXXWti5wKHCUweypGW4dk1RQ gEPd9X8TqMZBW9E9jFoCPWYi/6XB4fM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-KKo3_ZooO4eMXI9NmTVNLw-1; Tue, 06 Jun 2023 03:34:49 -0400 X-MC-Unique: KKo3_ZooO4eMXI9NmTVNLw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-30c6060eb32so6697290f8f.1 for ; Tue, 06 Jun 2023 00:34:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686036888; x=1688628888; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=u9hoKMrz96Ll5ESBHtQB3MXK47tj0oxLzUbKMv/mlKw=; b=HjUowVvX8y225kNTOCAAFaPIG+mqETpxWWY13drt+90CyBNdeEKdJSbT4ZRqrAvWwZ QcrIYLS+yqXwJT0RAm6Y8zB78m6/jnPWQqhAP6Qq/P0RQfHVxBHrIea+T8+c3kRScpky MrnwM10ZSgG89nurVaKLdtHFTcT1n8uEppn7OZHCGn5hC+6QbxEesMXyIoPZhntW3ch9 jILOGi1s5PKxrds0A/GhbJqFvLy8P81q6m7r7EczXKNVfXy6IEq0f0ImfGnRwO/zVG4r JgGfBmvlsAuwxaX8kQf0txUKnNyc0hFcRV0uiMV8Fdw3/q2de3vZ6i2VCOyqSG+A2dQh pvfw== X-Gm-Message-State: AC+VfDxJA5kQMkJLiHlMGn4pYygLepydZ2LQAWg4CaYtCzstOZxXlCE6 0FuAaTCHXyTxoIBebz2wleQjLjYr9wBlmeELWOPnjhH735DQLRYjkfA5AYBczcGMA2Jf26Ohq8Y glrA0nETrj6VHrUvVm7/jikuU X-Received: by 2002:a5d:4806:0:b0:30e:3d9b:727e with SMTP id l6-20020a5d4806000000b0030e3d9b727emr1240564wrq.40.1686036888617; Tue, 06 Jun 2023 00:34:48 -0700 (PDT) X-Received: by 2002:a5d:4806:0:b0:30e:3d9b:727e with SMTP id l6-20020a5d4806000000b0030e3d9b727emr1240548wrq.40.1686036888266; Tue, 06 Jun 2023 00:34:48 -0700 (PDT) Received: from ?IPV6:2003:cb:c709:d100:ce7e:d566:43f8:2b24? (p200300cbc709d100ce7ed56643f82b24.dip0.t-ipconnect.de. [2003:cb:c709:d100:ce7e:d566:43f8:2b24]) by smtp.gmail.com with ESMTPSA id g9-20020adfe409000000b0030ae53550f5sm11716503wrm.51.2023.06.06.00.34.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jun 2023 00:34:47 -0700 (PDT) Message-ID: <74ec0a14-c18d-3249-e331-fa4c9c821d01@redhat.com> Date: Tue, 6 Jun 2023 09:34:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] mm/vmalloc: do not output a spurious warning when huge vmalloc() fails Content-Language: en-US To: Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Cc: Baoquan He , Uladzislau Rezki , Christoph Hellwig , Vlastimil Babka References: <20230605201107.83298-1-lstoakes@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230605201107.83298-1-lstoakes@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.06.23 22:11, Lorenzo Stoakes wrote: > In __vmalloc_area_node() we always warn_alloc() when an allocation > performed by vm_area_alloc_pages() fails unless it was due to a pending > fatal signal. > > However, huge page allocations instigated either by vmalloc_huge() or > __vmalloc_node_range() (or a caller that invokes this like kvmalloc() or > kvmalloc_node()) always falls back to order-0 allocations if the huge page > allocation fails. > > This renders the warning useless and noisy, especially as all callers > appear to be aware that this may fallback. This has already resulted in at > least one bug report from a user who was confused by this (see link). > > Therefore, simply update the code to only output this warning for order-0 > pages when no fatal signal is pending. > > Link: https://bugzilla.suse.com/show_bug.cgi?id=1211410 > Signed-off-by: Lorenzo Stoakes > --- > mm/vmalloc.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index ab606a80f475..e563f40ad379 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -3149,11 +3149,20 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, > * allocation request, free them via vfree() if any. > */ > if (area->nr_pages != nr_small_pages) { > - /* vm_area_alloc_pages() can also fail due to a fatal signal */ > - if (!fatal_signal_pending(current)) > + /* > + * vm_area_alloc_pages() can fail due to insufficient memory but > + * also:- > + * > + * - a pending fatal signal > + * - insufficient huge page-order pages > + * > + * Since we always retry allocations at order-0 in the huge page > + * case a warning for either is spurious. > + */ > + if (!fatal_signal_pending(current) && page_order == 0) > warn_alloc(gfp_mask, NULL, > - "vmalloc error: size %lu, page order %u, failed to allocate pages", > - area->nr_pages * PAGE_SIZE, page_order); > + "vmalloc error: size %lu, failed to allocate pages", > + area->nr_pages * PAGE_SIZE); > goto fail; > } > Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb