From owner-freebsd-virtualization@FreeBSD.ORG Thu Jun 11 13:50:53 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DE76CA2 for ; Thu, 11 Jun 2015 13:50:53 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com [IPv6:2607:f8b0:4003:c06::241]) (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 DB5871125 for ; Thu, 11 Jun 2015 13:50:52 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: by oiav1 with SMTP id v1so950832oia.0 for ; Thu, 11 Jun 2015 06:50:52 -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=K08rc8CoKE6nBbW8Pn35RNvefXs1fgceDjc/xlIuAMY=; b=WIuBA4pUZxlg1idy+i3i/hWscu81CDgRkvxKSsqrSCCeBseqC5TRbEPgHrhWR52Wc1 H0VoLkQ2XWh6dtgrncb0o/0F5tOvi7+RIbArsKz/chV2g99yEr7fFik+UW9lAa41MG66 h4QXAIAcLH2QY5x+Nxur4M8VM8LOsuEEDzPlkOOhf8j+kKRFKyZt7+KFlweLy48KGstQ aOLrpzyPpwO9xGPTEWRoXkTPjDguVgJRy+JAcfe8EJn0YSSy1f+XkFM8nSWfyDKBqYIb fN81ZaGcziW1F8EqqJpJteDP9uMDF7i6O0ouIlYs/vm0Sp2rJMxcfS/IVM1upLnZf5t8 G0Yw== MIME-Version: 1.0 X-Received: by 10.60.16.133 with SMTP id g5mr7851991oed.66.1434030652055; Thu, 11 Jun 2015 06:50:52 -0700 (PDT) Received: by 10.60.82.168 with HTTP; Thu, 11 Jun 2015 06:50:52 -0700 (PDT) Date: Thu, 11 Jun 2015 16:50:52 +0300 Message-ID: Subject: What is the sequence of context switches when an IPI is received? 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: Thu, 11 Jun 2015 13:50:53 -0000 Hello, >From the FreeBSD Handbook: "FreeBSD deals with interrupt handlers by giving them their own thread context". >From my understanding when a IPI is received the thread that will run it is placed on the real-time runq, and the scheduler will be invoked to schedule it. So the sequence should be: currently running thread -> scheduler thread -> interrupt handler -> scheduler thread -> previously interrupted thread (if no thread priority change took place inside the interrupt handler) Is this correct? Thank you, Stefan