本文整理汇总了C++中set_cpus_allowed_ptr函数的典型用法代码示例。如果您正苦于以下问题:C++ set_cpus_allowed_ptr函数的具体用法?C++ set_cpus_allowed_ptr怎么用?C++ set_cpus_allowed_ptr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_cpus_allowed_ptr函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: svc_pool_map_set_cpumask
/*
* Set the given thread's cpus_allowed mask so that it
* will only run on cpus in the given pool.
*/
static inline void
svc_pool_map_set_cpumask(struct task_struct *task, unsigned int pidx)
{
struct svc_pool_map *m = &svc_pool_map;
unsigned int node = m->pool_to[pidx];
/*
* The caller checks for sv_nrpools > 1, which
* implies that we've been initialized.
*/
WARN_ON_ONCE(m->count == 0);
if (m->count == 0)
return;
switch (m->mode) {
case SVC_POOL_PERCPU:
{
set_cpus_allowed_ptr(task, cpumask_of(node));
break;
}
case SVC_POOL_PERNODE:
{
set_cpus_allowed_ptr(task, cpumask_of_node(node));
break;
}
}
}
示例2: cmci_rediscover
/*
* After a CPU went down cycle through all the others and rediscover
* Must run in process context.
*/
void cmci_rediscover(int dying)
{
int banks;
int cpu;
cpumask_var_t old;
if (!cmci_supported(&banks))
return;
if (!alloc_cpumask_var(&old, GFP_KERNEL))
return;
cpumask_copy(old, ¤t->cpus_allowed);
for_each_online_cpu(cpu) {
if (cpu == dying)
continue;
if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
continue;
/* Recheck banks in case CPUs don't all have the same */
if (cmci_supported(&banks))
cmci_discover(banks, 0);
}
set_cpus_allowed_ptr(current, old);
free_cpumask_var(old);
}
示例3: smp_cpus_done
void __init smp_cpus_done(unsigned int max_cpus)
{
cpumask_var_t old_mask;
/* We want the setup_cpu() here to be called from CPU 0, but our
* init thread may have been "borrowed" by another CPU in the meantime
* se we pin us down to CPU 0 for a short while
*/
alloc_cpumask_var(&old_mask, GFP_NOWAIT);
cpumask_copy(old_mask, tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
if (smp_ops && smp_ops->setup_cpu)
smp_ops->setup_cpu(boot_cpuid);
set_cpus_allowed_ptr(current, old_mask);
free_cpumask_var(old_mask);
if (smp_ops && smp_ops->bringup_done)
smp_ops->bringup_done();
dump_numa_cpu_topology();
set_sched_topology(powerpc_topology);
}
示例4: meson_trustzone_efuse
int meson_trustzone_efuse(struct efuse_hal_api_arg* arg)
{
int ret;
if (!arg) {
return -1;
}
set_cpus_allowed_ptr(current, cpumask_of(0));
__cpuc_flush_dcache_area(__va(arg->buffer_phy), arg->size);
outer_clean_range((arg->buffer_phy), (arg->buffer_phy + arg->size));
__cpuc_flush_dcache_area(__va(arg->retcnt_phy), sizeof(unsigned int));
outer_clean_range(arg->retcnt_phy, (arg->retcnt_phy + sizeof(unsigned int)));
__cpuc_flush_dcache_area((void*)arg, sizeof(struct efuse_hal_api_arg));
outer_clean_range(__pa(arg), __pa(arg + 1));
ret = meson_smc_hal_api(TRUSTZONE_HAL_API_EFUSE, __pa(arg));
if (arg->cmd == EFUSE_HAL_API_READ) {
outer_inv_range((arg->buffer_phy), (arg->buffer_phy + arg->size));
dmac_unmap_area(__va(arg->buffer_phy), arg->size, DMA_FROM_DEVICE);
}
outer_inv_range((arg->retcnt_phy), (arg->retcnt_phy + sizeof(unsigned int)));
dmac_unmap_area(__va(arg->buffer_phy), arg->size, DMA_FROM_DEVICE);
return ret;
}
示例5: xpc_hb_checker
static int
xpc_hb_checker(void *ignore)
{
int force_IRQ = 0;
/* */
set_cpus_allowed_ptr(current, cpumask_of(XPC_HB_CHECK_CPU));
/* */
xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
xpc_start_hb_beater();
while (!xpc_exiting) {
dev_dbg(xpc_part, "woke up with %d ticks rem; %d IRQs have "
"been received\n",
(int)(xpc_hb_check_timeout - jiffies),
xpc_activate_IRQ_rcvd);
/* */
if (time_is_before_eq_jiffies(xpc_hb_check_timeout)) {
xpc_hb_check_timeout = jiffies +
(xpc_hb_check_interval * HZ);
dev_dbg(xpc_part, "checking remote heartbeats\n");
xpc_check_remote_hb();
/*
*/
if (is_shub())
force_IRQ = 1;
}
/* */
if (xpc_activate_IRQ_rcvd > 0 || force_IRQ != 0) {
force_IRQ = 0;
dev_dbg(xpc_part, "processing activate IRQs "
"received\n");
xpc_arch_ops.process_activate_IRQ_rcvd();
}
/* */
(void)wait_event_interruptible(xpc_activate_IRQ_wq,
(time_is_before_eq_jiffies(
xpc_hb_check_timeout) ||
xpc_activate_IRQ_rcvd > 0 ||
xpc_exiting));
}
xpc_stop_hb_beater();
dev_dbg(xpc_part, "heartbeat checker is exiting\n");
/* */
complete(&xpc_hb_checker_exited);
return 0;
}