Hello All,
I submitted a patch for /usr/sbin/rebuildfstab at github. And then it started to get weird.
--
The current rebuildfstab script is flawed having a big penalty in user, but more over system time.
The script is run every time a block device is added or removed (udev rules)
I made some changes to get it right, removed the bad loops in the script.
Ok, so far so good. These are some results on a system having some disks and more than 200 loop devices.
----
Old rebuildfstab
real 0m 0.47s
user 0m 0.08s
sys 0m 0.38s
New rebuildfstab
real 0m 0.14s
user 0m 0.03s
sys 0m 0.08s
----
These are execellent results.
When i made a pull request things got out of hand, to my opinion.
--clbr--
Thank you for the patch. While your numbers look good, it would change the behavior, and possibly have speed regressions in some envs. The current code supports manual fstab entries, while this patch would add those a second time. Running blkid without any options does a slow scan, which with optical drives and floppies can be slow (I'm not sure if the -s option also triggers this - it's possible that also does a scan).
Perhaps a large part of the time taken is by the "find" command, where adding "-maxdepth 2" may give some speedup.
If you'd like to submit the ext4 change separately, please do.
--clbr--
Oh, about the header edits: removing the includes also may change behavior, and the header comment seems improper when no other contributors have been added therein.
---------
So this is a big NO-GO to opinion o *clbr*
These are my remarks on the so called 'code review'- "it would change the behavior" NO
- "The current code supports manual fstab entries, while this patch would add those a second time" Also NO, this update does exactly what the other code does, only better and faster
- "blkid without any options does a slow scan", NO, have a look at the source code.
- "with optical drives and floppies can be slow", sure also the NFS mounts can be slow, this has nothing to do with 99% of us
- "The current code supports manual fstab entries, while this patch would add those a second time" NO. The behaviour of this code is exactly the same as the original code, have a look at that source, and come back with better comments
- "If you'd like to submit the ext4 change separately, please do." NO, it is all or Nothing, but I get the picture already.
To bad, this code review does not have the high quality i want.- "removing the includes also may change behavior" NO, no functions are used from the header includes.
- "header comment seems improper when no other contributors have been added therein" NO, I want some more comment, what the script does exactly and so on, this is a start
--clbr--
Very well,
closing this. "come back with better comments" when
your patch is wrong is simply rude.
--------
Is this collaboration??? I am not on your payrol mister.
Prove us where the script is wrong and can be made better and faster.
Cheers.
ps, Attached my dmesg of a test system having the patch, running /init after booting on 0.6 sec (!!!) mounting swap and data disk and nic up. All under a
total of 1.7 seconds (!!!)