From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 29 11:23:29 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6754E16A4CE for ; Fri, 29 Apr 2005 11:23:29 +0000 (GMT) Received: from dgap-gw.mipt.ru (dgap-gw.mipt.ru [194.85.81.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC0B943D49 for ; Fri, 29 Apr 2005 11:23:28 +0000 (GMT) (envelope-from nepal@nas.dgap.mipt.ru) Received: from localhost (unknown [127.0.0.1]) by dgap-gw.mipt.ru (Postfix) with ESMTP id D24CC608138E for ; Fri, 29 Apr 2005 11:23:26 +0000 (UTC) Received: from dgap-gw.mipt.ru ([127.0.0.1]) by localhost (dgap-gw.mipt.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25966-65 for ; Fri, 29 Apr 2005 15:23:18 +0400 (MSD) Received: from nas.dgap.mipt.ru (nas.dgap.mipt.ru [194.85.81.203]) by dgap-gw.mipt.ru (Postfix) with ESMTP id 3E6286186B84 for ; Fri, 29 Apr 2005 15:23:18 +0400 (MSD) Received: from nas.dgap.mipt.ru (localhost [127.0.0.1]) by nas.dgap.mipt.ru (8.12.9p2/8.12.9) with ESMTP id j3TBQZma063359 for ; Fri, 29 Apr 2005 15:26:35 +0400 (MSD) (envelope-from nepal@nas.dgap.mipt.ru) Received: (from nepal@localhost) by nas.dgap.mipt.ru (8.12.9p2/8.12.9/Submit) id j3TBQYuj063358 for freebsd-hackers@freebsd.org; Fri, 29 Apr 2005 15:26:34 +0400 (MSD) (envelope-from nepal) Date: Fri, 29 Apr 2005 15:26:34 +0400 From: "Andrew L. Neporada" To: freebsd-hackers@freebsd.org Message-ID: <20050429112634.GA63285@nas.dgap.mipt.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new-20030616-p8 (Gentoo) at dgap.mipt.ru X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=7.5 tests= X-Spam-Level: Subject: open("/dev/cuaaX") is slow X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2005 11:23:29 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, hackers! It seems that reopening /dev/cuaaX devices after close() takes exactly 3 seconds on FreeBSD 4.10 (sorry, I've no 5.x systems available at the moment). Here is output of attached program: open() time: 155 us open() time: 2995729 us open() time: 2999811 us open() time: 2999608 us open() time: 2999711 us open() time: 2999720 us open() time: 2999713 us open() time: 2999744 us open() time: 2999673 us open() time: 2999706 us Is this 3 second delay necessary? Can I get rid of it? Andrew. --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="siotest.c" #include #include #include int main(void) { int fd, i; long us; struct timeval tv1, tv2; for (i = 0; i < 10; i++) { gettimeofday(&tv1, NULL); fd = open("/dev/cuaa0", O_RDWR); gettimeofday(&tv2, NULL); us = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec); printf("open() time: %d us\n", us); if (fd == -1) { perror("open"); exit(1); } close(fd); } } --W/nzBZO5zC0uMSeA--