From patchwork Tue Dec 9 10:21:03 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 12906 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 92163DDF26 for ; Tue, 9 Dec 2008 21:21:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752400AbYLIKVN (ORCPT ); Tue, 9 Dec 2008 05:21:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752454AbYLIKVM (ORCPT ); Tue, 9 Dec 2008 05:21:12 -0500 Received: from ug-out-1314.google.com ([66.249.92.170]:44025 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbYLIKVL (ORCPT ); Tue, 9 Dec 2008 05:21:11 -0500 Received: by ug-out-1314.google.com with SMTP id 39so1033647ugf.37 for ; Tue, 09 Dec 2008 02:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:x-mutt-fcc :x-mutt-fcc:user-agent; bh=7VFpQQXFUY5AMsbKrD1WInizGX+X+6tArYS+jR+7s5k=; b=T+vnUdtes5asUnqtVqhoVuVn9/loKjq7P8W7+pgBXBduaTvJAebfnw5nN3VIMT66ch x3PfnJwPXcIk443XXlXKStMHJLArtQI3IzT+5C7A+xDdw8/idB/e9ui6bwJIZ8jBW0hc qBgzlLLeqCfbl7wGzY5ILMwF5bFW7+CFrQL9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:x-mutt-fcc:user-agent; b=N9JSoWTzXgxRkQYhS2vnfFhR4A0qyFp5IoVFWKlMAQZiSwZe4rSCSLJCyDI35qeCRR 7l/hldvlP8COBLn+Egq9ZNp0DLylVSg6LYIcf1msgfv1pYLWWif4NsrrL/TZKlzDsv8b 1DiCpqoizV9e4gDXDyiEKpX229AMJH4Q1jvOU= Received: by 10.67.106.19 with SMTP id i19mr3133789ugm.46.1228818069216; Tue, 09 Dec 2008 02:21:09 -0800 (PST) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id q1sm10222419uge.23.2008.12.09.02.21.08 (version=SSLv3 cipher=RC4-MD5); Tue, 09 Dec 2008 02:21:08 -0800 (PST) Date: Tue, 9 Dec 2008 10:21:03 +0000 From: Jarek Poplawski To: David Miller Cc: Martin Devera , Patrick McHardy , netdev@vger.kernel.org Subject: [PATCH 1/6] pkt_sched: sch_htb: Consider used jiffies in htb_do_events() Message-ID: <20081209102103.GA14862@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =outbox X-Mutt-Fcc: =outbox User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Next event time should consider jiffies used for recounting. Otherwise qdisc_watchdog_schedule() triggers hrtimer immediately with the event in the past, and may cause very high ksoftirqd cpu usage (if highres is on). Signed-off-by: Jarek Poplawski --- net/sched/sch_htb.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index f89fd71..d6eb4a7 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -685,8 +685,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level) if (cl->cmode != HTB_CAN_SEND) htb_add_to_wait_tree(q, cl, diff); } - /* too much load - let's continue on next jiffie */ - return q->now + PSCHED_TICKS_PER_SEC / HZ; + /* too much load - let's continue on next jiffie (including above) */ + return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ; } /* Returns class->node+prio from id-tree where classe's id is >= id. NULL