From owner-freebsd-virtualization@FreeBSD.ORG Tue Apr 28 23:26:14 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A42D2D2 for ; Tue, 28 Apr 2015 23:26:14 +0000 (UTC) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (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 5414715A0 for ; Tue, 28 Apr 2015 23:26:14 +0000 (UTC) Received: by oign205 with SMTP id n205so9047045oig.2 for ; Tue, 28 Apr 2015 16:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=3OaG6BhvcIp1AZ1J7KXIVQ1svbE5jWmjlOwewU6zsKk=; b=dIL/D57tiWxDIqjTXHFaayO7zLUkCezvtR4itr+GN+aYjIIfPObWn1aqq/E1LZfx8D sngn2cPkb0BCSunNTUcpgCq2qttMdLkSg2nubzjjIjEOmJgcyJ9sqG03fI7t1GTEshei W6OwP86PEaUNIeezdznUewx0OaRgdYpRdJ9VgLvgLqhlzQOnXyOdvmbPnUm+ka2iFlfb o7J158U8GkeErFbzMF6puceVS96jWeKvKWyRbAqP5Md1tLtVYDSHf5/Bv06dhC7ZQopV E9bQWE3l9DCHq10XZGkkfGJwTMZpTf3vmAzRNVKZNBGKKLMVz+/n2f/omOgzf4ToJvK7 QwAw== MIME-Version: 1.0 X-Received: by 10.60.137.201 with SMTP id qk9mr16593661oeb.15.1430263573594; Tue, 28 Apr 2015 16:26:13 -0700 (PDT) Received: by 10.60.82.168 with HTTP; Tue, 28 Apr 2015 16:26:13 -0700 (PDT) Date: Wed, 29 Apr 2015 02:26:13 +0300 Message-ID: Subject: How to tell if current running thread can be preempted? From: Stefan Andritoiu To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2015 23:26:14 -0000 In Linux, in the scheduler function, it check if(!preempt_count() & PREEMPT_ACTIVE). How does the ULE scheduler tell if it can preempt the current thread? Is there an equivalent to the preempt_count() function and the PREEMPT_ACTIVE macro? Also, can this information, of a current thread running inside a FreeBSD virtual machine on bhyve, be accessed from the host?