当前位置: 首页>>代码示例>>C++>>正文


C++ calc_period_shift函数代码示例

本文整理汇总了C++中calc_period_shift函数的典型用法代码示例。如果您正苦于以下问题:C++ calc_period_shift函数的具体用法?C++ calc_period_shift怎么用?C++ calc_period_shift使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了calc_period_shift函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: page_writeback_init

/*
 * Called early on to tune the page writeback dirty limits.
 *
 * We used to scale dirty pages according to how total memory
 * related to pages that could be allocated for buffers (by
 * comparing nr_free_buffer_pages() to vm_total_pages.
 *
 * However, that was when we used "dirty_ratio" to scale with
 * all memory, and we don't do that any more. "dirty_ratio"
 * is now applied to total non-HIGHPAGE memory (by subtracting
 * totalhigh_pages from vm_total_pages), and as such we can't
 * get into the old insane situation any more where we had
 * large amounts of dirty pages compared to a small amount of
 * non-HIGHMEM memory.
 *
 * But we might still want to scale the dirty_ratio by how
 * much memory the box has..
 */
void __init page_writeback_init(void)
{
	int shift;

	writeback_set_ratelimit();
	register_cpu_notifier(&ratelimit_nb);

	shift = calc_period_shift();
	prop_descriptor_init(&vm_completions, shift);
	prop_descriptor_init(&vm_dirties, shift);
}
开发者ID:printusrzero,项目名称:hwp6s-kernel,代码行数:29,代码来源:page-writeback.c

示例2: dirty_ratio_handler

/*
 * update the period when the dirty ratio changes.
 */
int dirty_ratio_handler(struct ctl_table *table, int write,
		struct file *filp, void __user *buffer, size_t *lenp,
		loff_t *ppos)
{
	int old_ratio = vm_dirty_ratio;
	int ret = proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos);
	if (ret == 0 && write && vm_dirty_ratio != old_ratio) {
		int shift = calc_period_shift();
		prop_change_shift(&vm_completions, shift);
		prop_change_shift(&vm_dirties, shift);
	}
	return ret;
}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:16,代码来源:page-writeback.c

示例3: page_writeback_init

/*
 * Called early on to tune the page writeback dirty limits.
 *
 * We used to scale dirty pages according to how total memory
 * related to pages that could be allocated for buffers (by
 * comparing nr_free_buffer_pages() to vm_total_pages.
 *
 * However, that was when we used "dirty_ratio" to scale with
 * all memory, and we don't do that any more. "dirty_ratio"
 * is now applied to total non-HIGHPAGE memory (by subtracting
 * totalhigh_pages from vm_total_pages), and as such we can't
 * get into the old insane situation any more where we had
 * large amounts of dirty pages compared to a small amount of
 * non-HIGHMEM memory.
 *
 * But we might still want to scale the dirty_ratio by how
 * much memory the box has..
 */
void __init page_writeback_init(void)
{
	int shift;

#ifdef CONFIG_DYNAMIC_PAGE_WRITEBACK
	/* Register the dirty page writeback management during suspend/resume */
	register_early_suspend(&dirty_writeback_suspend);
#endif

	writeback_set_ratelimit();
	register_cpu_notifier(&ratelimit_nb);

	shift = calc_period_shift();
	prop_descriptor_init(&vm_completions, shift);
	prop_descriptor_init(&vm_dirties, shift);
}
开发者ID:Neves4,项目名称:DatKernel,代码行数:34,代码来源:page-writeback.c

示例4: page_writeback_init

/*
 * Called early on to tune the page writeback dirty limits.
 *
 * We used to scale dirty pages according to how total memory
 * related to pages that could be allocated for buffers (by
 * comparing nr_free_buffer_pages() to vm_total_pages.
 *
 * However, that was when we used "dirty_ratio" to scale with
 * all memory, and we don't do that any more. "dirty_ratio"
 * is now applied to total non-HIGHPAGE memory (by subtracting
 * totalhigh_pages from vm_total_pages), and as such we can't
 * get into the old insane situation any more where we had
 * large amounts of dirty pages compared to a small amount of
 * non-HIGHMEM memory.
 *
 * But we might still want to scale the dirty_ratio by how
 * much memory the box has..
 */
void __init page_writeback_init(void)
{
	int shift;

	dirty_writeback_interval = resume_dirty_writeback_interval =
			DEFAULT_DIRTY_WRITEBACK_INTERVAL;
	dirty_expire_interval = resume_dirty_expire_interval =
			DEFAULT_DIRTY_EXPIRE_INTERVAL;

	register_early_suspend(&dirty_suspend);

	writeback_set_ratelimit();
	register_cpu_notifier(&ratelimit_nb);

	shift = calc_period_shift();
	prop_descriptor_init(&vm_completions, shift);
	prop_descriptor_init(&vm_dirties, shift);
}
开发者ID:Ntemis,项目名称:Bexus-N,代码行数:36,代码来源:page-writeback.c

示例5: update_completion_period

/*
 * update the period when the dirty threshold changes.
 */
static void update_completion_period(void)
{
	int shift = calc_period_shift();
	prop_change_shift(&vm_completions, shift);
	prop_change_shift(&vm_dirties, shift);
}
开发者ID:printusrzero,项目名称:hwp6s-kernel,代码行数:9,代码来源:page-writeback.c


注:本文中的calc_period_shift函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。