Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1082115pxx; Tue, 27 Oct 2020 07:53:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyORNQMlHLhWcukQTT0lfhGecoWfd3e7HLO36BFvr15KliAhAaq5Mh8zWXIwL3E4cvkOu1B X-Received: by 2002:a50:ee95:: with SMTP id f21mr2621394edr.270.1603810415473; Tue, 27 Oct 2020 07:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603810415; cv=none; d=google.com; s=arc-20160816; b=OCtFOG2d1H3Cdikgy+hgmAMA5+QkC9zLp/XGXUJzx/Tq0BGmYJZIG8JKJKkPYlcVAS 2dT/6VnwlYaEcYMCBlFnmt+ZECt4XVteexzHhX3W7L8fCApKjkOYyJycEfApQPBupf7s iNrLlpCJFYubZjoEwOSfbqyvWLZBKrfMYGUFQNlSVZSjlQCO6eP2PtUW0+pH5tx0MrL9 JHY5PpvauA9RdRxPLJY0YDXFs45jhMxcI2X5WrxyLVQjxPJ/tzyEgm+f8rLIAeRznmvo ctW1uvz9pja5eGTRHysYy247nkPRIkUNtfP5YKc4fXIBoDpYIZJ7nA5NaJR73iWDVFb/ 31tw== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=Zrbs4feV+OXib8FNuFXZ5PG/XcfO+Cqus0Ov9BLA2gQ=; b=tn+abpz6ba2UFY0n5oLFOQJb0OKHmIyXakBkdpcnoiqPut27CaHMLZmgyllSd3MWf/ s7fS29lGTfVQjN2xkeAhuv5N9D3hBqcw5BswtEixfneCegz8YbGQ0TmzaMO7c4PQAwwn 1V/pAJEIKmnIIhySz0OEL2veGunNTdme0VcEemo59aa0glVod3Z6+QhWan/2/W4SNZk5 GNIeI+1vhRtZk6KB8/9KABIQRht9dFQrfmkCwpI/JdhGoxtlp5d3Lme89XLAp5yKxn2h jNzbTzeA3kG2mASr3hlmTKUxKbVbzN39ZqDFz25d/fiwDgT+7GcgEnXisjefcxKrGx1Y WIXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=en1UdeYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si1377833edf.56.2020.10.27.07.53.12; Tue, 27 Oct 2020 07:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=en1UdeYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbgJ0NUe (ORCPT + 99 others); Tue, 27 Oct 2020 09:20:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56901 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752042AbgJ0NUc (ORCPT ); Tue, 27 Oct 2020 09:20:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603804831; h=from:from:reply-to:subject:subject: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=Zrbs4feV+OXib8FNuFXZ5PG/XcfO+Cqus0Ov9BLA2gQ=; b=en1UdeYXYGJsRH/7qqw+HYMT0XVuLFBW955FDfN73Kpr4OjImjCYLQzrnSl9QLsSJNC+R0 CJDWOFszCsJY02WkjA2B6JpDl9BoCT5ldgtlAJONJinwi4Dy6xNiZ8emVa6d0oZgT5lQGL 0eQUt6fTmhF3oYfkWXYMPcV4694/Ucc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-b7rfsrgcNqqMnUuBXXqp3Q-1; Tue, 27 Oct 2020 09:20:29 -0400 X-MC-Unique: b7rfsrgcNqqMnUuBXXqp3Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9742A188C129; Tue, 27 Oct 2020 13:20:28 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56F045D9DD; Tue, 27 Oct 2020 13:20:25 +0000 (UTC) Date: Tue, 27 Oct 2020 08:19:59 -0400 From: Mike Snitzer To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, dm-devel@redhat.com Subject: Re: [PATCH AUTOSEL 5.9 089/147] dm: change max_io_len() to use blk_max_size_offset() Message-ID: <20201027121959.GA13012@redhat.com> References: <20201026234905.1022767-1-sashal@kernel.org> <20201026234905.1022767-89-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026234905.1022767-89-sashal@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26 2020 at 7:48pm -0400, Sasha Levin wrote: > From: Mike Snitzer > > [ Upstream commit 5091cdec56faeaefa79de4b6cb3c3c55e50d1ac3 ] > > Using blk_max_size_offset() enables DM core's splitting to impose > ti->max_io_len (via q->limits.chunk_sectors) and also fallback to > respecting q->limits.max_sectors if chunk_sectors isn't set. > > Signed-off-by: Mike Snitzer > Signed-off-by: Sasha Levin Not sure why this commit elevated to stable@ picking it up, please explain. But you cannot take this commit standalone. These commits are prereqs: 22ada802ede8 block: use lcm_not_zero() when stacking chunk_sectors 07d098e6bbad block: allow 'chunk_sectors' to be non-power-of-2 882ec4e609c1 dm table: stack 'chunk_sectors' limit to account for target-specific splitting This goes for all stable@ trees you AUTOSEL'd commit 5091cdec56f for. Mike > --- > drivers/md/dm.c | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) > > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 6ed05ca65a0f8..3982012b1309c 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1051,22 +1051,18 @@ static sector_t max_io_len_target_boundary(sector_t sector, struct dm_target *ti > static sector_t max_io_len(sector_t sector, struct dm_target *ti) > { > sector_t len = max_io_len_target_boundary(sector, ti); > - sector_t offset, max_len; > + sector_t max_len; > > /* > * Does the target need to split even further? > + * - q->limits.chunk_sectors reflects ti->max_io_len so > + * blk_max_size_offset() provides required splitting. > + * - blk_max_size_offset() also respects q->limits.max_sectors > */ > - if (ti->max_io_len) { > - offset = dm_target_offset(ti, sector); > - if (unlikely(ti->max_io_len & (ti->max_io_len - 1))) > - max_len = sector_div(offset, ti->max_io_len); > - else > - max_len = offset & (ti->max_io_len - 1); > - max_len = ti->max_io_len - max_len; > - > - if (len > max_len) > - len = max_len; > - } > + max_len = blk_max_size_offset(dm_table_get_md(ti->table)->queue, > + dm_target_offset(ti, sector)); > + if (len > max_len) > + len = max_len; > > return len; > } > -- > 2.25.1 >