Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261507AbVCIB7r (ORCPT ); Tue, 8 Mar 2005 20:59:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262315AbVCIB5G (ORCPT ); Tue, 8 Mar 2005 20:57:06 -0500 Received: from fmr22.intel.com ([143.183.121.14]:47581 "EHLO scsfmr002.sc.intel.com") by vger.kernel.org with ESMTP id S262308AbVCIBxq (ORCPT ); Tue, 8 Mar 2005 20:53:46 -0500 Message-Id: <200503090153.j291rbg16445@unix-os.sc.intel.com> From: "Chen, Kenneth W" To: Cc: "'Andrew Morton'" , "'Jens Axboe'" Subject: RE: Direct io on block device has performance regression on 2.6.x kernel Date: Tue, 8 Mar 2005 17:53:36 -0800 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcUkSNzKYDObGXK9SD6A7gSOX+GhIwAAa6Tg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3124 Lines: 140 OK, last one in the series: user level test programs that stress the kernel I/O stack. Pretty dull stuff. - Ken diff -Nur zero/aio_null.c blknull_test/aio_null.c --- zero/aio_null.c 1969-12-31 16:00:00.000000000 -0800 +++ blknull_test/aio_null.c 2005-03-08 00:46:17.000000000 -0800 @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAXAIO 1024 + +char buf[4096] __attribute__((aligned(4096))); + +io_context_t io_ctx; +struct iocb iocbpool[MAXAIO]; +struct io_event ioevent[MAXAIO]; + +void aio_setup(int n) +{ + int res = io_queue_init(n, &io_ctx); + if (res != 0) { + printf("io_queue_setup(%d) returned %d (%s)\n", + n, res, strerror(-res)); + exit(0); + } +} + +main(int argc, char* argv[]) +{ + int fd, i, status, batch; + struct iocb* iocbbatch[MAXAIO]; + int devidx; + off_t offset; + unsigned long start, end; + + batch = argc < 2 ? 100: atoi(argv[1]); + if (batch >= MAXAIO) + batch = MAXAIO; + + aio_setup(MAXAIO); + fd = open("/dev/raw/raw1", O_RDONLY); + + if (fd == -1) { + perror("error opening\n"); + exit (0); + } + for (i=0; i +#include +#include +#include + +main(int argc, char* argv[]) +{ + int fd; + char *addr; + + fd = open("/dev/raw/raw1", O_RDONLY); + if (fd == -1) { + perror("error opening\n"); + exit(0); + } + + addr = memalign(4096, 4096); + if (addr == 0) { + printf("no memory\n"); + exit(0); + } + + while (1) { + pread(fd, addr, 4096, 0); + } + +} diff -Nur zero/makefile blknull_test/makefile --- zero/makefile 1969-12-31 16:00:00.000000000 -0800 +++ blknull_test/makefile 2005-03-08 17:10:39.000000000 -0800 @@ -0,0 +1,10 @@ +all: pread_null aio_null + +pread_null: pread_null.c + gcc -O3 -o $@ pread_null.c + +aio_null: aio_null.c + gcc -O3 -o $@ aio_null.c -laio + +clean: + rm -f pread_null aio_null - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/