From owner-p4-projects@FreeBSD.ORG Mon Jun 26 03:10:15 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 397B416A405; Mon, 26 Jun 2006 03:10:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1955C16A400 for ; Mon, 26 Jun 2006 03:10:12 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EC2B4454B for ; Mon, 26 Jun 2006 01:39:16 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5Q1dGhf094362 for ; Mon, 26 Jun 2006 01:39:16 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5Q1dG3X094359 for perforce@freebsd.org; Mon, 26 Jun 2006 01:39:16 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 26 Jun 2006 01:39:16 GMT Message-Id: <200606260139.k5Q1dG3X094359@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 100007 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2006 03:10:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=100007 Change 100007 by kmacy@kmacy_storage:sun4v_work_sleepq on 2006/06/26 01:38:33 tune interval at which we poll choosethread Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/kern/kern_idle.c#8 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/kern/kern_idle.c#8 (text+ko) ==== @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #ifdef SMP @@ -45,6 +46,12 @@ SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL) static void idle_proc(void *dummy); +static int interval = 10; + +SYSCTL_NODE(_debug, OID_AUTO, scheduler, CTLFLAG_RD, NULL, "scheduler debugging"); +SYSCTL_NODE(_debug_scheduler, OID_AUTO, idle, CTLFLAG_RD, NULL, "idle info"); +SYSCTL_INT(_debug_scheduler_idle, OID_AUTO, interval, CTLFLAG_RW, + &interval, 0, "interval between idle skips"); /* * Set up per-cpu idle process contexts. The AP's shouldn't be running or @@ -95,20 +102,18 @@ static void idle_proc(void *dummy) { - int i; #ifdef SMP cpumask_t mycpu; #endif - + int i = 0; #ifdef SMP mycpu = PCPU_GET(cpumask); atomic_set_int(&idle_cpus_mask, mycpu); #endif - i = 0; for (;;) { mtx_assert(&Giant, MA_NOTOWNED); - while (sched_runnable() == 0 && (i++%10 != 0)) + while (sched_runnable() == 0 && (i++%interval != 0)) cpu_idle(); #ifdef SMP atomic_clear_int(&idle_cpus_mask, mycpu);