From: Ian Campbell Subject: Re: [PATCH RFC 04/23] libxc: add support for FreeBSD Date: Thu, 17 Apr 2014 17:39:10 +0100 Message-ID: <1397752750.24638.318.camel@kazak.uk.xensource.com> References: <1397657612-57277-1-git-send-email-roger.pau@citrix.com> <1397657612-57277-5-git-send-email-roger.pau@citrix.com> <21328.444.482919.479163@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WapLc-0001KF-MZ for xen-devel@lists.xenproject.org; Thu, 17 Apr 2014 16:39:36 +0000 In-Reply-To: <21328.444.482919.479163@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org, Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On Thu, 2014-04-17 at 17:30 +0100, Ian Jackson wrote: > > + /* Discard from the buffer cache. */ > > + if ( posix_fadvise(fd, 0, cur, POSIX_FADV_DONTNEED) < 0 ) > > + goto out; > > Which also means that the use of posix_fadvise is hardly safe. > fadvise can quite legally be a noop. I think that's ok, it's for "reducing the impact on dom0" not correctness, according to the commit which added it: commit e0b421d24279d3cce426c0df4bf6d8734c6ce325 Author: Keir Fraser Date: Sat Feb 24 14:48:17 2007 +0000 Reduce impact of saving/restoring/dumping large domains on Dom0 memory usage by means of fadvise64() to tell the OS to discard the cache pages used for the save/dump file. Signed-off-by: Simon Graham (I presume fadvise implemented as a nop should still return success) Ian.