find_group_orlov()

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

 



This is a code snippet from find_group_orlov() in ialloc.c of ext2 fs

I am not able to figure out the percpu counters, why it is used.


if (ndirs == 0)
		ndirs = 1;	/* percpu_counters are approximate... */

	blocks_per_dir = (le32_to_cpu(es->s_blocks_count)-free_blocks) / ndirs;

	max_dirs = ndirs / ngroups + inodes_per_group / 16;
               // Why 16??
	min_inodes = avefreei - inodes_per_group / 4;
                   // Why 4 ??
	min_blocks = avefreeb - EXT2_BLOCKS_PER_GROUP(sb) / 4;
    // Why 4 ??

	max_debt = EXT2_BLOCKS_PER_GROUP(sb) / max(blocks_per_dir, BLOCK_COST);
	if (max_debt * INODE_COST > inodes_per_group)
		max_debt = inodes_per_group / INODE_COST;
	if (max_debt > 255)
		max_debt = 255;
	if (max_debt == 0)
		max_debt = 1;

What is the use of debts in allocation. ??

Is it done to make efficient use of free disk space ??

--
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