[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60F6FAE47D1BCE4380CC06D18F49789B95301D66@NTXBOIMBX02.micron.com>
Date: Fri, 30 Jan 2015 17:43:04 +0000
From: "Andy Falanga (afalanga)" <afalanga@...ron.com>
To: Christoph Hellwig <hch@...radead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
Doug Gilbert <dgilbert@...erlog.com>
Subject: RE: block layer copying user io vectors
> > This function does something that seems rather strange. On line 859,
> > a for loop determines the number of pages needed for the copying of
> > the user data to kernel space. Then the memory is allocated (line
> > 886 bio_kmalloc()). Then, strangely, on line 895, there is this
> > conditional:
>
> This is because the function can also be used with preallocated pages,
> a feature only used by the sg and tape drivers.
>
> Make sure your user memory is 4k aligned, and you should be able to
> avoid the copy entirely (1).
Where is this 4k alignment being enforced? When sg_start_req calls to
blk_rq_map_user_iov, the only check for alignment is that the data buffers
are 4-byte aligned (q->dma_alignment == 3). I have verified that they are.
>
> (1) except that the sg driver disables the direct mapping of user pages
> when using readv/writev. I can't really see why and it should be
> fixable by just removign that condition from the if in
> sg_start_req.
I am investigating this now.
> Alternatively use the SG_IO ioctl directly on the disk device node,
> which neither has the read/writev limitation, nor does it use
> a fixed upper bound preallocated page pool.
Unfortunately, the write/read interface of sg is what I need to use for
asynchronous reasons.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists