Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp987961pxf; Thu, 25 Mar 2021 20:48:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYqI8dG8G+KQMxZynWROMF3wAofJspJeogL6F6c/Bw85+FjQaZ/JXRT1GX40IZrp716/RI X-Received: by 2002:a17:906:4e91:: with SMTP id v17mr13055358eju.331.1616730480027; Thu, 25 Mar 2021 20:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616730480; cv=none; d=google.com; s=arc-20160816; b=y2pMiuebpYIXn5HVYOT0CoCYevxKQEqWHqbTdN1bXohrySyj/dBAaqTZbGTIgopxEE 8IvvuIMu+xdKXcgcJjazZBcyhi0emK+XfdmpRU8fJOD4ar1Rm3TJuEsoMX90DukoryA0 toTELTLqFFW9OXpAWrGp9ESCoOPCYTXlhBF12AWzv7iZbltaYZYbqubadgs+yLo5inPj +jrisY575+ogrYUMCAGStr/0hAWA7NcSv0/h6lwlKzVE89/wJU09gHze47RWYP/Fpbqc oSXoQHdjWIKfLFXCX1EbB6vW2yGMF9eZ2VwPmfhWN+1JYXOu3WIQ88pBo72n/JGyA5Pg jBSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1TArOxHPj0bJACvUlOiR8PlgnUcYFgFhDZ1MX0k/594=; b=wVPdidtjS3/J7VPJzTz4G8Ym1E5QRsd/OpoVqyQkTK4g9kiDlbnFPS1zYkjWJHwA4l I1W7fRIOD+zJ92rW1g6+6K948Fi6nV4aurJEg2BMzvdzejipr8YLpwi32enbzDPlX/xK HgQoIb6cS5VA7V8thYdEyzc8Xk7c1NYwBXMQe2khaaHeh0D7G7Vs7PySs75bj3f4yc5b nXKlwg/66a8uIhrbW7bbMiMMrkThyVcKMnJCYhiKazye0J1Y6B9RZ3xD0PWRvVAFvdrE Qn2Mgkis9DsHp6Ii5Yq5u/6r7ynuC+jZvpeMMFotUEShxk40IXGDUJobUL5eWY0LhNaR noUg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si5419884edd.550.2021.03.25.20.47.36; Thu, 25 Mar 2021 20:48:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbhCZDqj (ORCPT + 99 others); Thu, 25 Mar 2021 23:46:39 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:33734 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbhCZDqX (ORCPT ); Thu, 25 Mar 2021 23:46:23 -0400 Received: by mail-pj1-f49.google.com with SMTP id lr1-20020a17090b4b81b02900ea0a3f38c1so4967864pjb.0; Thu, 25 Mar 2021 20:46:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1TArOxHPj0bJACvUlOiR8PlgnUcYFgFhDZ1MX0k/594=; b=TDQ6kTU1gfoisXrFt8qin4eh9VNJtolVs5BbeByCV+TFJ58CB2XMNbugiVK4fh7cEn rEvKM22zV9jXK8gSh0y6QJXDDOQPjG7zrzoU+W2Jk/vWGrYzVJATO9qF1A0f+Zk2Dn5x vfI+BfWI2hivDSMC+hDBbtx7uN5OoaFGW9ZbqKdNDSjkYBpe4otir0IAyeOH+uS7o+T2 bfafCkKOD2QsjWhhX3K5LHc2PDKlagXfZTUfZct3dRIOpFH5z4/KzrSLYWYFcdKnZRfC jVEzA5XPTd5nMoFqrnoxx3+KiUqlDmoyVdZJtw5QWh5qq3SeBuFenWcVAdx50sC3/328 E1kA== X-Gm-Message-State: AOAM531fsgC7uW0qAVJVGLyHqOZEQPmh1d3kT2rczKoMhSGjq8WE/rG3 t7WIFeefolcak7MRxSrVr2w3mIw9XcI= X-Received: by 2002:a17:902:ce88:b029:e6:3a3c:2f65 with SMTP id f8-20020a170902ce88b02900e63a3c2f65mr13255324plg.66.1616730383199; Thu, 25 Mar 2021 20:46:23 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:c5af:7b7c:edac:ee67? ([2601:647:4000:d7:c5af:7b7c:edac:ee67]) by smtp.gmail.com with ESMTPSA id x2sm7002459pgb.89.2021.03.25.20.46.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Mar 2021 20:46:22 -0700 (PDT) Subject: Re: [PATCH v2 0/8] ensure bios aren't split in middle of crypto data unit To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Eric Biggers References: <20210325212609.492188-1-satyat@google.com> From: Bart Van Assche Message-ID: <4694766c-8d95-1ad3-cb0c-d1ba8b7fe7ad@acm.org> Date: Thu, 25 Mar 2021 20:46:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/25/21 6:39 PM, Satya Tangirala wrote: > On Thu, Mar 25, 2021 at 02:51:31PM -0700, Bart Van Assche wrote: >> Are you sure that the block layer core splits bios at logical block >> boundaries? Commit 9cc5169cd478 ("block: Improve physical block >> alignment of split bios") should have changed the behavior from >> splitting at logical block boundaries into splitting at physical block >> boundaries. > > Ah, what I really meant with that sentence was "Currently, if a bio is > split, the size of the resulting bio is guaranteed to be aligned to a > the lbs. The endpoint of the bio might also be aligned to a physical > block boundary (which 9cc5169cd478 tries to achieve if possible), but > the bio's size (and hence also its endpoint since the start of the bio > is always lbs aligned) is *at least* lbs aligned". Does that sound > accurate? That sounds better to me :-) >> Without having looked at this patch series, can the same >> effect be achieved by reporting the crypto data unit size as the >> physical block size? > > That would've been awesome, but I don't think we can do that :( > 1) There isn't only one crypto data unit size. A device can support, > and upper layers are free to use, many different data unit sizes. > 2) IIUC 9cc5169cd478 (or more accurately get_max_io_size() since the > function has been changed slightly since your original patch) > doesn't align the size of the bio to the pbs - it only aligns the > endpoint of the bio to the pbs (and it may actually not even do > that if it turns out to not be possible). Is that right? If so, > that means that if the startpoint of the bio isn't pbs aligned, the > size of the bio won't be pbs aligned either. Hmm ... if the start of a bio is not aligned to the physical block size I don't think that the block layer can do anything about the start of the bio. Anyway, I have taken a quick look at this patch series and the patch series looks pretty clean to me. I will let Christoph review this patch series since he already reviewed the previous version of this series. Bart.