Re: [PATCH 0/8] Suspend block api (version 8)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 3 Jun 2010 06:24:49 -0700
mark gross <640e9920@xxxxxxxxx> wrote:

> On Thu, Jun 03, 2010 at 12:10:03AM -0700, Arve Hjønnevåg wrote:

> ok I'm not getting it.
> is this a fancy com-sci algorithm I should know about?
> 
> --mgross

I think you are at an advantage if you have studied fancy com-sci for
this? Here is an example:

say you have 5 constraints: 
qos1 with a value of 10
qos2 with 5
qos3 with 10
qos4 with 11

Now, you hash that list by the qos-values:

11    ---- 10 	----- 5 
|	   |  	      |
qos4	   qos3       qos2
	   |
	   qos1


To compute the maximum you just walk the "----" list.

To reduce qos4 from 11 to 5 you remove it from its "|" list and
prepend it to the corresponding "|" list.  (4 Pointer adjustments +
searching the "-----" list for the right place to insert.  

result:

10 ---- 5
|	|
qos3	qos4
|	|
qos1	qos2

Cheers,
Flo
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux