Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3389123rwd; Mon, 22 May 2023 13:01:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62Uf65jui0VI1GWPSydcXMy5Pe6XMlX+alk/NiUolW02YuDtg2DLoHwhGKmmK1AimUgi3F X-Received: by 2002:a17:903:32c8:b0:1aa:e938:3ddf with SMTP id i8-20020a17090332c800b001aae9383ddfmr16275758plr.7.1684785688903; Mon, 22 May 2023 13:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684785688; cv=none; d=google.com; s=arc-20160816; b=Ea0hPXoAd0pZqoWGAJhYJZdcNhiHaDIDNZaF7dz+42TqlimmKmRFQRKiJgzPq5tOm1 M1WS3/74AiBOCordCP9fjUfqCUX116UAhmhP/LG/FkaKnKReiOIeIJpghxjT2HG5cSQN S4Yy8Mv+NrQ/CjmChlruyNa6kKEMZA326RKxchlwebR1vzMYddqRegE+u2xaNLKvdRCm IWRRQdqmre17uMvP20JFw/DyzryQSOZdzE7YOkr/WT2gi3rRzlm2rM1k2qq0usxjEaR8 O7uGPPgBTJYWiqvELCy4WnDTqV89cohs4EjpsuF6m+ka8oiR59nPG6xyZ1h6tJq+JmNY fUnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=Fpgikaj4b/fIR4oq3PCGfq5sJzdvVfaJIjtWnHRA6R0=; b=eNmxK1ewtxbBcyRQHKX4n5bH9gWhVpRd7oLbxS4DT3moFLpz8l26Qm6xmfbo5V9/lO UtMLgfGLeBkbWiD9LY1KusmETCkOq+SDNl9ums0i0jRxj+/x+p/sklZdrsMkYSEsL8hq VC+ZMvQOGvMN4uR5oJ/m6hr2X/xr82KH9juCms36G75vLyINj7gZKJ7zIp6XQGk0yXTY HcvvA4JXqaLjuTeq5MAVsw5gDilHFBEqUXBKM8wlD54VgXq3Rm1ch6MRq7ps/XH7LvKo XXYmDJIp5BU2AcTgOTjugYtI31W3NEUxeRgn8OQh5WD7NpSXNkPYv7GNlIRQpgnuTm24 2kDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=D70ZT6b1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=XtD6nqwg; 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 jd1-20020a170903260100b001a93c1d66e0si4933342plb.269.2023.05.22.13.01.15; Mon, 22 May 2023 13:01:28 -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=D70ZT6b1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=XtD6nqwg; 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 S234229AbjEVTQT (ORCPT + 99 others); Mon, 22 May 2023 15:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbjEVTQC (ORCPT ); Mon, 22 May 2023 15:16:02 -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 02B32E43; Mon, 22 May 2023 12:15:46 -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 8A12C200F6; Mon, 22 May 2023 19:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1684782943; h=from:from:reply-to: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=Fpgikaj4b/fIR4oq3PCGfq5sJzdvVfaJIjtWnHRA6R0=; b=D70ZT6b1fjWsuL+W1yj9TGbzMb0C5NWUnfgJRwHMF/T18jNEQuWzzMrZ5WgrNX6Fuqiofu 9gIyExPl+ESAj1eopVNEcMi2aMU7mlhOCEyhVFSAfijvBLJFvs6ueVYTZvgHmAz5mHlNo9 XyvAIcTLpeqhNHo/L04sjJrUjTYguTQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1684782943; h=from:from:reply-to: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=Fpgikaj4b/fIR4oq3PCGfq5sJzdvVfaJIjtWnHRA6R0=; b=XtD6nqwgq+tgbSkSxyJ62p07UNPB1IyTTPrapmj+inkYSMN3ePjmWutdZo9t4Up0qUKIxp gtrOQSCuPuRaBjCA== 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 3303E13336; Mon, 22 May 2023 19:15:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nl8AC1+/a2QPNgAAMHmgww (envelope-from ); Mon, 22 May 2023 19:15:43 +0000 Date: Mon, 22 May 2023 21:09:36 +0200 From: David Sterba To: Uladzislau Rezki Cc: Bagas Sanjaya , Linux btrfs , Linux Kernel Mailing List , Linux Regressions , Linux Stable , Chris Mason , Josef Bacik , David Sterba , a1bert@atlas.cz, linux-mm@kvack.org Subject: Re: Fwd: vmalloc error: btrfs-delalloc btrfs_work_helper [btrfs] in kernel 6.3.x Message-ID: <20230522190936.GP32559@twin.jikos.cz> Reply-To: dsterba@suse.cz References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE 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, May 22, 2023 at 06:00:42PM +0200, Uladzislau Rezki wrote: > > Hi, > > > > I notice a regression report on Bugzilla [1]. Quoting from it: > > > > > after updating from 6.2.x to 6.3.x, vmalloc error messages started to appear in the dmesg > > > > > > > > > > > > # free > > > total used free shared buff/cache available > > > Mem: 16183724 1473068 205664 33472 14504992 14335700 > > > Swap: 16777212 703596 16073616 > > > > > > > > > (zswap enabled) > > > > See bugzilla for the full thread and attached dmesg. > > > > On the report, the reporter can't perform the required bisection, > > unfortunately. > > > > Anyway, I'm adding it to regzbot: > > > > #regzbot introduced: v6.2..v6.3 https://bugzilla.kernel.org/show_bug.cgi?id=217466 > > #regzbot title: btrfs_work_helper dealloc error in v6.3.x > > > > Thanks. > > > > [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217466 > > > According to dmesg output from the bugzilla, the vmalloc tries to > allocate high order pages: 1 << 9. Since it fails to get a order-9 page > you get the warning: That we want a order 9 is intentional, it's for a compression workspace (bugzilla comment 5). It's allocated as kvzalloc i.e. with the fallback to vmalloc in case the first one fails. > > if (area->nr_pages != nr_small_pages) { > /* vm_area_alloc_pages() can also fail due to a fatal signal */ > if (!fatal_signal_pending(current)) > warn_alloc(gfp_mask, NULL, > "vmalloc error: size %lu, page order %u, failed to allocate pages", > area->nr_pages * PAGE_SIZE, page_order); > goto fail; > } > > > and it fails. > > If the __GFP_NOFAIL is passed, the vm_area_alloc_pages() function switches > to allocate 0-order pages instead. I think the fix is to call the > kvmalloc_node() with __GFP_NOFAIL flag. __GFP_NOFAIL does not make sense here and we've tried hard not to used it anywhere because of the deadlocky effects. Did you mean __GFP_NOWARN? That's a patch I sent today but there's another comment in the bugzilla that we got more allocation warnings for huge (2M) allocations, this time it was for a deduplication ioctl. This seems to be a noticeable change in 6.3, before we disable the warning in our code I think the MM guys could have a look. So far it seems we're about to paper of a problem.