User: Password:
Subscribe / Log in / New account

Write same support

From:  "Martin K. Petersen" <>
Subject:  Write same support
Date:  Mon, 30 Jan 2012 19:31:27 -0500
Message-ID:  <>
Archive-link:  Article

Here's my stab at write same support.

I have mainly tested using blkdev_issue_zeroout which I have modified to
use write same if available. It will fall back to writing zeroes the
old-fashioned way if write same fails. I also wired up an ioctl so I
could trigger zeroout from userland.

I have gone back and forth over whether blkdev_issue_write_same() should
take a struct page or a virtual address. It's not such a big deal for
devices with a 512-byte logical block size. But for devices with 4K it's
more of an issue. Comments welcome.

The discovery heuristics is what stopped this patchkit in its tracks
last year. So I've spent the last few days testing with every exotic
(i.e. ancient) SCSI device I could find. I'm pretty happy with how it
works now but it would be great if more people would put it to the test.

I have a 'writesame' branch available at:


for those that want to try it out...

Martin K. Petersen	Oracle Linux Engineering
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to
More majordomo info at

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds