Subject: mailutils-imap4d: msync forces disk spinup
Date: Tue, 07 Oct 2003 21:23:03 +0200
Package: mailutils-imap4d
Version: 20030902-1
Severity: minor
I'm using the noflushd utility to keep my computer quiet, by spinning
down the disks. However, each time someone checks their mail, the disk
is spinning up.
Other IMAP servers, for example uw-imapd, does not require the disk to
spin up.
I think the cause is the msync calls at mailbox/mapfile_stream.c,
this is a code snippet from function _mapfile_size:
if (mfs->ptr == MAP_FAILED)
return EINVAL;
if (mfs->ptr)
msync (mfs->ptr, mfs->size, MS_SYNC);
if (fstat(mfs->fd, &stbuf) != 0)
return errno;
if (mfs->size != (size_t)stbuf.st_size)
If it is requred to sync mmap'ed pages before fstat (the man pages do
not mention anything about this), then there must be some other way to
flush the pages, without disk access.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux saturn 2.4.20 #15 Sat May 3 05:08:04 CEST 2003 i586
Locale: LANG=C, LC_CTYPE=sv_SE
Versions of packages mailutils-imap4d depends on:
ii libc6 2.3.2-8 GNU C Library: Shared libraries an
ii libcomerr2 1.34+1.35-WIP-2003.08.21-3 The Common Error Description libra
ii libgcrypt1 1.1.12-4 LGPL Crypto library - runtime libr
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime
ii libgnutls7 0.8.9-2 GNU TLS library - runtime library
ii libgsasl1 0.0.6-1 GNU SASL library
ii libidn9 0.1.14-2 GNU libidn library, implementation
ii libkrb53 1.3-2 MIT Kerberos runtime libraries
ii libmailutils0 20030902-1 GNU Mail abstraction library
ii libmysqlclien 3.23.56-2 LGPL-licensed client library for M
ii libpam0g 0.76-14 Pluggable Authentication Modules l
ii libtasn1-0 0.1.2-1 Manage ASN.1 structures (runtime)
ii netbase 4.13 Basic TCP/IP networking system
ii zlib1g 1:1.1.4-15 compression library - runtime
-- no debconf information
Subject: Bug#214629: mailutils-imap4d: msync forces disk spinup
Date: Tue, 07 Oct 2003 21:23:03 +0200
Package: mailutils-imap4d
Version: 20030902-1
Severity: minor
I'm using the noflushd utility to keep my computer quiet, by spinning
down the disks. However, each time someone checks their mail, the disk
is spinning up.
Other IMAP servers, for example uw-imapd, does not require the disk to
spin up.
I think the cause is the msync calls at mailbox/mapfile_stream.c,
this is a code snippet from function _mapfile_size:
if (mfs->ptr == MAP_FAILED)
return EINVAL;
if (mfs->ptr)
msync (mfs->ptr, mfs->size, MS_SYNC);
if (fstat(mfs->fd, &stbuf) != 0)
return errno;
if (mfs->size != (size_t)stbuf.st_size)
If it is requred to sync mmap'ed pages before fstat (the man pages do
not mention anything about this), then there must be some other way to
flush the pages, without disk access.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux saturn 2.4.20 #15 Sat May 3 05:08:04 CEST 2003 i586
Locale: LANG=C, LC_CTYPE=sv_SE
Versions of packages mailutils-imap4d depends on:
ii libc6 2.3.2-8 GNU C Library: Shared libraries an
ii libcomerr2 1.34+1.35-WIP-2003.08.21-3 The Common Error Description libra
ii libgcrypt1 1.1.12-4 LGPL Crypto library - runtime libr
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime
ii libgnutls7 0.8.9-2 GNU TLS library - runtime library
ii libgsasl1 0.0.6-1 GNU SASL library
ii libidn9 0.1.14-2 GNU libidn library, implementation
ii libkrb53 1.3-2 MIT Kerberos runtime libraries
ii libmailutils0 20030902-1 GNU Mail abstraction library
ii libmysqlclien 3.23.56-2 LGPL-licensed client library for M
ii libpam0g 0.76-14 Pluggable Authentication Modules l
ii libtasn1-0 0.1.2-1 Manage ASN.1 structures (runtime)
ii netbase 4.13 Basic TCP/IP networking system
ii zlib1g 1:1.1.4-15 compression library - runtime
-- no debconf information
>
>
> --EeQfGwPcQSOJBaQU
> Content-Type: text/plain; charset=iso-8859-1
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> Hello,
>
> I got this bug report a few weeks ago. It's a weird wishlist for a mail
> server, but if it's doable to improve it, he'll be happier :)
>
> Jordi
> --=20
> Subject: Bug#214629: mailutils-imap4d: msync forces disk spinup
> Reply-To: =?iso-8859-1?q?Christian_H=E4ggstr=F6m?= <[email protected]>,
> [email protected]
> From: =?iso-8859-1?q?Christian_H=E4ggstr=F6m?= <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Date: Tue, 07 Oct 2003 21:23:03 +0200
>
> Package: mailutils-imap4d
> Version: 20030902-1
> Severity: minor
>
> I'm using the noflushd utility to keep my computer quiet, by spinning
> down the disks. However, each time someone checks their mail, the disk
> is spinning up.
> Other IMAP servers, for example uw-imapd, does not require the disk to
> spin up.
>
I do not quite understand, why other servers does not require the disk to spin,
since checking the mail require to **read** the maildrop, unless you mean
it is cache somehow ?
> I think the cause is the msync calls at mailbox/mapfile_stream.c,
> this is a code snippet from function _mapfile_size:
>
> if (mfs->ptr == MAP_FAILED)
> return EINVAL;
> if (mfs->ptr)
> msync (mfs->ptr, mfs->size, MS_SYNC);
> if (fstat(mfs->fd, &stbuf) != 0)
> return errno;
> if (mfs->size != (size_t)stbuf.st_size)
>
The MS_SYNC is needed so we are ... in synch 8-).
But if the file is open readonly ... it should not be necessary.
So yes, if to checking of emails is done with EXAMINE command
the mailbox should be open READ_ONLY so no need for MS_SYNC.
Ok, I'll take a look.
> If it is requred to sync mmap'ed pages before fstat (the man pages do
> not mention anything about this), then there must be some other way to
> flush the pages, without disk access.
It is not required, since the system should do a good enough job at it.
But since mail was consider important for example in the event of crashing etc ..
We had to make sure that we have an consisten underlying file, this can
be important before/after expunging ...
What suprise me is if the file was open RD_ONLY msync() should have been
a noop and not affect the file/disk.
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.