Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5779841rwe; Tue, 18 Apr 2023 11:21:18 -0700 (PDT) X-Google-Smtp-Source: AKy350b4LZ7toiDUbKxcwrnCdrg7Cd00qLuMOYT8RJPHIL9HanI6j7EQx0H+LtcRdTMJfDPhMoIv X-Received: by 2002:a17:902:f213:b0:1a6:b763:3126 with SMTP id m19-20020a170902f21300b001a6b7633126mr2334815plc.62.1681842078666; Tue, 18 Apr 2023 11:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681842078; cv=none; d=google.com; s=arc-20160816; b=IrQ75gGIwolHHV7DEH9X7lvU5WtpjJYtZ2fn8VXnVDbqmXr0r8Rx8kPC4T+8NUVfWo 3LEvr+Y7fiPvX5Ld6Vn5uMFW+BrR880eNVTSFYLIPXElKkPqvOoxaE6S6vHKkqUh3nEk Efj3Pejix7t6mb0kjLz/67xXWmTkfKIhdYgXXDlasbuUDCe3VF3khzVaDo9GG0YD/GYb 5lbPv8ExnEWHUyxaI5ZucZq60P9l/VYIYc4UifkErd4TpA05aGSYLafCPUfLLv6paXWd 8Z0ayvkX9MOVW84XEmaUYpZncCCawafQeizqZ+7vy8se+7do4YzjLXJnC5Euxl909NHQ CZkw== 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-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=qi1TBo+SLJXa7yGshskQpukN+VXKieY/b9qu71iGCwY=; b=UcvwccOQBVHPhj4cAgUylhMO2vy6REuVp8vW/EFIf9yq/+UuSNn/5PIkbW0c23bva/ TcbIhmesPqUUazM2lEwD0h9Ll2E6+Pj8yCnCpgBZ6id/JaTZxzvsvKpHja+gkcHfn29F lAlWBYBYn8T+3+ylFEXJ2QhyuZdtDPrrn/wf+9ZisGfYo2g0r3sL9lhkRe9S4Mjj0DaH hdlYvz6WMPeiG4Psf959DR0ftPPw9j1aSEEQC86S5JxrDwhGN0NIbkfMXr1Z0kE9G9wD OGghW10WXpJIHkN+bnKhMtpOPLQp22qV8/R7pz0iEe9l/RZAtO/ugDrAlixV5NX1YtvA j0rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hyGS5hu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="bL/xfliU"; 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 n15-20020a170902d2cf00b0019fe9a63cf2si15296263plc.609.2023.04.18.11.21.04; Tue, 18 Apr 2023 11:21:18 -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=hyGS5hu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="bL/xfliU"; 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 S232615AbjDRSUw (ORCPT + 99 others); Tue, 18 Apr 2023 14:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbjDRSUv (ORCPT ); Tue, 18 Apr 2023 14:20:51 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27252B46A for ; Tue, 18 Apr 2023 11:20:48 -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 B16FA1FD66; Tue, 18 Apr 2023 18:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1681842046; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qi1TBo+SLJXa7yGshskQpukN+VXKieY/b9qu71iGCwY=; b=hyGS5hu5U1VVKKe6GQtxxHu+7a1xnQiPFeWKNPa0h9hVDI02F3uDp1mHuepnsXVKmPdkW0 5I6hfXTrfYxCZb0nvfAGXLq3VfcuG11EjqUHWouvOf6FKF51CT4gxYTRCKzg2lzG7WDu99 RY+9zcLU2wn4uMyTn/vX4G0FDUUCEpY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1681842046; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qi1TBo+SLJXa7yGshskQpukN+VXKieY/b9qu71iGCwY=; b=bL/xfliUBNa9Do8isD978jjg6+9tt+sz8vvpbsD4SXV7bP2lhqyc52s+svkQdIlwX8Zz0e vSitjE+RkigATNDQ== 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 6F53213581; Tue, 18 Apr 2023 18:20:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id T50PGn7fPmSFXQAAMHmgww (envelope-from ); Tue, 18 Apr 2023 18:20:46 +0000 Date: Tue, 18 Apr 2023 20:20:37 +0200 From: David Sterba To: Linus Torvalds Cc: "Regzbot (on behalf of Thorsten Leemhuis)" , Rafael Wysocki , David Sterba , LKML , Linux regressions mailing list Subject: Re: Linux regressions report for mainline [2023-04-16] Message-ID: <20230418182036.GS19619@suse.cz> Reply-To: dsterba@suse.cz References: <168166781352.1843526.278570500979918184@leemhuis.info> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) 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 Sun, Apr 16, 2023 at 01:48:52PM -0700, Linus Torvalds wrote: > On Sun, Apr 16, 2023 at 10:59 AM Regzbot (on behalf of Thorsten > Leemhuis) wrote: > > Another issue from the 6.2 days still not fixed are a huge number of > > DISCARD request on NVME devices with Btrfs caused by 63a7cb13071 > > ("btrfs: auto enable discard=async when possible") [1, 2]. > > Yeah, automatic discard is a broken idea, and that should just be reverted. > > The number of devices that have *horrible* problems with discard is > too high for any kind of "do discard by default" logic. > > David, please don't do that. Just because discard happens to work well > on some disk, *you* care about, does not in any way mean that "do > discard by default" is sane. > > Discard needs to be opt-in. Not out-opt. What we've enabled is the async mode that waits and batches the ranges to trim so it's in big chunks and it does not hammer the device with short discard requests among other IO. The problems reported is due to the throttling logic that was too slow to keep up after large freed data. We have fixes for that. There's also in-memory cache of already trimmed ranges since last mount so even running discard repeatedly (either fstrim or as mount option) will not do extra IO. We try hard not to provoke the firmware bugs. The request to make it default came from Fedora guys, we're not pushing defaults just because it works on somebody's newest hardware. Feature introduced in 5.6, enabled in 6.2 provides time to let people test it and report bugs. Of course we can't cover all different types of hardware so changing defaults for everyone comes with a risk. I've scanned IRC logs for feedback related to the discard=async, the community there tends to be from the more technical users that do try new things and report back. This is usually a good sample. - https://pagure.io/fedora-btrfs/project/issue/6 - https://lore.kernel.org/linux-btrfs/CAEg-Je_b1YtdsCR0zS5XZ_SbvJgN70ezwvRwLiCZgDGLbeMB=w@mail.gmail.com/t/#u Opt-in yes ideally with information available at least to end users about which devices are safe and which to avoid. This is sadly nonexistent, we get only broad claims that "don't do that on old device", vaguely mentioning some vendors and not on record for legal reasons. There are posts on some forums about bad vendor/model or if it's really bad then it hits the news sites as well. - https://www.truenas.com/community/threads/ssd-install-failures-possible-trim-issue.56162/ > The number of devices that have horrible problems with discard is too > high for any kind of “do discard by default” logic. As you state it, I would be concerned about enabling discard on any device and not even the widely configured weekly fstrim jobs. If the number of the affected devices is too high, please show me where is the evidence for that. I've been searching web for that now and back then, the mailing list archives, the in-tree quirk tables. The MMC has a specific quirk MMC_QUIRK_TRIM_BROKEN, some SATA devices used to require ncq=1 set which in turn made it to the quirk tables, NVMe has an impressive list of quirks but not related to discard. I'm genuinely interested, this can only improve the shared knowledge. I hope we won't end up reverting it just "because Linus said so".