From owner-freebsd-current@FreeBSD.ORG Tue Jun 13 20:46:32 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7304E16A41B for ; Tue, 13 Jun 2006 20:46:32 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B04743D45 for ; Tue, 13 Jun 2006 20:46:31 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.6/8.13.6) with ESMTP id k5DKkHJn018596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Jun 2006 16:46:18 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from [172.21.130.86] (mx-broadway [38.98.68.18]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k5DKkBFc054664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Jun 2006 16:46:12 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: current@freebsd.org Date: Tue, 13 Jun 2006 16:46:06 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200606131646.06849.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV 0.88/1538/Tue Jun 13 16:17:56 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 X-Mailman-Approved-At: Tue, 13 Jun 2006 20:53:56 +0000 Cc: Subject: Writing via mmap seems suboptimal X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2006 20:46:32 -0000 Hello! My program mmaps its output and begins to (slowly) fill it up. I expected the kernel to flush the output at its leisure thus freeing me from trying to pick the best time to do so explicitly (impossible to do anyway). Unfortunately, it appears, the kernel is instead waiting for the available memory to fill up and then stalls my program for over a second, while it flushes the entire buffer. When this happens, systat -vm looks like: 10 users Load 0.85 1.18 1.21 13 чер 16:20 Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER Tot Share Tot Share Free in out in out Act 1871416 2256 9145304 41244 70380 count 79 All 1913812 2384 1493309k 56528 pages 1261 Interrupts Proc:r p d s w Csw Trp Sys Int Sof Flt cow 2593 total 1 8 90 4599 5 505 3049 2 262996 wire 1: atkb 1392396 act 6: fdc0 4.5%Sys 0.4%Intr 0.0%User 0.0%Nice 95.1%Idl 193448 inact 15: ata | | | | | | | | | | 67416 cache 17: fwo == 2964 free 20: nve daefr 21: ohc Namei Name-cache Dir-cache prcfr 22: ehc Calls hits % hits % react 505 25: em0 824 824 100 pdwak 88 29: amr zfod pdpgs 2000 cpu0: time Disks ad4 ad6 amrd0 ozfod intrn KB/t 0.00 0.00 128 %slo-z 221184 buf tps 0 0 50 493 tfree 808 dirtybuf MB/s 0.00 0.00 6.22 100000 desiredvnodes % busy 0 0 99 27349 numvnodes Any hope to see this improved? After mmap-ing the input I even use madvise to tell the kernel, that the memory will be accessed sequentionally, but it seems to ignore the hint... Thanks! -mi