Re: ext2_find_near

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31-07-08 08:20, Scott Lovenberg wrote:

Rene Herman wrote:
On 29-07-08 21:35, Rohit Sharma wrote:

I was going through the function "ext2_find_near" in inode.c and
could not interpret the meaning of the last part of this code :

Am definitely not an fs person, but the comment just above ext2_find_near() explains a bit.

Colouring the location like that lessens the chances of a concurrent allocation -- supposedly from a different PID -- finding the exact same spot and both of them clashing at the point where the actual allocation happens (so that, I suppose, one of them must go back and try to find a new location all over again).

Now whether or "pid % 16" is actually a good colour in practice...

Correct me if I'm wrong, but could the "pid % 16" be for page/block alignment?

The colouring itself at least is to help concurrent allocations clash less. The comment is "The PID is used here so that functionally related files will be close-by on-disk" which made me wonder a bit about the effectiveness of pid % 16 -- many of the PIDs in my "pid % 16 groups" aren't at all functionally related programs.

I don't even really have a good idea of WHAT is being allocated here though and will not be finding out due to a fairly high non-interest in the specifics of filesystems. The usual context in wich to find the term "colouring" is in "cache colouring", where you lay out data so that the chances of two bits of said data competing for the same cacheline are diminished and knowing that I felt that a reply, even though it did no more than repeat the source code comment really, could perhaps still be useful.

Rene.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux