Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757577Ab0FBDuG (ORCPT ); Tue, 1 Jun 2010 23:50:06 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:42650 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756132Ab0FBDuD convert rfc822-to-8bit (ORCPT ); Tue, 1 Jun 2010 23:50:03 -0400 MIME-Version: 1.0 In-Reply-To: <20100601140519.GC1281@gvim.org> References: <201005312338.55109.rjw@sisk.pl> <20100531232617.GF31155@gvim.org> <20100601090737.4bc243d9@schatten.dmk.lab> <20100601140519.GC1281@gvim.org> Date: Tue, 1 Jun 2010 20:50:02 -0700 Message-ID: Subject: Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8) From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: markgross@thegnar.org Cc: Florian Mickler , 640e9920@gmail.com, "Rafael J. Wysocki" , Alan Stern , Peter Zijlstra , Linux PM , Brian Swetland , Alan Cox , Matthew Garrett , Thomas Gleixner , LKML , Ingo Molnar Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1369 Lines: 33 On Tue, Jun 1, 2010 at 7:05 AM, mark gross <640e9920@gmail.com> wrote: > On Tue, Jun 01, 2010 at 09:07:37AM +0200, Florian Mickler wrote: ... >> +static void update_target_val(int pm_qos_class, s32 val) >> +{ >> + ? ? s32 extreme_value; >> + ? ? s32 new_value; >> + ? ? extreme_value = atomic_read(&pm_qos_array[pm_qos_class]->target_value); >> + ? ? new_value = pm_qos_array[pm_qos_class]->comparitor(val,extreme_value); >> + ? ? if (extreme_value != new_value) >> + ? ? ? ? ? ? atomic_set(&pm_qos_array[pm_qos_class]->target_value,new_value); >> +} >> + > > Only works 1/2 the time, but I like the idea! > It fails to get the righ answer when constraints are reduced. ?But, this > idea is a good improvement i'll roll into the next pm_qos update! > I think it would be a better idea to track your constraints with a sorted data structure. That way you can to better than O(n) for both directions. If you have a lot of constraints with the same value, it may even be worthwhile to have a two stage structure where for instance you use a rbtree for the unique values and list for identical constraints. -- Arve Hj?nnev?g -- 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/