Design Question (b_end_io kernel_thread buffer_head queueing)
Hi,
The following logic in my private driver ( top of actual drivers in linux) hangs after some burst of IO's (e.g cvs co) on device registered by my private driver.Please correct me if any logic wrong. xxx_make_request() a. If my private pool of buf structure is empty, queue incoming buffer head in my private global strcture. b. else b1. clone incoming buffer_head tomy private buf structure from freelist. b2. private processing by changing b_rdev/b_end_io b3. submit request to lowlevel driver calling generic_make_request() PS: my private buf structure is exactly same as md driver's buf pool ( sorry, struct multipath_bh refer ~/drivers/md/multipath.c) xxx_end_request ( my b_end_io() function )a. call b_end_io on orignal buffer, b. check private global structure if queue of buffer_head"s exists. if YES , follow steps above i.e b1, b2, and wakeup a thread step b3, is done in seperate kernel_thread.( becoz generic_make_request should be called in process context , not in b_end_io context) c. if NO give back the private buf structure to freelist. TIA, Kotresh. |
All times are GMT -5. The time now is 10:07 AM. |