Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262419AbVBXQVh (ORCPT ); Thu, 24 Feb 2005 11:21:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261810AbVBXQUa (ORCPT ); Thu, 24 Feb 2005 11:20:30 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:24490 "EHLO e6.ny.us.ibm.com") by vger.kernel.org with ESMTP id S262410AbVBXQPt (ORCPT ); Thu, 24 Feb 2005 11:15:49 -0500 Subject: Re: [PATCH] CKRM [7/8] Resource controller for number of tasks per class From: Dave Hansen To: Gerrit Huizenga Cc: Kernel Mailing List , ckrm-tech@lists.sourceforge.net In-Reply-To: References: Content-Type: text/plain Date: Thu, 24 Feb 2005 08:15:43 -0800 Message-Id: <1109261743.7244.64.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 30 On Thu, 2005-02-24 at 01:34 -0800, Gerrit Huizenga wrote: > This patch provides a resource controller for limiting the number > of tasks per class in CKRM. It takes 627 lines of code to count the number of tasks in a class? What does all of that infrastructure buy you, again? All of the logic to borrow if you've gone over your limit should be a quite repeated theme throughout all of the controllers. Seems to me that at least a larger chunk of that should be in generic code. > +static void numtasks_res_free(void *my_res) > +{ ... > + if (unlikely(atomic_read(&res->cnt_cur_alloc) < 0)) { > + printk(KERN_WARNING "numtasks_res: counter below 0 > \n"); > + } > + if (unlikely(atomic_read(&res->cnt_cur_alloc) > 0 || > + atomic_read(&res->cnt_borrowed) > 0)) How often is this called? Do you really need unlikely()? -- Dave - 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/