On Thu, 2008-08-07 at 01:19 +0900, OGAWA Hirofumi wrote: > David Woodhouse <dwmw2@xxxxxxxxxxxxx> writes: > > > Some block devices benefit from a hint that they can forget the contents > > of certain sectors. Add basic support for this to the block core, along > > with a 'blkdev_issue_discard()' helper function which issues such > > requests. > > > > Although blkdev_issue_discard() can take an end_io function, it's > > acceptable to leave that as NULL and in that case the allocated bio will > > be automatically freed. Most of the time, it's expected that callers > > won't care about when, or even _if_, the request completes. It's only a > > hint to the device anyway. By definition, the file system doesn't _care_ > > about these sectors any more. > > Looks like good start. Thanks. Although I'm not quite sure it helps, is > there any plan to merge bios? Yes, it would be very good to merge bios. In fact, we can also allow the elevator to let discards cross reads and writes -- there's no _real_ need for them to be a soft barrier. And we can _drop_ a discard request if there's a later write to the same sectors. I was planning to do that work in the elevator later. Or preferably, leave it to someone more familiar with that code. > If fs merges contiguous blocks to one bio, bi_size will overflow. > Will we have to limit (of the device?) and separate for the device? Or just let the device deal with it in multiple requests if it needs to? I have no strong opinion. > Or how about to have #define for discard bio for BIO_RW_DISCARD users? Que? > The following seems good to convert to bio_dataless? Yes, that seems appropriate; thanks. _ -- dwmw2 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html