public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Aboo Valappil <aboo@aboo.org>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	dougg@torque.net, linux-scsi@vger.kernel.org
Subject: Linux Virtual SCSI HBAs and Virtual disks
Date: Fri, 26 Jan 2007 09:02:54 +1100	[thread overview]
Message-ID: <45B9290E.7020801@aboo.org> (raw)
In-Reply-To: <45B64465.7000507@s5r6.in-berlin.de>

Hi All,

Thanks for all your encouragement and help on this project. I like to 
take this project one step ahead. I hope you can help me on this.

As you may have noticed, I am doing a copy of buffers ( request_buffer) 
between user space and kernel space. What are my options these days to 
make a user buffer access inside the kernel space and vice versa? Please 
also not that request_buffer is not a linear buffer it is  a sg :)

One option I researched was mmap. I am facing an issue here. I will try 
to explain. Everything seems to be working, but a big page table 
manipulation issue is found.

When a SCSI read comes in for a device (For eg: dd if=/dev/sda 
of=/dev/null count=1). A read is always accompanied by a write (I do not 
do this, but the kernel does it!).

I think the pages of "request_buffer" will get mapped to virtual memory  
of "dd" process.When I memmap request_buffer (Through mmap_nopage 
method) to "user space SCSI target", the same page of "dd" process gets 
mapped to "user space SCSI target". Since the operation is a read, the 
"user space target" modifies the page making it dirty as far as "page 
cache" is concerned. Of course, "dd" gets what it wants from read. But 
as soon as "dd" closes "/dev/sda", page cache knows that one of the page 
belong to "/dev/sda" is dirty and needs to be flushed to disk!. Now, the 
page cache issues a SCSI write for the same page through the SCSI 
driver. This makes all the SCSI reads accompanied by a SCSI write.

This is the most closest explanation i can come up with for the 
behaviour. If this explanation is correct or not, it is happening (A 
SCSI read following by a SCSI write).

If this has to work properly, I need to find a way of "memmap/user space 
target" to modify the pages silently without letting the page cache know 
about it. There could be some ugly page table manipulation. But I am 
wondering if this can be achieve easily or through some other way. One 
of my friend also told me about the splice option.... Any thoughts on this?

Aboo




  parent reply	other threads:[~2007-01-25 22:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 10:22 Linux Virtual SCSI HBAs and Virtual disks Aboo Valappil
2007-01-16 21:52 ` Erik Mouw
2007-01-16 23:01   ` aboo
2007-01-17  1:50 ` Douglas Gilbert
2007-01-17  8:36   ` Stefan Richter
2007-01-17 10:24     ` Aboo Valappil
2007-01-17 22:20       ` Douglas Gilbert
2007-01-17 21:59         ` aboo
2007-01-18  0:38           ` Stefan Richter
2007-01-21  9:48         ` Aboo Valappil
2007-01-21  9:53           ` Aboo Valappil
2007-01-21 11:24             ` Stefan Richter
2007-01-22  0:43               ` aboo
2007-01-22  2:23                 ` aboo
2007-01-22 16:47                   ` Stefan Richter
2007-01-22 16:58                     ` Stefan Richter
2007-01-22 18:07                     ` James Bottomley
2007-01-23 13:11                     ` Aboo Valappil
2007-01-23 16:36                       ` Randy Dunlap
2007-01-23 17:22                         ` Stefan Richter
2007-01-24  9:47                           ` Aboo Valappil
2007-01-25 22:02                           ` Aboo Valappil [this message]
2007-01-23 17:16                       ` Stefan Richter
2007-01-23 22:12                         ` Aboo Valappil
2007-01-24  0:09                           ` Stefan Richter
2007-01-24  3:24                       ` Douglas Gilbert
2007-01-24  9:40                         ` Aboo Valappil
2007-01-25 21:41                         ` Aboo Valappil
2007-01-25 22:01                           ` Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B9290E.7020801@aboo.org \
    --to=aboo@aboo.org \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=stefanr@s5r6.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox