Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3902586imu; Mon, 10 Dec 2018 09:34:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/V0TqqMtmMNoPCbdH90XMWBSi3bWjzYG1ANQ5HW+6Ym5gdm5W5+yxzU6euyLXcW7TxItul7 X-Received: by 2002:a63:e40c:: with SMTP id a12mr11657996pgi.28.1544463270450; Mon, 10 Dec 2018 09:34:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544463270; cv=none; d=google.com; s=arc-20160816; b=ulXEECFpzfkJxB/b0cO4HHKZJqGLNu17CSlcmSx3seRHuz8eJE5A6E8knjEYGY9rON zEiGVYwm5ofBG1KmfqPtJl88gG+4QpsFXkyoSHvnz9EY5gb0ImPUSu7mT7tJKnRW5FAA RuasiJ4ZIUfzIGOTKY2tm4yvajE73grXX4CTEtir6lO6FV3IxqkPlyza4kN6Aca/7Xai 8ao9/4Y9MTTjOIMhLe2sn2Uq7fbF2GjCljS8bC9u2KuI4vTaMvEVKZZmTNLJA+NeG5fB 0W7dTZEBY1JXwhgw6Uk0ObbK2hPl8Lb/amK1G0/rSWT3zJkZsKfBlb7Sjekm3f+plFZp saAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=x/JBBDo5sPjXAxcwlSBWcL/J/58a10jVgtkZ0FWng78=; b=Vnev0uuNuXKwRKtqfdtNZu8rYRg8D/Vzp001srnfsJU4pZZRyLk53SL1FSr9mfuJ/v vY7oay9klOsUUiepZwreKZm1G1wR1Met8Tx2/LMZpX+Pl8iDKYxR+moxnmgiSASTPk7A mMb5ozBB0ugbBCv5dSHAV7YeSJK3zpCt4V2V4oBU6ftUT0O3IaIAvBHcPSxsJrd4PCj6 OKt/TSwhCwAP/RGiPwFPUwmk9WsU1GqfEM9BzZVMuThSV5FbTDVQcDIsrL8rUCk/uL3b wqqOJABykKQABDIdrTjYjEZTHL5lHHwIyXp8BIBsKEYZsubWxFNEWiNT5x/6kKaKdH00 47yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VinfOFxh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si10105311pgj.543.2018.12.10.09.34.15; Mon, 10 Dec 2018 09:34:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VinfOFxh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbeLJRcI (ORCPT + 99 others); Mon, 10 Dec 2018 12:32:08 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42595 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbeLJRcI (ORCPT ); Mon, 10 Dec 2018 12:32:08 -0500 Received: by mail-lj1-f194.google.com with SMTP id l15-v6so10378159lja.9 for ; Mon, 10 Dec 2018 09:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x/JBBDo5sPjXAxcwlSBWcL/J/58a10jVgtkZ0FWng78=; b=VinfOFxhF1tMpPR5v/jGPjR8NsOhAeK+tLGXwnOX3cLm9YQd0jOIyEzrkbwRAVhhj2 yGe67viBeDwIJEX7MQyX5T8B93Lp2eJyVHV4Zlm/j7ep2xHDMWg962BW3f1+SvBw6Db5 JH6Y4M95FnnrzhMqOigrSZy07l5z35GOhVRCw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x/JBBDo5sPjXAxcwlSBWcL/J/58a10jVgtkZ0FWng78=; b=JtFN3jiJ7ZCo+09iiDqnytnnBs7ET8pNDM7qxGQo+1hu6tIWQV/M53YZ8dpnerVnoG V0SK7zYmhnFqrC13MCiFYCzWQZIC5P7Y6CxtzRPImdW/wbFo6MoiWUBgdk/XAW95QqyG 4L9W+BduROLlQUjaK/C5KoJJI9p7JfFr/jD2oAGGjITc4uAlIjFn7GQSqWiv/g/5LaYj 888V1x9ftDidQyvEJpbyJOJEbvF/ywVUhfjdXfSYQ9auaCFf70IuHMiGvgbbnzM401Kl f3IVGCIf6Yifnd+iUvS5Ik0EHgey0cVZzOUis3T+40q3o58RAuJE6ZGy3Iyf6wjrpALm JEZw== X-Gm-Message-State: AA+aEWaPoTrynTkgw9XYq5LqIqSXOX/XVNZdaSpi2Fw5G0RGd+7ZXwoo fn8hYW+9eCKGXqbDz75HvLGLJjiE3I0= X-Received: by 2002:a2e:1551:: with SMTP id 17-v6mr7576947ljv.68.1544463125977; Mon, 10 Dec 2018 09:32:05 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id e14-v6sm2248785ljl.43.2018.12.10.09.32.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 09:32:04 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id l10so8612978lfh.9 for ; Mon, 10 Dec 2018 09:32:04 -0800 (PST) X-Received: by 2002:a19:4287:: with SMTP id p129mr7697075lfa.135.1544463123575; Mon, 10 Dec 2018 09:32:03 -0800 (PST) MIME-Version: 1.0 References: <20181030230624.61834-1-evgreen@chromium.org> <20181030230624.61834-3-evgreen@chromium.org> <20181128012624.GB11128@ming.t460p> <20181205011059.GA17845@ming.t460p> In-Reply-To: From: Evan Green Date: Mon, 10 Dec 2018 09:31:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] loop: Better discard support for block devices To: martin.petersen@oracle.com Cc: ming.lei@redhat.com, axboe@kernel.dk, Gwendal Grignou , asavery@chromium.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 5, 2018 at 7:15 PM Martin K. Petersen wrote: > > > Evan, > > > Ah, I see. But I think it's useful to reflect max_discard_sectors, > > max_write_zeroes_sectors, discard_granularity, and discard_alignment > > from the block device to the loop device. With the exception of > > discard_alignment, these parameters are visible via sysfs, > > discard_alignment is visible in sysfs, just not in the queue directory > since alignment can be different on a per-partition basis. So there is > one discard_alignment at the root of each /sys/block/foo directory and > one for each partition subdirectory. This mirrors the alignment_offset > variable which indicates a partitions alignment wrt. the underlying > physical block size. > > That said, there are not many devices that actually report a non-zero > discard alignment so it's not as useful as the device manufacturers > (that were looking for an implementation shortcut) envisioned. Ah ok, thanks. > > > I'm not totally sure about discard_alignment, that seems to be useful > > in cases of merging blk requests. So I can stop mirroring that one if > > it's harmful or not helpful. But unless it's a nak, I'd really love to > > keep most of the mirroring. In which case the bool doesn't do a whole > > lot of simplifying. > > I think it's fine to export these. The block device topology was > explicitly designed to be stackable like this. Yeah, it seemed to fall in pretty naturally, which is why I was hoping it might not be so controversial. Thanks Martin. -Evan