Re: [RFC][PATCH] split file and anonymous page queues #2

From: Rik van Riel
Date: Tue Mar 20 2007 - 14:07:33 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/