From: Christoph Hellwig <hch@infradead.org>
To: Alex Elder <aelder@sgi.com>
Cc: lczerner@redhat.com, xfs@oss.sgi.com
Subject: Re: xfs: add FITRIM support
Date: Tue, 28 Dec 2010 11:09:40 -0500 [thread overview]
Message-ID: <20101228160940.GA28295@infradead.org> (raw)
In-Reply-To: <1293054073.2408.374.camel@doink>
On Wed, Dec 22, 2010 at 03:41:13PM -0600, Alex Elder wrote:
> > + error = xfs_alloc_read_agf(mp, NULL, agno,
> > + XFS_ALLOC_FLAG_TRYLOCK, &agbp);
> > + if (error || !agbp) {
> > + if (error == EAGAIN)
> > + error = 0;
>
> EAGAIN is ignored because it's an advisory interface, right?
> How hard are we expected to try? What I really mean is,
> is the benefit of FITRIM enough that we should try again
> later when we can get a buffer or lock on it?
That was the idea when I wrote this code. But back then we called it
regularly from a kernel thread. For FITRIM it makes more sense to just
remove the trylock.
> I don't know where (or if) FITRIM is precisely documented.
> But I question whether truncating down the start offset is
> the correct thing to do. If the starting byte offset given
> were not block-aligned, it seems like you should not assume
> that the caller wanted the bytes below unmapped. (This is
> a broader question, not related directly to your change.)
>
> Similarly, on the length it is probably best to truncate
> it, because it avoids any bytes beyond the specified range
> getting unmapped. (I.e., in my mind what you did is the
> right way to do it.) But these interpretations are
> dependent on the specific interpretation of FITRIM...
Good question. Adding Lukas to the Cc. I tried to talk him into
writing a manpage to document the interface better, but that's only
been a few days before the holidays. This is something we should
documented. I don't quite understand the need for the range interface
anyway.
> You don't update range anywhere, so the copyout below
> is not really doing anything useful. However I think
> it should stay, and the number of bytes actually
> trimmed should be updated and returned to the user.
> That seems to be what ext4 does (the only reference
> I found at the moment for what FITRIM is supposed
> to return).
Yes, I guess I should update the range.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-12-28 16:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 11:23 xfs: add FITRIM support Christoph Hellwig
2010-12-22 21:41 ` Alex Elder
2010-12-28 16:09 ` Christoph Hellwig [this message]
2011-01-03 10:49 ` Lukas Czerner
2010-12-23 1:44 ` Dave Chinner
2010-12-30 11:41 ` Christoph Hellwig
2011-01-03 10:57 ` Lukas Czerner
2011-01-03 23:25 ` Dave Chinner
2011-01-05 10:21 ` Lukas Czerner
2011-01-05 22:07 ` Michael Monnerie
2011-01-05 22:50 ` Dave Chinner
2011-01-06 8:10 ` Michael Monnerie
2011-01-06 8:33 ` Lukas Czerner
2011-01-06 8:40 ` Lukas Czerner
2011-01-06 9:17 ` Dave Chinner
2011-01-06 16:50 ` Michael Monnerie
2011-01-06 18:10 ` Christoph Hellwig
2011-01-06 18:08 ` Christoph Hellwig
2011-01-06 18:06 ` Christoph Hellwig
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=20101228160940.GA28295@infradead.org \
--to=hch@infradead.org \
--cc=aelder@sgi.com \
--cc=lczerner@redhat.com \
--cc=xfs@oss.sgi.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