Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2013 00:28:28 +0100
From:      RW <rwmaillists@googlemail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: MADV_FREE and wait4 EFAULT
Message-ID:  <20130417002828.2f5a0896@gumby.homeunix.com>
In-Reply-To: <CANVK_QgKRkpzWjA=H2u2HTp_vpxFhNLBGTVuFZmMEpBLTbzeaA@mail.gmail.com>
References:  <CANVK_QgKRkpzWjA=H2u2HTp_vpxFhNLBGTVuFZmMEpBLTbzeaA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Apr 2013 14:12:54 -0700
Carl Shapiro wrote:

> I am seeing wait4 system calls failing with an EFAULT and I am trying
> to understand what might be going wrong.
> 
> An inspection of the wait4 implementation suggests the  opportunity
> for EFAULT is within its invocations of copyout.  In my situation,
> the status and rusage pointer arguments contain addresses to mmaped
> pages which have been madvised as MADV_FREE.
> 
> Is it permissible to pass pages which have been madvised MADV_FREE to
> wait4 or any other system call for that matter?  Might there be
> another opportunity for a wait4 to EFAULT?


IIRC MADV_FREE  pages are marked clean and placed on the end of the
inactive queue as "low hanging fruit" for the page daemon. AFAIK they're
no different to any other clean page. Malloc'ed memory pages are
commonly in that state.   



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