Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7348068rwd; Tue, 6 Jun 2023 09:26:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ubFA7F8lghGaT+P4dVoP0XCt9OfLF504dhoapDhSm9sIKYLKHMvNxrzMm07vE27eFqZV+ X-Received: by 2002:a05:620a:8dc:b0:75e:474:a0f1 with SMTP id z28-20020a05620a08dc00b0075e0474a0f1mr303078qkz.11.1686068776689; Tue, 06 Jun 2023 09:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686068776; cv=none; d=google.com; s=arc-20160816; b=OHUEM3wsjnh5B7OgozmXqHl7e7TrJdQWM8W/J+3AhrzDi72g1+Z+C90Q/5jfIQ4dJT bSk1RfkWfeO203i1DidS98B/9PfDQscatYzquQ7TFzn9hphwmp+9ZipXUzMXCOjs7qLJ Cm//g8pgvkXkpj96pD5m2nf9G2BmjHgiy7ZYDOjWQuaoRTi4s7ZQv1kWBUtZW+NWyQ5h JUXl6f3+CPK7CTdJTbI6x8pvg/LiffbArtZ9aP38uviYdHm0BINQqVriRQD6ltPgaQw4 zIS0LdUJ+vdW2PYFh+TWd3Y7IJ7biz+eVfKeZBv022zQ+Qr/9HtWhmrP/Dvr5nSEWFWv CZBg== 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=WA9TCdUcv82zThgquwL+JZWAlge/m1Sa+GLhYtCy31g=; b=pKwqrqqMgouheNzuIbFjecwSAY4FsuQQnSpLejv3fTZ7m3k5Qg1/66gE1UfeMcUpHR nLjAsol5UHGZ8uvQQnXCsFRz5kbJezUmeSY1itasKSJBbvwc7aCHKutdv0/Rf3XxcT6N awrojIWn3PE9L3tnCRPcM/I05cWWZZUe/Sl9clGgRWZjEO2s8RZwXs2BtCneS08w5ske T/iUsrE9pEQpsT2IIriflg8dMkIwyiGVLZcKCSbj0vxZndzGC9wRFmqAxf1zrdt5b+1E U2T93sPqZYTHBcJuPD0fIG7kqGhruuZxru2fP+Ui5+6X0o1Lbs2eBNLkfa7oQK1puJX9 FYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DJ1uaamv; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020ae9f103000000b0075af466398fsi5902809qkg.750.2023.06.06.09.25.59; Tue, 06 Jun 2023 09:26:16 -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=@suse.com header.s=susede1 header.b=DJ1uaamv; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232583AbjFFQLL (ORCPT + 99 others); Tue, 6 Jun 2023 12:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjFFQLK (ORCPT ); Tue, 6 Jun 2023 12:11:10 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B7210F4 for ; Tue, 6 Jun 2023 09:11:08 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2F99721986; Tue, 6 Jun 2023 16:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686067867; h=from:from:reply-to: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=WA9TCdUcv82zThgquwL+JZWAlge/m1Sa+GLhYtCy31g=; b=DJ1uaamvWwQ10PlsUbgAkqk2om67RcLino90aEHDji+yvPsDGYc+EQwplnGaXEWbtAQrHX QFcQqNA5A87e4SmXvEonv0R6TutBO0UP0u5LV3KfdhmWGA5QhxXRKBDpXp6tn9jDXNNz0J xM65UNdm+ItaH8Yf2Oq6sIqtVxmvcJg= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 11F6213519; Tue, 6 Jun 2023 16:11:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iR8bAptaf2SuNAAAMHmgww (envelope-from ); Tue, 06 Jun 2023 16:11:07 +0000 Date: Tue, 6 Jun 2023 18:11:06 +0200 From: Michal Hocko To: Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Baoquan He , 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 Mon 05-06-23 21:11:07, 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. The way how high order allocations are grafted in is just horrendous. Sigh. > Link: https://bugzilla.suse.com/show_bug.cgi?id=1211410 > Signed-off-by: Lorenzo Stoakes Acked-by: Michal Hocko Thanks! > --- > 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; > } > > -- > 2.40.1 -- Michal Hocko SUSE Labs