Re: waiting 10s before mounting root filesystem?

From: Paulo Marques
Date: Fri Dec 31 2004 - 06:32:13 EST


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