Btrfs aims for the mainline
Posted Jan 7, 2009 23:25 UTC (Wed) by
jzbiciak (
✭ supporter ✭, #5246)
In reply to:
Btrfs aims for the mainline by MisterIO
Parent article:
Btrfs aims for the mainline
Are you commenting on the fact that the loop iterates 512 times in addition to the one try outside the loop? The way I read the following, it tries once, and if it fails, it tries another 512 times:
The lock in question is a mutex, but it is being acquired in an interesting way. If the lock is held by another process, this function will poll it up to 512 times, without sleeping, in the hope that it will become available quickly. Should that happen, the lock can be acquired without sleeping at all. After 512 unsuccessful attempts, the function will finally give up and go to sleep.
So, yeah, it tries 513 times. I guess it's hair-splitting as to exactly how many times it tries. I think the point was "try several times just in case."
(
Log in to post comments)