From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 1 05:44:57 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADA631065672; Sat, 1 Oct 2011 05:44:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 624AA8FC12; Sat, 1 Oct 2011 05:44:57 +0000 (UTC) Received: by ywp17 with SMTP id 17so2642413ywp.13 for ; Fri, 30 Sep 2011 22:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=9Qkj46R+gRfyL8JdoziE0Qhn1WCDiOuonesSG6j3XPk=; b=aaHmneZXEUljiVnlBxMYWFVSpMg9nE3l7FRN9/UP2bEMpq1Zmg1xBh25PX23ckpfZF 4Yxfhh0mh4iovvtk+Jfr21PfpjHo90RWcJOyclmUzCyAYwQd9L4nR5DPeuvt2InzZrcr ryVnHckNfcglY244RRUR423tI4p60ylUqP5DQ= MIME-Version: 1.0 Received: by 10.236.75.227 with SMTP id z63mr2325801yhd.55.1317447896633; Fri, 30 Sep 2011 22:44:56 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Fri, 30 Sep 2011 22:44:56 -0700 (PDT) Date: Sat, 1 Oct 2011 13:44:56 +0800 X-Google-Sender-Auth: 0_sfXq5PVWgun3-F4e28C8numro Message-ID: From: Adrian Chadd To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: how are callouts handled in cpu_idle() ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 05:44:57 -0000 Hi, What happens if this occurs: * cpu_idle() is entered * you enter critical_enter() and call cpu_idleclock() * an interrupt occurs, scheduling an immediate callout * .. but you've already set the clock register, so it won't be serviced until the wait returns. Perhaps interrupts have to be disabled before critical_enter() and cpu_idletick() to ensure an interrupt-driven callout doesn't get delayed? Adrian