linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4)
@ 2003-04-23 17:37 Bartlomiej Zolnierkiewicz
  2003-04-23 17:38 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (1/4) Bartlomiej Zolnierkiewicz
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-04-23 17:37 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andre Hedrick, Jens Axboe, linux-kernel


Hey,

Another bunch of patches:

(1) Enhance bio_(un)map_user() and add blk_rq_bio_prep().
(2) Pass bdev to IDE ioctl handlers.
(3) Add support for rq->bio based taskfile.
(4) Use direct-IO in ide_taskfile_ioctl() and in ide_cmd_ioctl().

[ more detailed changelogs inside patches ]

They are incremental to 2.5.67-ac1/2 and previously posted tf-ioctls patches,
you can find all patches at:
	http://home.elka.pw.edu.pl/~bzolnier/patches/2.5.67-ac2/


Now HDIO_DRIVE_TASKFILE and HDIO_DRIVE_CMD (taskfile version) ioctls
use direct-IO to user memory if it is possible (user memory buffer address
and transfer length must be both aligned to hardsector size = 512).

As a result ioctl generated IO request with aligned user buffer use
the same code path as fs generated IO request, which gives possibility
of testing IDE code used for fs-requests from user space.

These patches also make possible to use taskfile ioctl for up to 32 MB big
lba48 requests, since now we don't need to allocate kernel buffer for them.
[ There may be still some small glitches to fix. ]

Alignment of user buffer address is a limitation to removing code using
kernel buffer approach. If user buffer is not aligned it can can happen
that one hardware sector is mapped to diffirent bio-s.
[ However I have an idea how to deal with this issue. :-) ]


I have tested HDIO_DRIVE_TASKFILE ioctl after changes and both direct-IO
and normal transfers are working fine, here are results from DiskPerf:

# with direct-IO
./DiskPerf /dev/hda

Device: WDC WD800JB-00CRA1 Serial Number: WD-WMAxxxxxxxxx
LBA 0 DMA Read Test                      = 78.34 MB/Sec (3.19 Seconds)
Outer Diameter Sequential DMA Read Test  = 45.52 MB/Sec (5.49 Seconds)
Inner Diameter Sequential DMA Read Test  = 25.91 MB/Sec (9.65 Seconds)

# with kernel buffer
./DiskPerf /dev/hda

Device: WDC WD800JB-00CRA1 Serial Number: WD-WMAxxxxxxxxx
LBA 0 DMA Read Test                      = 69.81 MB/Sec (3.58 Seconds)
Outer Diameter Sequential DMA Read Test  = 44.83 MB/Sec (5.58 Seconds)
Inner Diameter Sequential DMA Read Test  = 25.94 MB/Sec (9.64 Seconds)


Example how to align user buffer for HDIO_DRIVE_TASKFILE and direct-IO:

with kernel buffer:
	ide_task_request_t reqtask;
	unsigned char task[sizeof(reqtask)+reqtask.out_size+reqtask.in_size];

	and &task were used as ioctl argument
direct-IO:
	#define HARDSECTOR_SIZE	512
	#define ALIGN(x,a)	(((x)+(a)-1)&~((a)-1))
	#define TASK_ALIGN(x)	(ALIGN((unsigned long)(x), HARDSECTOR_SIZE) \
				 +HARDSECTOR_SIZE-sizeof(ide_task_request_t))

	ide_task_request_t reqtask;
	unsigned char task[sizeof(reqtask)+reqtask.out_size+reqtask.in_size
			   +2*HARDSECTOR_SIZE];
	unsigned char *taskptr = (unsigned char *)TASK_ALIGN(task);

	and use taskptr as ioctl argument

	[ Yes, I know it is ugly ]

--
Bartlomiej Zolnierkiewicz



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2003-04-24 17:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 17:37 [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:38 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (1/4) Bartlomiej Zolnierkiewicz
2003-04-24  8:23   ` Jens Axboe
2003-04-24 14:46     ` Bartlomiej Zolnierkiewicz
2003-04-24 15:47     ` [PATCH] 2.5.68 fix mismatched access_ok() checks in sg_io() Bartlomiej Zolnierkiewicz
2003-04-24 17:31       ` Jens Axboe
2003-04-23 17:39 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (2/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:39 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (3/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:40 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (4/4) Bartlomiej Zolnierkiewicz
2003-04-24  7:56   ` Jens Axboe
2003-04-23 18:24 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) [resend] Bartlomiej Zolnierkiewicz
2003-04-23 22:35 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Andrew Morton
2003-04-23 22:09   ` Alan Cox
2003-04-23 22:58   ` Bartlomiej Zolnierkiewicz
2003-04-23 23:13   ` Andries Brouwer
2003-04-23 23:20     ` Andrew Morton
2003-04-24  0:02       ` Bartlomiej Zolnierkiewicz
2003-04-24  6:55         ` Jens Axboe
2003-04-24  2:27       ` Andre Hedrick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).