From owner-freebsd-hackers Wed May 13 11:41:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA18821 for freebsd-hackers-outgoing; Wed, 13 May 1998 11:41:42 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA18788 for ; Wed, 13 May 1998 11:41:30 -0700 (PDT) (envelope-from jhay@zibbi.mikom.csir.co.za) Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.9.0.Beta5/8.9.0.Beta5) id UAA10458 for hackers@freebsd.org; Wed, 13 May 1998 20:41:29 +0200 (SAT) From: John Hay Message-Id: <199805131841.UAA10458@zibbi.mikom.csir.co.za> Subject: sched_setscheduler() usage? To: hackers@FreeBSD.ORG Date: Wed, 13 May 1998 20:41:28 +0200 (SAT) X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, The latest versions of ntp4 detects that we have sched_setscheduler(2) and try to use it with this piece of code: ------------------- # if defined(HAVE_SCHED_SETSCHEDULER) { struct sched_param sched; sched.sched_priority = sched_get_priority_min(SCHED_FIFO); if ( sched_setscheduler(0, SCHED_FIFO, &sched) == -1 ) { msyslog(LOG_ERR, "sched_setscheduler(): %m"); } } # else /* not HAVE_SCHED_SETSCHEDULER */ ------------------- The problem is that this seems to give ntpd a lower priority (something like idle priority) because any normal priority program that is cpu intensive will starve ntpd totally. So should this piece of code result in higher priority than normal programs (like the rtprio stuff) or is this piece of code broken? I assume the ntp guys wanted ntpd to be scheduled at a relatively high priority to keep delays and jitter to a minimum. Another question, where does the sched_setscheduler() priorities fit in with the rest of our priorities? I have started to look through the kernel code, but because I don't know what its relationship to the rest of the priorities should be, it is difficult to figure out where the problem is. John -- John Hay -- John.Hay@mikom.csir.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message