lkml.org 
[lkml]   [2000]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Updated Linux 2.4 issues page
andersen@codepoet.org (Erik Andersen)  wrote on 20.08.00 in <20000820085201.A459@codepoet.org>:

> + unsigned long mem_total = val.totalram + val.totalswap + val.totalhigh;
> +
> + /* If mem_total did not overflow. Divide all memory values by
> + * mem_unit and set mem_unit=1. This leaves things compatable with
> + * 2.2.x, and also retains compatability with earlier 2.4.x
> + * kernels... */
> + if ( !(mem_total < val.totalram || mem_total < val.totalswap ||
> + mem_total < val.totalhigh) )

This check doesn't work.

Example: assume val.totalram = val.totalswap = val.totalhigh = 2.5 GB

Then mem_total = 7.5 GB mod 4 GB = 3.5 GB

and 3.5 GB > 2.5 GB.

qed.

(More detail: for a sum of n terms, it breaks (for example) for equal
terms between max/(n-1) as lower and 2*max/n as upper bound. For n=2, this
is empty; for n=3, it's between 1/2*max and 2/3*max, for n=4 it'd be
between 1/3*max and 1/2*max, and so on.)


MfG Kai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.098 / U:9.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site