Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2517417lqo; Mon, 20 May 2024 08:12:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXr+vQ2+yPn/plggML9WppSXUPEiPBs2w4pS+qKefzn44eaCYgHTlncCjybyecO5xtgVeFuGwITXiIO9kTbZa8UW9gguLdabEECfmyBqw== X-Google-Smtp-Source: AGHT+IH5KGd/xygTJUF7qYCpFSS1/RAwh1YYLIJPXkmkfA9GvRx7q7vqUbQLv0jhYLu5UxplsvkD X-Received: by 2002:a17:90a:8a96:b0:2b2:c6f8:70b0 with SMTP id 98e67ed59e1d1-2b6cc357aefmr28253922a91.11.1716217923946; Mon, 20 May 2024 08:12:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716217923; cv=pass; d=google.com; s=arc-20160816; b=XqXJCR0BHYJ50K7XUoLInpFcisvkXx7DFNchEv4ZzJEl2glmMmcRLvQiIzqy3BjjKE m9LPUaP4MfxB1IBMroUYcz+HRumbZVFT1C4HandRO76GSIwJhueyzetx7zR7/aEnxwa2 u8RUPE7JSf8moExUqZ+Ae5HjG1lsah6f4T5yM7e0V67Nr7MrFWSvZMQFui0+Z1CW5dQZ albRa5IDKCRuehxOjbcLH+a0uqX/43i0BGpwlqor3mXaruLtz6OLvXOe++3QP0Hpt6Tw fVtVZocXpYFOTaCW0rz4L5CvEJY01I4lFw4YxJ7CzIQPVAvdRNAzCKEEnDPJ42RpD2/X 7MsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=TM0S9Lb1QQJ3aCqPbiNpNahwJyNZRNlSvZALjndN7+s=; fh=6bexhibVSN4FD6kTiU5+E6yJn8jXr9+XyU/NbYfk1s8=; b=LcNATVcuUIjTo532eo6D8w3BkP+5Li/HEilsovxMRz6xW6CBpVNLJGkR9Dms4K25fL jMCip0E2Yri/M4S7zExsT2bemyY51n27soAb0NAq6TFHRVKVjwc3Kos780XYxcDME0Hv wM8pEJ7wlSo21+Q3209y3etZ/bEF1Ijdt95MwwfquyJO6RoiEmHWD6k/Cr6F00LCICWH arIyv7oo2wc2ITjcHIE7CTsalG4MP/1usxK7pfYS8Acsf6MUipAW+pp4uaShqmQ0tROH qAqjFaie/oE2lV2npo5X7/e4O8TMqVO6o8UteiNSVQVWEsHx5wir6rwH1Cw1RTg2SoMj RvtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-ext4+bounces-2603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2603-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b671471c0csi456402a91.110.2024.05.20.08.12.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 08:12:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-ext4+bounces-2603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2603-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 18723B21CD7 for ; Mon, 20 May 2024 15:07:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B589136E10; Mon, 20 May 2024 15:07:06 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C49D74D9FE; Mon, 20 May 2024 15:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716217626; cv=none; b=AKev2y48uLW1ARfU6NwgZvPBubE1A28reExGwBpK26N4QmP3NoQZGpzr3G8iIQqpBI0biJSfMBWXn65Wa3AjwcRt5g0M5CRFItuu9id5LjWD5wf8v1Lm/Xp9hXtIRjoaU155LoHoT8BK4rBQetvHZXfWap2B/E374Kz9Oixpa4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716217626; c=relaxed/simple; bh=ZAmlkD2H/yb/d8FBbvu5IRs6uaEE11WCWhPfXq3NnuM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BdNOfiV76mn5Mpi6+ojdDraQgYrRve+bX5X/rv6uAURVCDsTDj2FcGR4VBR/KCVUh+ztV4iVs7TLbVpcaEI2Qa2jiZ/fuSoEwG4YyxdVi6XKAAVI2nERMXkmbSqLjTvgeo+msjsblAIiGsrg5DBPGj7np/rCLepovOyF+B7D96g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 1F90E68AFE; Mon, 20 May 2024 17:06:54 +0200 (CEST) Date: Mon, 20 May 2024 17:06:53 +0200 From: Christoph Hellwig To: Mike Snitzer Cc: Theodore Ts'o , dm-devel@lists.linux.dev, fstests@vger.kernel.org, linux-ext4@vger.kernel.org, regressions@lists.linux.dev, Christoph Hellwig , linux-block@vger.kernel.org Subject: Re: dm: use queue_limits_set Message-ID: <20240520150653.GA32461@lst.de> References: <20240518022646.GA450709@mit.edu> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Sun, May 19, 2024 at 01:42:00AM -0400, Mike Snitzer wrote: > > This being one potential fix from code inspection I've done to this > > point, please see if it resolves your fstests failures (but I haven't > > actually looked at those fstests yet _and_ I still need to review > > commits d690cb8ae14bd and 4f563a64732da further -- will do on Monday, > > sorry for the trouble): > > I looked early, this is needed (max_user_discard_sectors makes discard > limits stacking suck more than it already did -- imho 4f563a64732da is > worthy of revert. Can you explain why? This actually makes the original addition of the user-space controlled max discard limit work. No I'm a bit doubful that allowing this control was a good idea, but that ship unfortunately has sailed. Short of that, dm-cache-target.c and possibly other > DM targets will need fixes too -- I'll go over it all Monday): > > diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c > index 4793ad2aa1f7..c196f39579af 100644 > --- a/drivers/md/dm-thin.c > +++ b/drivers/md/dm-thin.c > @@ -4099,8 +4099,10 @@ static void pool_io_hints(struct dm_target *ti, struct queue_limits *limits) > > if (pt->adjusted_pf.discard_enabled) { > disable_discard_passdown_if_not_supported(pt); > - if (!pt->adjusted_pf.discard_passdown) > - limits->max_discard_sectors = 0; > + if (!pt->adjusted_pf.discard_passdown) { > + limits->max_hw_discard_sectors = 0; > + limits->max_user_discard_sectors = 0; > + } I think the main problem here is that dm targets adjust max_discard_sectors diretly instead of adjusting max_hw_discard_sectors. Im other words we need to switch all places dm targets set max_discard_sectors to use max_hw_discard_sectors instead. They should not touch max_user_discard_sectors ever. This is probably my fault, I actually found this right at the time of the original revert of switching dm to the limits API, and then let it slip as the patch was reverted. That fact that you readded the commit somehow went past my attention window.