Debian Bug report logs - #214629
mailutils-imap4d: msync forces disk spinup

version graph

Package: mailutils-imap4d; Maintainer for mailutils-imap4d is Jordi Mallach <[email protected]>; Source for mailutils-imap4d is src:mailutils (PTS, buildd, popcon).

Reported by: Christian Häggström <[email protected]>

Date: Tue, 7 Oct 2003 19:33:02 UTC

Severity: minor

Found in version 20030902-1

Forwarded to [email protected]

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Jordi Mallach <[email protected]>:
Bug#214629; Package mailutils-imap4d. (full text, mbox, link).


Acknowledgement sent to Christian Häggström <[email protected]>:
New Bug report received and forwarded. Copy sent to Jordi Mallach <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Christian Häggström <[email protected]>
To: Debian Bug Tracking System <[email protected]>
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




Reply sent to Jordi Mallach <[email protected]>:
You have marked Bug as forwarded. (full text, mbox, link).


Message #8 received at [email protected] (full text, mbox, reply):

From: Jordi Mallach <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [[email protected]: Bug#214629: mailutils-imap4d: msync forces disk spinup]
Date: Sat, 18 Oct 2003 23:01:56 +0200
[Message part 1 (text/plain, inline)]
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
-- 
Jordi Mallach Pérez  --  Debian developer     http://www.debian.org/
[email protected]     [email protected]     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/~jordi/
[Message part 2 (message/rfc822, inline)]
From: Christian Häggström <[email protected]>
To: Debian Bug Tracking System <[email protected]>
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


Message #9 received at [email protected] (full text, mbox, reply):

From: "Alain Magloire" <[email protected]>
To: [email protected] (Jordi Mallach)
Cc: [email protected], [email protected]
Subject: Re: [bug-mailutils] [[email protected]: Bug#214629: mailutils-imap4d: msync
Date: Mon, 27 Oct 2003 15:30:23 -0500 (EST)
> 
> 
> --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.




Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 14:54:33 2025; Machine Name: bembo

Debian Bug tracking system

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/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.