lkml.org 
[lkml]   [2008]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectToo many stupid questions about the block layer
Hello list,

This is pretty long -- I sure hope this is the right place to ask these :)

First of all, I have a board with a NAND flash device, to which I have
a 8k-wide PCI interface.
I've been wondering about these:

1. I would prefer if the block layer always passed me 8k long
segments, even though the hard sector size is 2k. I tried using
blk_queue_hardsect_size() and set it to 8k, but for some reason I get
a panic. Is it possible that hardsect cannot be larger than PAGE_SIZE
(makes some sense)? Or is it just a bug of mine?

2. (This is in case I can't have 8k-one-segment-bios/requests) I'm not
sure whether I should implement request_fn() or make_request_fn(),
since although the device is flash, there's sense in writing
consecutive sectors in one go - with each write of a block of sectors,
the devices erases a whole erase block, which is the size of many
sectors. More writes of consecutive sectors means we don't erase the
same erase block as much. Can I get the same "segment merging"
functionality from the block layer if I use make_request() instead of
request()?

3. I want to handle requests in a kernel thread, one by one. Ideally,
I would just pass the request to my kthread, and call blk_stop_queue
(since I can only handle one request at a time). In my kthread, I will
issue a DMA transfer for the request and in the end call
blk_end_request(), and the blk_start_queue(). But can the block layer
somehow add bio's to my request while the kthread runs? Is there a way
to lock the request (maybe blkdev_dequeue_request)? Am I even on the
right track?

Thanks for your time,
-- Roni Feldman


\
 
 \ /
  Last update: 2008-08-28 22:41    [W:0.912 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site