Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760063Ab1CDTCP (ORCPT ); Fri, 4 Mar 2011 14:02:15 -0500 Received: from casper.infradead.org ([85.118.1.10]:50668 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759918Ab1CDTCO (ORCPT ); Fri, 4 Mar 2011 14:02:14 -0500 Subject: Re: [PATCH, v7] cgroups: introduce timer slack controller From: Peter Zijlstra To: "Kirill A. Shutsemov" Cc: Paul Menage , Li Zefan , containers@lists.linux-foundation.org, jacob.jun.pan@linux.intel.com, Arjan van de Ven , linux-kernel@vger.kernel.org, Matt Helsley , Andrew Morton , linux-api@vger.kernel.org In-Reply-To: <1299084001-3916-2-git-send-email-kirill@shutemov.name> References: <1299084001-3916-1-git-send-email-kirill@shutemov.name> <1299084001-3916-2-git-send-email-kirill@shutemov.name> Content-Type: text/plain; charset="UTF-8" Date: Fri, 04 Mar 2011 20:03:42 +0100 Message-ID: <1299265422.22521.2.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 649 Lines: 18 On Wed, 2011-03-02 at 18:40 +0200, Kirill A. Shutsemov wrote: > - if (ret < current->timer_slack_ns) > - return current->timer_slack_ns; > - return ret; > + return clamp(__estimate_accuracy(&now), > + get_task_timer_slack(current), LONG_MAX); That actually makes the code worse, how about: min(__estimate_accuracy(), get_task_timer_slack()) ? -- 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/