From owner-freebsd-questions@freebsd.org Fri Nov 25 17:43:55 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9FB6C54AF5 for ; Fri, 25 Nov 2016 17:43:55 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9247FD54 for ; Fri, 25 Nov 2016 17:43:55 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by mail-io0-x242.google.com with SMTP id j92so10749808ioi.0 for ; Fri, 25 Nov 2016 09:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=pWCxU71neNyJA42bO0YOAvZd+g/AqhdbHYCrLa+titI=; b=U2SjvmJDR+BPVUOw3YmMpGGLZsZcFcQido1pbT6+A+XmzseMb0cMA0btCbaWUbVRkT eC+8Rao2y9U+b9NMS1CouYEeLVMG5KxLmiGz95lhDYwXQnraPWiuB4xYaiXFy47szV8g SNw2H+0bNsN9Hyi7QrJSONi125fXKAhnUoNRWsilXbr7Sq8B7+M0wBHEFnMADtWTZ+nD QEmxfDCuoaN9POPvga8Lxp5fRUKn7DsnpeghTG1k0+FHb3EUC/WLOTz1YW9u33Wgg6S8 moIovrNWRhTK9xsCdRKYwLT0fF7n8LU3TxCj3DUMSvT2jzCQDAy/21ZyxiTwpfOuVy02 p0Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=pWCxU71neNyJA42bO0YOAvZd+g/AqhdbHYCrLa+titI=; b=cDWywNMtg3OvwmRDEtjKY6es+wM5lmZ0Btd6YzHaEVbadUfNPBcFFhcul1tn7H1ESf mST5IpFU3IJzpu/plIbCuZ9cBXr5sQDtlyAr2ItUm3krrCH4JDK8Q3JTxKwVSEK/sVY4 veKsBrlxhQAAy+d0uB6XXVGRx2p4zrj5l1p6tJBle22Gk+ps/AADZ5NdXB0rOPnqwOSM 96Q6U2EAvNyasF+hNGTJKzNPMgZ8iUlLxDJXu6BWatnv2EZBPIT4M821WJYojsoLn7h4 RrpCv/UWDIORAYw2rJodqfxFNS1XPNsIgq0nUVqybDXTi3YAQtG+OGE1BbjPRUZsr5oR wgrQ== X-Gm-Message-State: AKaTC01uMMM18D1O9uAVWctxTin5pXuxk31W2QQskVZ5+qH4nkAVTmKQK7CUHfNwB6R4LQ== X-Received: by 10.107.1.138 with SMTP id 132mr8158951iob.72.1480095834737; Fri, 25 Nov 2016 09:43:54 -0800 (PST) Received: from localhost.localdomain (50-243-4-3-static.hfc.comcastbusiness.net. [50.243.4.3]) by smtp.googlemail.com with ESMTPSA id m83sm4711549itd.16.2016.11.25.09.43.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 09:43:54 -0800 (PST) Subject: Re: Memory Barrier To: freebsd-questions@freebsd.org References: <4806733.Z4QWb7OVgq@dragon.local> From: jd1008 Message-ID: <5838785B.7080607@gmail.com> Date: Fri, 25 Nov 2016 10:43:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <4806733.Z4QWb7OVgq@dragon.local> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 17:43:55 -0000 I "used" to use the madvise(2) syscall. I am not sure if it still works or even available. On 11/25/2016 08:25 AM, David Naylor wrote: > Hi > > Is there anyway to implement a memory barrier in FreeBSD without using > mprotect(2) [1]. Unfortunately, the mprotect(2) method uses mlock(2) and > mlock(2) does not always work, depending on load and permissions. > > I see there was a proposal on a Linux mailing list for a new syscall to > implement this functionality [2] but FreeBSD 11.0 does not appear to have it. > > Regards > > [1] > https://github.com/dotnet/coreclr/blob/master/src/pal/src/thread/process.cpp#L2886 > https://github.com/dotnet/coreclr/blob/master/src/pal/src/thread/process.cpp#L2929 > [2] https://lkml.org/lkml/2015/7/10/766