Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965151AbWEOTEI (ORCPT ); Mon, 15 May 2006 15:04:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932343AbWEOTEH (ORCPT ); Mon, 15 May 2006 15:04:07 -0400 Received: from mga02.intel.com ([134.134.136.20]:26012 "EHLO orsmga101-1.jf.intel.com") by vger.kernel.org with ESMTP id S932317AbWEOTEF (ORCPT ); Mon, 15 May 2006 15:04:05 -0400 Message-Id: <4t16i2$12rqnu@orsmga001.jf.intel.com> X-IronPort-AV: i="4.05,130,1146466800"; d="scan'208"; a="36563710:sNHT7341033294" From: "Chen, Kenneth W" To: "'Con Kolivas'" Cc: , , , "Andrew Morton" Subject: RE: Regression seen for patch "sched:dont decrease idle sleep avg" Date: Mon, 15 May 2006 12:01:06 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcZ3cDNbvUN9Jw1lT32tJEio0WrB2AA3CMIg In-Reply-To: <200605150203.13633.kernel@kolivas.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2219 Lines: 47 Con Kolivas wrote on Sunday, May 14, 2006 9:03 AM > There would be no difference if the priority boost is done lower. The if and > else blocks both end up equating to the same amount of priority boost, with > the former having a ceiling on it, so yes it is the intent. You'll see that > the amount of sleep required to jump from lowest priority to MAX_SLEEP_AVG - > DEF_TIMESLICE is INTERACTIVE_SLEEP. I don't think the if and the else block is doing the same thing. In the if block, the p->sleep_avg is unconditionally boosted to ceiling for all tasks, though it will not reduce sleep_avg for tasks that already exceed the ceiling. Bumping up sleep_avg will then translate into priority boost of MAX_BONUS-1, which potentially can be too high. But that's fine if it is the intent. At minimum, the comment in the source code should say so instead of fooling people who don't actually read the code. [patch] sched: update comments in priority calculation w.r.t. implementation. Signed-off-by: Ken Chen --- ./kernel/sched.c.orig 2006-05-15 12:24:02.000000000 -0700 +++ ./kernel/sched.c 2006-05-15 12:37:16.000000000 -0700 @@ -746,10 +746,12 @@ static int recalc_task_prio(task_t *p, u if (likely(sleep_time > 0)) { /* * User tasks that sleep a long time are categorised as - * idle. They will only have their sleep_avg increased to a - * level that makes them just interactive priority to stay - * active yet prevent them suddenly becoming cpu hogs and - * starving other processes. + * idle. If they sleep longer than INTERACTIVE_SLEEP, it + * will have its priority boosted to minimum MAX_BONUS-1. + * For short sleep, they will only have their sleep_avg + * increased to a level that makes them just interactive + * priority to stay active yet prevent them suddenly becoming + * cpu hogs and starving other processes. */ if (p->mm && sleep_time > INTERACTIVE_SLEEP(p)) { unsigned long ceiling; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/