lkml.org 
[lkml]   [2003]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: allow percentile size of tmpfs (2.5.66 / 2.4.20-pre2)
On Wed, 2 Apr 2003, CaT wrote:
> >
> > Hardly, it'll overflow in even more cases
> > than CaT's (si.totalram << PAGE_CACHE_SHIFT).
>
> Yes. I had it initially as Xavier suggested but after thinking about it
> a bit I felt that making the value smaller and -then- bigger was safer.
>
> > I'll take a look at this later, not right now.
>
> It is still an unsigned long long int so (AFAIK) it wont overflow till
> it hits 18,446,744,073,709,551,615. Now... if you have that much ram...
> wow! :)

There's plenty of room in unsigned long long size, yes, but si.totalram
is only an unsigned long, so the arithmetic as you have it starts out
overflowing an unsigned long.

I don't know yet what it should say: RH2.96-110 is getting confused
by the do_div(size, 100) I have there (to respect Xavier's point),
and this is definitely _not_ worth adding a compiler dependency for.

Hugh

-
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: 2005-03-22 13:34    [W:0.048 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site