Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 02:02:51 -0500
From:      Alan Cox <alan.l.cox@gmail.com>
To:        Pieter de Goeje <pieter@degoeje.nl>, Konstantin Belousov <kostikbel@gmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: mmap MAP_NOSYNC regression in 10.x
Message-ID:  <CAJUyCcNiLwLuL9crpQBjSdg4ED5kR53fPjyJG3HNmP5Roor8RQ@mail.gmail.com>
In-Reply-To: <540903FF.6010602@degoeje.nl>
References:  <540903FF.6010602@degoeje.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 4, 2014 at 7:29 PM, Pieter de Goeje <pieter@degoeje.nl> wrote:

> After upgrading my month old 10-stable installation today (to r271093) ,
> I've noticed a that the kernel no longer honors the MAP_NOSYNC flag.
> Attached is a demonstration program that highlights the issue (also
> available here: http://pastebin.com/y0kvdn0r ).
>
> The program creates and mmap()s a 200MiB file and repeatedly writes zeros
> to it. The expected behavior is that under normal circumstances (no memory
> pressure), the dirtied pages are not flushed to disk. Observed is however
> that every ~30 seconds the syncer kicks in and basically halts the program
> while it does its job. The program prints a line everytime the throughput
> drops below 500MBps, well below memory bandwidth.
>
> mmap() is called like this:
>
>   void *p = mmap(NULL, len, PROT_READ | PROT_WRITE,
>      MAP_SHARED | MAP_NOSYNC | MAP_ALIGNED_SUPER, fd, 0);
>
> Sample output:
>
> write...
> zeroing: 209.6 MB
>  ...write: 5.839s
> mmap...
>  ...mmap: 0.000s
> 20.1s: memset #259: 34.7MBps - stalled
> 55.7s: memset #810: 34.7MBps - stalled
> 91.3s: memset #1359: 34.6MBps - stalled
> 100.0s: memset #1522: 3938.5MBps
> overall bandwidth: 3190.6MBps
> munmap...
>  ...munmap: 5.796s
> done
>
> (this is a rather old system)
>
> If necessary I'm willing to find out the exact commit that caused the
> problem.
>
>

That's not necessary.  This is a bug in the page fault handler's new fast
path.
<http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>;



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