From owner-freebsd-virtualization@FreeBSD.ORG Thu Apr 30 09:01:37 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 D1AC99A6 for ; Thu, 30 Apr 2015 09:01:37 +0000 (UTC) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (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 9DC2616DB for ; Thu, 30 Apr 2015 09:01:37 +0000 (UTC) Received: by oiko83 with SMTP id o83so42924558oik.1 for ; Thu, 30 Apr 2015 02:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+qJwJUMYat8Hqis5Uy3R8hBBraHAjUrC8aMXoCG0m3o=; b=GM5e7qe6OrbcvIyoHw9MgOCgwtNCcJMEvVlQytIEFD4V5VAYO3XOVA4PiLIbbr4LCE DUVeoFLrOsykuhBiaC99ET3+gX5xylNxcCTPqtmiBAbFGe4FFdwk24M1dMIYSHh0CH7t j0vdMNV3kQxPwEbnhLn7C/umb7EplqURqI1nYkWEzQJ9cjY+EEY7xGJorzeyizeqRL03 oA2+gzlwmzTesC7m9fq1KoXXzG6vtLf/XAf9tYIpxxqYwIvt+QudxbjNxOapyRX6vZYi KIl1ej3Vd5Br3WL7kWsccDrbgl6KMb6ghiwHvMrJ38Q0IKgkyTicJ/3S4FgJ74zrg1sl qafA== MIME-Version: 1.0 X-Received: by 10.202.203.204 with SMTP id b195mr2524418oig.1.1430384496974; Thu, 30 Apr 2015 02:01:36 -0700 (PDT) Sender: kmacybsd@gmail.com Received: by 10.202.21.132 with HTTP; Thu, 30 Apr 2015 02:01:36 -0700 (PDT) Received: by 10.202.21.132 with HTTP; Thu, 30 Apr 2015 02:01:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Apr 2015 02:01:36 -0700 X-Google-Sender-Auth: ewI-W_sKjcdo9C_sEQ-759wYNTo Message-ID: Subject: Re: How to tell if current running thread can be preempted? From: "K. Macy" To: Stefan Andritoiu Cc: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Thu, 30 Apr 2015 09:01:38 -0000 Any thread can be preempted unless it's in a critical section which is tracked by a counter in the current thread. There would be no OS agnostic way of doing what you ask in your second question. On Apr 28, 2015 4:26 PM, "Stefan Andritoiu" wrote: > 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? > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to " > freebsd-virtualization-unsubscribe@freebsd.org" >