您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tick_nohz_restart函数代码示例

51自学网 2021-06-03 08:49:57
  C++
这篇教程C++ tick_nohz_restart函数代码示例写得很实用,希望能帮到您。

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

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

示例1: tick_nohz_idle_exit

/** * tick_nohz_idle_exit - restart the idle tick from the idle task * * Restart the idle tick when the CPU is woken up from idle * This also exit the RCU extended quiescent state. The CPU * can use RCU again after this function is called. */void tick_nohz_idle_exit(void){	int cpu = smp_processor_id();	struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);#ifndef CONFIG_VIRT_CPU_ACCOUNTING	unsigned long ticks;#endif	ktime_t now;	local_irq_disable();	WARN_ON_ONCE(!ts->inidle);	ts->inidle = 0;	if (ts->idle_active || ts->tick_stopped)		now = ktime_get();	if (ts->idle_active)		tick_nohz_stop_idle(cpu, now);	if (!ts->tick_stopped) {		local_irq_enable();		return;	}	/* Update jiffies first */	select_nohz_load_balancer(0);	tick_do_update_jiffies64(now);#ifdef CONFIG_MTK_SCHED_CMP	update_cpu_load_nohz();#endif#ifndef CONFIG_VIRT_CPU_ACCOUNTING	/*	 * We stopped the tick in idle. Update process times would miss the	 * time we slept as update_process_times does only a 1 tick	 * accounting. Enforce that this is accounted to idle !	 */	ticks = jiffies - ts->idle_jiffies;	/*	 * We might be one off. Do not randomly account a huge number of ticks!	 */	if (ticks && ticks < LONG_MAX)		account_idle_ticks(ticks);#endif	calc_load_exit_idle();	touch_softlockup_watchdog();	/*	 * Cancel the scheduled timer and restore the tick	 */	ts->tick_stopped  = 0;	ts->idle_exittime = now;	tick_nohz_restart(ts, now);	local_irq_enable();}
开发者ID:4Fwolf,项目名称:motorola-hawk-kernel-3.4.67,代码行数:66,


示例2: tick_nohz_kick_tick

static void tick_nohz_kick_tick(int cpu, ktime_t now){#if 0		struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);	ktime_t delta;	delta =	ktime_sub(hrtimer_get_expires(&ts->sched_timer), now);	if (delta.tv64 <= tick_period.tv64)		return;	tick_nohz_restart(ts, now);#endif}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:15,


示例3: tick_nohz_kick_tick

/* * When NOHZ is enabled and the tick is stopped, we need to kick the * tick timer from irq_enter() so that the jiffies update is kept * alive during long running softirqs. That's ugly as hell, but * correctness is key even if we need to fix the offending softirq in * the first place. * * Note, this is different to tick_nohz_restart. We just kick the * timer and do not touch the other magic bits which need to be done * when idle is left. */static void tick_nohz_kick_tick(int cpu, ktime_t now){#if 0	/* Switch back to 2.6.27 behaviour */	struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);	ktime_t delta;	/*	 * Do not touch the tick device, when the next expiry is either	 * already reached or less/equal than the tick period.	 */	delta =	ktime_sub(hrtimer_get_expires(&ts->sched_timer), now);	if (delta.tv64 <= tick_period.tv64)		return;	tick_nohz_restart(ts, now);#endif}
开发者ID:marcero,项目名称:ab73kernel-Hannspad-2632,代码行数:30,


示例4: tick_nohz_restart_sched_tick

void tick_nohz_restart_sched_tick(void)#endif{	int cpu = smp_processor_id();	struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);#ifndef CONFIG_VIRT_CPU_ACCOUNTING	unsigned long ticks;#endif	ktime_t now;	local_irq_disable();	if (ts->idle_active || (ts->inidle && ts->tick_stopped))		now = ktime_get();	if (ts->idle_active)		tick_nohz_stop_idle(cpu, now);	if (!ts->inidle || !ts->tick_stopped) {		ts->inidle = 0;#ifdef CONFIG_DATAPLANE		if (!user_idle)#endif		local_irq_enable();		return;	}	ts->inidle = 0;	rcu_exit_nohz();	/* Update jiffies first */	select_nohz_load_balancer(0);	tick_do_update_jiffies64(now);	cpumask_clear_cpu(cpu, nohz_cpu_mask);#ifndef CONFIG_VIRT_CPU_ACCOUNTING	/*	 * We stopped the tick in idle. Update process times would miss the	 * time we slept as update_process_times does only a 1 tick	 * accounting. Enforce that this is accounted to idle !	 */	ticks = jiffies - ts->idle_jiffies;	/*	 * We might be one off. Do not randomly account a huge number of ticks!	 */	if (ticks && ticks < LONG_MAX)#ifdef CONFIG_DATAPLANE	{		if (user_idle) {			cputime_t cpu_time = jiffies_to_cputime(ticks);			account_user_time(current, cpu_time,					  cputime_to_scaled(cpu_time));		} else {			account_idle_ticks(ticks);		}	}#else		account_idle_ticks(ticks);#endif#endif	touch_softlockup_watchdog();	/*	 * Cancel the scheduled timer and restore the tick	 */	ts->tick_stopped  = 0;	ts->idle_exittime = now;	tick_nohz_restart(ts, now);#ifdef CONFIG_DATAPLANE	if (!user_idle)#endif	local_irq_enable();}
开发者ID:rslotte,项目名称:OGS-Tile,代码行数:75,



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


C++ tick_nohz_stop_idle函数代码示例
C++ tick_init_jiffy_update函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。