From owner-freebsd-current@FreeBSD.ORG Sat Oct 22 10:46:52 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69E6E1065670 for ; Sat, 22 Oct 2011 10:46:52 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from fsm1.ukr.net (fsm1.ukr.net [195.214.192.120]) by mx1.freebsd.org (Postfix) with ESMTP id 1F37C8FC12 for ; Sat, 22 Oct 2011 10:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Type:Mime-Version:Message-ID:Subject:To:From:Date; bh=nJ+r68cD6rb7U+/KIbmG5wrxE5EQlp1w9PmYjXWViNc=; b=Zmv34IRTkRUfIPi8MIwnI5Y4Yr9moYx1eHBB6hIP+ycLXX7hP5DmGVsGebUPBxpByvD684fnu4E5eSOfBpARsXmBskcTFWyTjnhg2kESzLXILzGZv1qiIh3NHzVfSU3fzRu2FhzYH4a4OVGGSX4+QKJIoISjg/51tyVBR6vAwqc=; Received: from [81.23.24.105] (helo=nonamehost.) by fsm1.ukr.net with esmtpsa ID 1RHYpU-00068g-G9 for freebsd-current@freebsd.org; Sat, 22 Oct 2011 13:29:29 +0300 Date: Sat, 22 Oct 2011 13:28:17 +0300 From: Ivan Klymenko To: freebsd-current@freebsd.org Message-ID: <20111022132817.35db5ccd@nonamehost.> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/2Bj4DX12eEZBzoXNA9UE8vJ" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Increase the degree of interactivity ULE scheduler X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2011 10:46:52 -0000 --MP_/2Bj4DX12eEZBzoXNA9UE8vJ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello people! I have: CPU: Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz (1994.48-MHz K8-class CPU) FreeBSD 10.0-CURRENT r226607 amd64 For example during the building of the port lang/gcc46 in four streams (-j 4) with a heavy load on the processor - use the system was nearly impossible - responsiveness was terrible - the mouse cursor sometimes froze on the spot a few seconds... I managed to achieve a significant increase in the degree of interactivity ULE scheduler due to the following changes: ########################## --- sched_ule.c.orig 2011-10-22 11:40:30.000000000 +0300 +++ sched_ule.c 2011-10-22 12:25:05.000000000 +0300 @@ -2119,6 +2119,14 @@ THREAD_LOCK_ASSERT(td, MA_OWNED); tdq = TDQ_SELF(); + if (td->td_pri_class & PRI_FIFO_BIT) + return; + ts = td->td_sched; + /* + * We used up one time slice. + */ + if (--ts->ts_slice > 0) + return; #ifdef SMP /* * We run the long term load balancer infrequently on the first cpu. @@ -2144,9 +2152,6 @@ if (TAILQ_EMPTY(&tdq->tdq_timeshare.rq_queues[tdq->tdq_ridx])) tdq->tdq_ridx = tdq->tdq_idx; } - ts = td->td_sched; - if (td->td_pri_class & PRI_FIFO_BIT) - return; if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { /* * We used a tick; charge it to the thread so @@ -2157,11 +2162,6 @@ sched_priority(td); } /* - * We used up one time slice. - */ - if (--ts->ts_slice > 0) - return; - /* * We're out of time, force a requeue at userret(). */ ts->ts_slice = sched_slice; ########################## What do you think about this? Thanks! --MP_/2Bj4DX12eEZBzoXNA9UE8vJ--