lkml.org 
[lkml]   [2007]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] split file and anonymous page queues #2
Bob Picco wrote:

>> + /*
>> + * anon recent_rotated_anon
>> + * %anon = 100 * --------- / ------------------- * IO cost
>> + * anon+file recent_scanned_anon
>> + */
>> + anon_l = (anon_prio + 1) * (zone->recent_scanned_anon + 1);
>> + do_div(anon_l, (zone->recent_rotated_anon + 1));
>> +
>> + file_l = (file_prio + 1) * (zone->recent_scanned_file + 1);
>> + do_div(file_l, (zone->recent_rotated_file + 1));
>> +
>> + /* Normalize to percentages. */
>> + *anon_percent = (unsigned long)100 * anon_l / (anon_l + file_l);
> I believe this requires a do_div on 32 bit arch.

Actually, the "unsigned long long" is a holdover from the
code I had before. With the calculation above, I think I
can make it a simple "unsigned long" and get rid of the
do_div magic alltogether...

Btw, it would help if you could trim your replies. I almost
could not find your one line reply in-between the 1600 lines
of quoted text :)

--
All Rights Reversed
-
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/

\
 
 \ /
  Last update: 2007-03-20 19:09    [W:0.097 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site