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 the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux