lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 May 2010 12:44:24 -0700
From:	Jiaying Zhang <jiayingz@...gle.com>
To:	"Martin K. Petersen" <martin.petersen@...cle.com>
Cc:	hch@...radead.org, jens.axboe@...cle.com,
	linux-kernel@...r.kernel.org, mrubin@...gle.com
Subject: Re: [PATCH, RFC] addjust discard request to be aligned with hwsect 
	size to support SSDs with larger sector size

On Mon, May 17, 2010 at 11:57 AM, Martin K. Petersen
<martin.petersen@...cle.com> wrote:
>>>>>> "Jiaying" == Jiaying Zhang <jiayingz@...gle.com> writes:
>
Thanks a lot for the comments!

> Jiaying,
>
> Jiaying> The currect blkdev_issue_discard() function assumes 512 sector
> Jiaying> size.
>
> All of the block layer works on 512-byte sector units.  We don't
> generally convert to logical blocks until we're in the disk driver.
>
It is true that all of the block layer works on 512-byte sector size, but
I think it is good to check for address alignment for discard request so
we don't insert unnecessary discard requests into the request queue.
There are also certain disk drivers that assume a discard request
passed from the block layer is already properly aligned. We could
argue that those disk drivers need to fix that but I think it is better
that the block layer takes care of the address alignment so individual
disk drivers don't need to check that on their own.

>
> Jiaying> We have seen some problem when using discard on a SSD that has
> Jiaying> larger sector size. The following patch adjusts the starting
> Jiaying> address and size of a discard request to be aligned with hwsect
> Jiaying> size.
>
> Jiaying> + int hwsect_shift =
> Jiaying>        blksize_bits(bdev_logical_block_size(bdev)) - 9;
>
> Let's stop using the term hardware sector size.  It's an anachronism.
Ok. I will change those terms.

>
> I guess I could understand if you aligned to the physical block size.
> But the logical doesn't make much sense to me.
>
Physical block size seems better. I will change to use that.

> What is your logical block size?  Right now we only handle 512 bytes and
> 4KB in the discard path.
>
512 bytes and 4KB seem to be the most common sizes but I wouldn't be
surprised to see other logical block size.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ