Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6433493rwd; Mon, 5 Jun 2023 18:47:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64XAFAjMEGZoHjPASxzPSFgYbk6vGiP+wJp+Kz16Ju+MFC+1MSofLRbeFHl6Jo3EY7jqWP X-Received: by 2002:a05:620a:232:b0:75d:5415:ffae with SMTP id u18-20020a05620a023200b0075d5415ffaemr411313qkm.50.1686016057379; Mon, 05 Jun 2023 18:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686016057; cv=none; d=google.com; s=arc-20160816; b=fsgJskzdPkiS/OlkpEQpGnXPaP9IMh6CN6ZyERngf/fjn5OaKP4jeaUSoyER1DeWbc zmd+7Hf8ikWsSJUDD/0zO7chOWxCpq7+NBNezT0uSoiMhfsy8A8KA9ZGMA33JvNdCN9y Dt5Zoor0eMpf9DqR4vJRCluBzpuKjF3alOfzTRHqIbA6xC98Y4yDeBNiPXOjndB1p3+y vXLOaT7+i6PyjbMPAoOeBx3gmZIjEhglhvnKtcssxdE3Bgpb139eyGL9GQvDm/KnI66s Y3NIcWIy1dC/NkFkuIWqCSVNzLfwjqvwm2S3sBIuHDLPOa4+P87jZiY/EB1PNBmNSmso AWHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pC5sG/OJcZgKnubuci+7fn1G+3p3NcyJirieddMJY8Y=; b=g/2zt3sOjD0jv3nzpbluKBGAuFduw7GXD5ZSFlRDyJxJHqsMiucb63LW56WBldiGVz m6dC/IS+m3cpoBLzmgrZ9sKk8nJdelRwcBudJVXheRbUUGPS+F169PwN5m9xkmmroUYE H0N9/7cN+md93w78hMnS0blMy6Epqqwc/S+PFGeCTl7K0eslKsbnLywTiAEEmxw9rFYd MpKHcxqrtPTuxT+GGrahh+W9hdVgDrMxZYCizZ1pzwHITJaXGsptxV3+UqfWI2k9mkYy g9I7b3YA3D/p14beeLjFs5PMAkPE5iADGWyNTVI+C38V1ko5sLaxICr5nCOu0tbPWouC 7nIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TCSc7rS9; 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 m15-20020a05620a13af00b0075ec02993d5si1393140qki.50.2023.06.05.18.47.22; Mon, 05 Jun 2023 18:47:37 -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=TCSc7rS9; 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 S232580AbjFFBOH (ORCPT + 99 others); Mon, 5 Jun 2023 21:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbjFFBOG (ORCPT ); Mon, 5 Jun 2023 21:14:06 -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 BCD07100 for ; Mon, 5 Jun 2023 18:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686013998; 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: in-reply-to:in-reply-to:references:references; bh=pC5sG/OJcZgKnubuci+7fn1G+3p3NcyJirieddMJY8Y=; b=TCSc7rS91YRq6KQSK8JRwDDNGRRvKyitunoIZoWHD6CPA3U6OxVi8S65C47TjqCD2Tkb2z 3PTPjjdQ7odT1/5Vi/3RcmGjG40+XHwJ6mosP2tfxdBMA1IQRY6LZVvh+vyhfy3p+Sch6P AqYc1A6GoMvyANRiFxIdEmQ5Wx3e3V0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-XQhx8fhaPUu579ubvTcy2g-1; Mon, 05 Jun 2023 21:13:15 -0400 X-MC-Unique: XQhx8fhaPUu579ubvTcy2g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01E633C01E00; Tue, 6 Jun 2023 01:13:15 +0000 (UTC) Received: from localhost (ovpn-12-83.pek2.redhat.com [10.72.12.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B736240CFD46; Tue, 6 Jun 2023 01:13:13 +0000 (UTC) Date: Tue, 6 Jun 2023 09:13:09 +0800 From: Baoquan He To: Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Vlastimil Babka Subject: Re: [PATCH] mm/vmalloc: do not output a spurious warning when huge vmalloc() fails Message-ID: References: <20230605201107.83298-1-lstoakes@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230605201107.83298-1-lstoakes@gmail.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 06/05/23 at 09:11pm, 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. > + */ LGTM, Reviewed-by: Baoquan He > + 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; > } > > -- > 2.40.1 >