mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Frank Mayhar <fmayhar@google.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Theodore Tso <tytso@google.com>
Subject: Re: [PATCH] block:  Force sector and nr_sects to device alignment and granularity.
Date: Wed, 12 Mar 2014 15:33:58 -0400	[thread overview]
Message-ID: <x49wqfzyzx5.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1394649562.31499.202.camel@bobble.lax.corp.google.com> (Frank Mayhar's message of "Wed, 12 Mar 2014 11:39:22 -0700")

Frank Mayhar <fmayhar@google.com> writes:

> On Wed, 2014-03-12 at 14:20 -0400, Jeff Moyer wrote:
>> but you managed to read my mind well enough.  The question is how high
>> up the stack do you put the logic for this?  Is it worth it to duplicate
>> the checks in the OS that are already done on the device?  I don't
>> know.  Martin, do you have an opinion on this?
>
> Well, my opinion (and I suspect that Ted agrees with me to at least some
> extent) is that this is where it should be, i.e. in the block layer, in
> the place that already knows about and deals with alignment and
> granularity.  Sure, you could leave it to the device itself but it seems
> reasonable to take care of this here for two reasons:  First, doing this
> means that if a TRIM is issued it will be successful and the intent of

No, TRIM is advisory, even for well-formed TRIMs.  I guess you could
alter the definition of successful and have a correct statement there.

> the discard will be at least partly satisfied.  Second, we're already
> doing most of the computations and making decisions based on the
> alignment and granularity anyway, so the overhead is pretty negligible
> (and if the discard size goes to zero we short-circuit the process and
> never go to the device at all).

Sure, there's no sense getting information from the device and not using
it.  I guess you've talked me into it.

Cheers,
Jeff

  reply	other threads:[~2014-03-12 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 18:01 Frank Mayhar
2014-03-11 15:15 ` Jeff Moyer
2014-03-11 16:02   ` Frank Mayhar
2014-03-12 18:20     ` Jeff Moyer
2014-03-12 18:39       ` Frank Mayhar
2014-03-12 19:33         ` Jeff Moyer [this message]
2014-03-12 19:51           ` Frank Mayhar
2014-03-13  1:47       ` Martin K. Petersen
2014-03-14 17:17         ` Frank Mayhar
2014-03-14 20:26           ` Martin K. Petersen
2014-03-12 18:06 ` Frank Mayhar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x49wqfzyzx5.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=fmayhar@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tytso@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®