Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6713386rwd; Tue, 6 Jun 2023 00:26:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+IYy25epsQJhD2OxUIaa3QC/cMaZ0j9m2+zJrbHRi+bGJLPNlnqUXpjpEzGN3di1abeHY X-Received: by 2002:a92:d951:0:b0:33d:2ba7:26c0 with SMTP id l17-20020a92d951000000b0033d2ba726c0mr2234190ilq.1.1686036376373; Tue, 06 Jun 2023 00:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686036376; cv=none; d=google.com; s=arc-20160816; b=oU/3BPdMkeppZjog8SaiGlyLw/dSk0grfoSdCMUM1SrvejeSVXwdRbjXBfAIRo3VxI JBbkwJSqDiMoPruLE3aRtY89A8qS07w2f5y7cHsLKLY1/3INDzIRPB8tDMFzoY9EiQUf yVynOF16rLU6idTaFOvx5/y8oK8JNyW4pQrd1zNwq+CuVqk944tzyfWbLSfzQ8due36N jbVOurqOcNvILMJmcv6Gm80qbVOUSaL4MtdWAmvo0Y5pHaArAb9bZ/vD/naoSENEIJsR iEYa4wAyHSgCBiF7fUfmrd/D7qZGcqTghuiebQWiF6dMtMY1QEKiD+6/Om+xg3uyN9NX WOUQ== 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:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=9zXSead29cb/X6WK/OYs0Rg2NSA3cgXeSg/kRze2eug=; b=uDuKwasZ2Es9KeBG1Xwq1oYl6QIPyS3BJPtw9P7aqu9dcuUTBn8Xpo03Glaz2xLfbt mKbv0gcYLS5V4QQLuO+sp5qAwrMNldWCrsODw8w+MIZAlJym0WyCV0ZfTcmQeMz3VG0+ oIY2h1P175YVDLkL/o0Tcd7axCzs7bC1kDAR0sqbQVyrSF5fsTggJTWMb+/kr0T7SDOb nPbPitg51U+v/RhKYHExpYjeZibCwvJ+4hhA6//rHL2TQzGLo10H9fhWIhkZX/WONjQ7 jRDIr9LvwUNbIKMZP4bJR6ZekblZDK3E8pMb/pwIqcZGHSe0eEAq5jvg609qHhiiHyFB 9VHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vZPMzrCF; dkim=neutral (no key) header.i=@suse.cz header.b=BLBwK9Ys; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r185-20020a632bc2000000b0053416d0b54dsi6877501pgr.518.2023.06.06.00.26.02; Tue, 06 Jun 2023 00: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.cz header.s=susede2_rsa header.b=vZPMzrCF; dkim=neutral (no key) header.i=@suse.cz header.b=BLBwK9Ys; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236027AbjFFHOX (ORCPT + 99 others); Tue, 6 Jun 2023 03:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236044AbjFFHOB (ORCPT ); Tue, 6 Jun 2023 03:14:01 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F843E79; Tue, 6 Jun 2023 00:13:50 -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-out2.suse.de (Postfix) with ESMTPS id 927F01FD6B; Tue, 6 Jun 2023 07:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1686035604; h=from:from:reply-to: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=9zXSead29cb/X6WK/OYs0Rg2NSA3cgXeSg/kRze2eug=; b=vZPMzrCFuY4OnmVChtWdybbiDkORnG6eghm6v2X1KX/29qN1JPMouWJPHvVAj6fcLn9dGY vOSUfJsbwRBzccvVXI5/YlONk+U6bkP3jXLzE14fIHkHe6zTeiwLQYXldOc2WAejh25NfC xBWNpqn5gucE0/PvgRp1Y8E4/aegpAg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1686035604; h=from:from:reply-to: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=9zXSead29cb/X6WK/OYs0Rg2NSA3cgXeSg/kRze2eug=; b=BLBwK9YsJFmV9jap45BLaAwocFUnobvByD7sG/S+o0TCEQCd6Lumw5fMvYzUnsHBm1CEJs od9TGUxdDaetxhAQ== 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 5BAD813519; Tue, 6 Jun 2023 07:13:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HAOuFZTcfmTyBQAAMHmgww (envelope-from ); Tue, 06 Jun 2023 07:13:24 +0000 Message-ID: Date: Tue, 6 Jun 2023 09:13:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH] mm/vmalloc: do not output a spurious warning when huge vmalloc() fails To: Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Cc: Baoquan He , Uladzislau Rezki , Christoph Hellwig , Bagas Sanjaya , Linux btrfs , Linux Regressions , Chris Mason , Josef Bacik , David Sterba , a1bert@atlas.cz, Forza References: <20230605201107.83298-1-lstoakes@gmail.com> Content-Language: en-US From: Vlastimil Babka In-Reply-To: <20230605201107.83298-1-lstoakes@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,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 6/5/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 I think there are more reports of same thing from the btrfs context, that appear to be a 6.3 regression https://bugzilla.kernel.org/show_bug.cgi?id=217466 Link: https://lore.kernel.org/all/efa04d56-cd7f-6620-bca7-1df89f49bf4b@gmail.com/ If this indeed helps, it would make sense to Cc: stable here. Although I don't see what caused the regression, the warning itself is not new, so is it new source of order-9 attempts in vmalloc() or new reasons why order-9 pages would not be possible to allocate? > --- > 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; > } >