Re: Noticable Delays Since Beta 3 (patch)

From: Sam Lawrance (boris_at_brooknet.com.au)
Date: 10/09/04

  • Next message: Sam Lawrance: "Re: Noticable Delays Since Beta 3 (possible cause)"
    To: David Xu <davidxu@freebsd.org>
    Date: Sat, 09 Oct 2004 16:37:44 +1000
    
    

    On Sat, 2004-10-09 at 12:39 +0800, David Xu wrote:
    > This can be done by set a flag in current threads td_pflags,
    > for example, set TDP_WAKEPROC0, when the current thread
    > leaves critical region, it can do wakeup(&proc0);

    This is working for me against 5.3-BETA5.

    Index: kern_synch.c
    ===================================================================
    RCS file: /home/ncvs/FreeBSD/src/sys/kern/kern_synch.c,v
    retrieving revision 1.257.2.3
    diff -u -u -r1.257.2.3 kern_synch.c
    --- kern_synch.c 18 Sep 2004 04:11:35 -0000 1.257.2.3
    +++ kern_synch.c 9 Oct 2004 05:52:05 -0000
    @@ -249,8 +249,14 @@
     wakeup(ident)
             register void *ident;
     {
    + struct thread *td = curthread;
     
             sleepq_broadcast(ident, SLEEPQ_MSLEEP, -1);
    + /* If swapped out processes were awakened bring them in */
    + if (td->td_pflags & TDP_WAKEPROC0) {
    + td->td_pflags &= ~TDP_WAKEPROC0;
    + sleepq_broadcast(&proc0, SLEEPQ_MSLEEP, -1);
    + }
     }
     
     /*
    @@ -360,6 +366,7 @@
     setrunnable(struct thread *td)
     {
             struct proc *p;
    + struct thread *ctd = curthread;
     
             p = td->td_proc;
             mtx_assert(&sched_lock, MA_OWNED);
    @@ -390,13 +397,7 @@
             if ((p->p_sflag & PS_INMEM) == 0) {
                     if ((p->p_sflag & PS_SWAPPINGIN) == 0) {
                             p->p_sflag |= PS_SWAPINREQ;
    -#ifndef SMP
    - /*
    - * XXX: Disabled on SMP due to a LOR between
    - * sched_lock and the sleepqueue chain locks.
    - */
    - wakeup(&proc0);
    -#endif
    + ctd->td_pflags |= TDP_WAKEPROC0;
                     }
             } else
                     sched_wakeup(td);
    Index: proc.h
    ===================================================================
    RCS file: /home/ncvs/FreeBSD/src/sys/sys/proc.h,v
    retrieving revision 1.392.2.9
    diff -u -u -r1.392.2.9 proc.h
    --- proc.h 18 Sep 2004 04:11:35 -0000 1.392.2.9
    +++ proc.h 9 Oct 2004 05:54:40 -0000
    @@ -370,7 +370,7 @@
     #define TDP_SA 0x00000080 /* A scheduler activation based thread. */
     #define TDP_OWEPREEMPT 0x00000100 /* Thread has a pending preemption. */
     #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */
    -#define TDP_UNUSED10 0x00000400 /* -- available-- */
    +#define TDP_WAKEPROC0 0x00000400 /* Want caller to wakeup(&proc0) */
     #define TDP_CAN_UNBIND 0x00000800 /* Only temporarily bound. */
     #define TDP_SCHED1 0x00001000 /* Reserved for scheduler private use */
     #define TDP_SCHED2 0x00002000 /* Reserved for scheduler private use */

    _______________________________________________
    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: Sam Lawrance: "Re: Noticable Delays Since Beta 3 (possible cause)"

    Relevant Pages

    • [patch] Re: kern/94278: Crash with FIFOs and ktrace
      ... David Xu wrote: ... a vnode is enough for everything, I am really tired of such arch breakage. ... retrieving revision 1.172 ... diff -u -r1.172 linux_misc.c ...
      (freebsd-stable)
    • Small patch to add -a to cp
      ... This small patch adds the -a flag to cp. ... with rsync and other file manipulation utilities. ... retrieving revision 1.39 ... diff -u -r1.39 cp.1 ...
      (freebsd-current)
    • Modifying file access time upon exec...
      ... The issue is that the standards say a file's access time should be ... care of it by adding a new vnode flag that is used by the kernel to ... retrieving revision 1.271 ... diff -u -r1.271 kern_exec.c ...
      (freebsd-arch)
    • pstat/swapinfo -h flag
      ... flag of du, lsand other tools. ... The diff is against pstat in 6.0-CURRENT. ... Index: Makefile ... retrieving revision 1.12 ...
      (freebsd-hackers)
    • Re: Whats the point of __KERNEL_SYSCALLS__?
      ... retrieving revision 1.4 ... diff -u -p -r1.4 process.c ... -static int errno; ... * calls - which means inline code for fork too, ...
      (Linux-Kernel)