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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Mar 2011 23:57:06 -0400
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Alex Dubov <oakad@...oo.com>
Cc:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	akpm@...ux-foundation.org, maximlevitsky@...il.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] scatterlist: new helper functions

On Wed, 2011-03-16 at 20:46 -0700, Alex Dubov wrote:
> > 
> > Why?
> > 
> > Why can't the block layer split a request in the way the
> > driver wants
> > to do?
> > 
> > That is, why can't the driver tell the block layer how to
> > split a
> > request?
> 
> What is needed is the ability to get fixed sized (in bytes) blocks from 
> the block layer.
> 
> Last time I checked (it was a long time ago, admittedly) one could only
> ask for a fixed number of sg entries, without any control on how many
> bytes each sg entry references.
> 
> Is there a way to get data from the block layer in a fashion of:
> "Give me 16k/32k/whatever in one sg entry if request is equal or larger
> than this"?

Yes; we've always had it: it's blk_max_queue_hw_sectors().  No request
will go over that number times the sector size (of course, they may go
under).

> If my knowledge is correct, MTD currently addresses this issue by
> maintaining its own cache, which it uses to aggregate write requests until
> it can write a whole erase block. While this is ok with old media
> (legacy memory stick being an example of such), new flash chips can
> have multi-megabyte sized erase blocks and can benefit from operations
> (like copy and compare) directly on scatter list .

So this is where you want a minimum too.  What you likely want is to set
the logical block size to your erase block
(blk_queue_logical_block_size) and the physical block size to the actual
block size.  Then we'll try as hard as we can to send down blocks on an
erase boundary.  Of course, there are some that just won't fit (like fs
metadata) and you'll have to do a RMW for them.

James


--
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