lkml.org 
[lkml]   [2004]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: waiting 10s before mounting root filesystem?
Jesper Juhl wrote:
> [...]
>> #include <linux/nfs_fs.h>
>> #include <linux/nfs_fs_sb.h>
>>@@ -278,6 +279,7 @@
>> char *fs_names = __getname();
>> char *p;
>> char b[BDEVNAME_SIZE];
>>+ int tryagain = 20;
>>
>
> Ok, I'm nitpicking here, but why int and not short? are we likely to ever
> want to wait for more than 2 minutes? and if we want to wait ~3min, then
> unsigned short should do just fine (and unsigned would even be logical
> since negative retry value doesn't make any sense)....

Usually it is better to use int's instead of short's because memory
accesses for CPU word size data are faster.

With some CPUs, decrementing a short will probably involve reading a int
from memory, updating only the correct section of it, and then writing
an int. It is only worth the save if you're trying to make a very used
struct have a good 2^N size, or something like that.

Of course, things will get more complex with data caches, bus sizes,
etc., but I think the premise that the CPU will be more confortable
handling its native data size still holds.

--
Paulo Marques - www.grupopie.com

"A journey of a thousand miles begins with a single step."
Lao-tzu, The Way of Lao-tzu

-
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 14:09    [W:0.191 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site