Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1286171 > unrolled thread

Re: [PATCH v4] block: create ioctl to discard-or-zeroout a range of blocks

Started byChristoph Hellwig <hch@infradead.org>
First post2015-12-08 03:50 +0100
Last post2015-12-08 06:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4] block: create ioctl to discard-or-zeroout a range of  blocks Christoph Hellwig <hch@infradead.org> - 2015-12-08 03:50 +0100
    Re: [PATCH v4] block: create ioctl to discard-or-zeroout a range of  blocks "Darrick J. Wong" <darrick.wong@oracle.com> - 2015-12-08 06:30 +0100

#1286171 — Re: [PATCH v4] block: create ioctl to discard-or-zeroout a range of blocks

FromChristoph Hellwig <hch@infradead.org>
Date2015-12-08 03:50 +0100
SubjectRe: [PATCH v4] block: create ioctl to discard-or-zeroout a range of blocks
Message-ID<qDgvL-4HK-3@gated-at.bofh.it>
On Fri, Nov 13, 2015 at 02:01:43PM -0800, Darrick J. Wong wrote:
> Create a new ioctl to expose the block layer's newfound ability to
> issue either a zeroing discard, a WRITE SAME with a zero page, or a
> regular write with the zero page.  This BLKZEROOUT2 ioctl takes
> {start, length, flags} as parameters.  So far, the only flag available
> is to enable the zeroing discard part -- without it, the call invokes
> the old BLKZEROOUT behavior.  start and length have the same meaning
> as in BLKZEROOUT.
> 
> Furthermore, because BLKZEROOUT2 issues commands directly to the
> storage device, we must invalidate the page cache (as a regular
> O_DIRECT write would do) to avoid returning stale cache contents at a
> later time.

So does BLKZEROOUT.  Seems like adding the cache invalidation should
be one patch and the ioctl another one.  Otherwise this looks fine
except that I kinda hate BLKZEROOUT2 name, but can't come up with
anything better.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1286246

From"Darrick J. Wong" <darrick.wong@oracle.com>
Date2015-12-08 06:30 +0100
Message-ID<qDj0C-6vF-9@gated-at.bofh.it>
In reply to#1286171
On Mon, Dec 07, 2015 at 06:40:15PM -0800, Christoph Hellwig wrote:
> On Fri, Nov 13, 2015 at 02:01:43PM -0800, Darrick J. Wong wrote:
> > Create a new ioctl to expose the block layer's newfound ability to
> > issue either a zeroing discard, a WRITE SAME with a zero page, or a
> > regular write with the zero page.  This BLKZEROOUT2 ioctl takes
> > {start, length, flags} as parameters.  So far, the only flag available
> > is to enable the zeroing discard part -- without it, the call invokes
> > the old BLKZEROOUT behavior.  start and length have the same meaning
> > as in BLKZEROOUT.
> > 
> > Furthermore, because BLKZEROOUT2 issues commands directly to the
> > storage device, we must invalidate the page cache (as a regular
> > O_DIRECT write would do) to avoid returning stale cache contents at a
> > later time.
> 
> So does BLKZEROOUT.  Seems like adding the cache invalidation should
> be one patch and the ioctl another one.  Otherwise this looks fine
> except that I kinda hate BLKZEROOUT2 name, but can't come up with
> anything better.

I should've sent the 4.4 version -- since the ioctl code was refactored into
separate functions and the new function modifies its arguments, I ended up
rewriting most of the function body just to set up the page cache invalidation.

(Ah, I see -- 4.4-rc1 came out and I forgot to resend.)

Blergh, v5 on its way...

--D

> --
> To unsubscribe from this list: send the line "unsubscribe linux-api" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web