Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Feb 2002 17:15:08 -0800 (PST)
From:      Andrew Mobbs <andrewm@chiark.greenend.org.uk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/35195: msync performance on large files
Message-ID:  <200202220115.g1M1F8d90824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         35195
>Category:       kern
>Synopsis:       msync performance on large files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 21 17:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Mobbs
>Release:        4.5-RC
>Organization:
>Environment:
FreeBSD kadath.relativity.greenend.org.uk 4.5-RC FreeBSD 4.5-RC #1: Sat Jan 12 13:49:05 GMT 2002     root@kadath.relativity.greenend.org.uk:/usr/obj/usr/src/sys/011218kadath  i386

>Description:
I wrote a test application that reflects the I/O load of an application I have in mind. This mmaps a 1GB file, and does 100,000 operations to it, then msyncs. Each operation consists of a read/modify/write then a write to a random location of the file.

The test platform is an Athlon 1.3GHz, 512MB RAM, with the test file on a single ATA-66 hard disk. There is little else using the system during the test, and nothing using the disk the test file is on.

The application takes 529 seconds to complete its workload, with the disk at 100% busy, and I/O at 2.5 - 3MB.s. The application then calls msync, this takes a total of 2593 seconds to complete, with I/O at about .6 MB/s. During the initial phase, the RSS of the application grows to approximatly 300MB, during the final phase, the RSS slowly shrinks.

If I'm reading spec_fsync in spec_vnops.c correctly, on msync the kernel is walking the dirty buffer list by age, thus writing out about 300MB of blocks in a totally random order, in 8kB chunks.


>How-To-Repeat:
On a quiet system with plenty of spare memory, on a filesystem with at least 1GB free run:
http://www.chiark.greenend.org.uk/~andrewm/mmt.c

The test will take slightly less than 1 hour to complete on an equivalent system to the above mentioned.
>Fix:
spec_vnops.c:spec_fsync() could benefit from a scatter-gather algorithm to collate blocks and perform I/O in an efficient order. This could provide a significant speed-up to this test.

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202220115.g1M1F8d90824>