[stgt] stgt basic kernel interface questions

Joe Eykholt jeykholt at cisco.com
Fri Jul 9 18:39:24 CEST 2010



On 7/8/10 10:58 PM, FUJITA Tomonori wrote:
> On Thu, 08 Jul 2010 22:48:13 -0700
> Joe Eykholt<jeykholt at cisco.com>  wrote:
>
>>> When scsi_tgt_cmd_done calls scsi_unmap_user_pages (via queue_work),
>>> we start to commit dirty pages to disk; __bio_unmap_user set pages
>>> dirty. When the dirty bit of all the pages is cleared, the data is
>>> committed safely. LLDs could check it, I think. If the write cache of
>>> backing store is enabled, we more tricks though.
>>
>> Would that work for all backing store alternatives or just the
>> default of writing to a file via mmap?
>
> Tgt kernel drivers can support only I/O via mmap. Otherwise, we need
> to copy data between user and kernel space.

Oh, that's good.  I didn't understand that, obviously.  Maybe the LLD just
needs to do a page flush or something (I would guess that's an available
API) before sending the response.  I'll look into this, but if anyone knows
how to do it, I'd be grateful for the pointer.

Does this mean the mapping must be directly to the device (such as a mapped
block driver or a file) and not to some intermediate file?  I suppose so.

> We could add an explicit message but we should try hard to avoid it. I
> really want to investigate this before adding another message.

That makes complete sense.

	Thanks,
	Joe
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list