lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <460022B4.4000509@redhat.com>
Date:	Tue, 20 Mar 2007 14:06:44 -0400
From:	Rik van Riel <riel@...hat.com>
To:	Bob Picco <bob.picco@...com>
CC:	linux-mm <linux-mm@...ck.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ