bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] address@hidden: Bug#214629: mailutils-imap4d: msync


From: Alain Magloire
Subject: Re: [bug-mailutils] address@hidden: 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?= <address@hidden>,
>       address@hidden
> From: =?iso-8859-1?q?Christian_H=E4ggstr=F6m?= <address@hidden>
> To: Debian Bug Tracking System <address@hidden>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]