Re: How to call a function in the kernel from Local APIC timer handler

From: John Baldwin (jhb_at_freebsd.org)
Date: 10/31/05

  • Next message: John Baldwin: "Re: How to call a function in the kernel from Local APIC timer handler"
    To: freebsd-current@freebsd.org
    Date: Mon, 31 Oct 2005 15:47:05 -0500
    
    

    On Friday 28 October 2005 07:39 pm, Vaibhave Agarwal wrote:
    > Hi, I need some help with the new local APIC functionality added in
    > FreeBSD 6.0 and above.
    >
    > All the code which I am writing is in FreeBSD kernel.
    >
    > I was using LAPIC one shot timer for scheduling some events in the kernel.
    > The problem is that I cannot call the function in my code, directly from
    > the APIC timer handler, because all the interrupts are disabled in the
    > APIC timer handler ( function is lapic_handle_timer() ), and my function
    > uses a sleep mutex to protect the kernel code I have written.
    > Therefore, I schedule a software interrupt thread, which calls my function
    > later in time.
    > Is there a way, I can call my function instantly from the
    > lapic_handle_timer, bcoz using the software interrupt thread, decreases
    > the accuracy of the scheduler i am using.

    You can use spin mutexes rather than sleep mutexes in the lapic_handle_timer()
    context. If you need msleep/wakeup() functionality you can provide that
    using the sleepq(9) interface directly.

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: John Baldwin: "Re: How to call a function in the kernel from Local APIC timer handler"

    Relevant Pages

    • Re: How to call a function in the kernel from Local APIC timer handler
      ... > All the code which I am writing is in FreeBSD kernel. ... > I was using LAPIC one shot timer for scheduling some events in the kernel. ...
      (freebsd-current)
    • Re: How to call a function in the kernel from Local APIC timer handler
      ... > All the code which I am writing is in FreeBSD kernel. ... > I was using LAPIC one shot timer for scheduling some events in the kernel. ...
      (freebsd-net)
    • Re: RTCoreBSD
      ... > have hard real-time ... >> scheduling you should have a fully preemtible ... > kernel, which schedules ... > which runs the FreeBSD ...
      (freebsd-current)
    • Re: RTCoreBSD
      ... > have hard real-time ... >> scheduling you should have a fully preemtible ... > kernel, which schedules ... > which runs the FreeBSD ...
      (freebsd-current)
    • FreeBSD Status report for Oct-Dec 2003
      ... Bluetooth stack for FreeBSD ... Not much to report. ... Bluetooth kernel modules appear to be stable. ... concerns and some src committers are willing to commit the patches. ...
      (freebsd-current)