Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Dec 2011 12:53:25 -0600
From:      Alan Cox <alan.l.cox@gmail.com>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        Andrey Zonov <andrey@zonov.org>, freebsd-stable@freebsd.org
Subject:   Re: directory listing hangs in "ufs" state
Message-ID:  <CAJUyCcMm5bnFGFMsvp1ZyJ59K8VGEjFA=KYmLOUE7fbJurX=RQ@mail.gmail.com>
In-Reply-To: <20111214182252.GA5176@icarus.home.lan>
References:  <4EE7BF77.5000504@zonov.org> <20111213221501.GA85563@icarus.home.lan> <4EE8E6E3.7050202@zonov.org> <20111214182252.GA5176@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 14, 2011 at 12:22 PM, Jeremy Chadwick
<freebsd@jdc.parodius.com>wrote:

> On Wed, Dec 14, 2011 at 10:11:47PM +0400, Andrey Zonov wrote:
> > Hi Jeremy,
> >
> > This is not hardware problem, I've already checked that. I also ran
> > fsck today and got no errors.
> >
> > After some more exploration of how mongodb works, I found that then
> > listing hangs, one of mongodb thread is in "biowr" state for a long
> > time. It periodically calls msync(MS_SYNC) accordingly to ktrace
> > out.
> >
> > If I'll remove msync() calls from mongodb, how often data will be
> > sync by OS?
> >
> > --
> > Andrey Zonov
> >
> > On 14.12.2011 2:15, Jeremy Chadwick wrote:
> > >On Wed, Dec 14, 2011 at 01:11:19AM +0400, Andrey Zonov wrote:
> > >>
> > >>Have you any ideas what is going on? or how to catch the problem?
> > >
> > >Assuming this isn't a file on the root filesystem, try booting the
> > >machine in single-user mode and using "fsck -f" on the filesystem in
> > >question.
> > >
> > >Can you verify there's no problems with the disk this file lives on as
> > >well (smartctl -a /dev/disk)?  I'm doubting this is the problem, but
> > >thought I'd mention it.
>
> I have no real answer, I'm sorry.  msync(2) indicates it's effectively
> deprecated (see BUGS).  It looks like this is effectively a mmap-version
> of fsync(2).
>
>
Yikes, I just looked at this man page.  I'm afraid that the text in the
BUGS section is highly misleading.  The MS_INVALIDATE option should be
obsolete for the reason given there.  Under a strict reading of the
applicable standard, FreeBSD could implement this option as a NOP.
However, we treat it something like madvise(MADV_DONTNEED|FREE).  In
contrast, MS_SYNC is definitely not obsolete.

Alan

P.S. If someone wants to take a crack at fixing this man page, contact me
off list.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJUyCcMm5bnFGFMsvp1ZyJ59K8VGEjFA=KYmLOUE7fbJurX=RQ>