在全志R16的tinav2.1系统下关闭CPU的hotplug的打印(分色排版)

来源:互联网 发布:zodgame账号淘宝 编辑:程序博客网 时间:2024/05/29 16:29

在全志R16的tinav2.1系统下关闭CPU的hotplug的打印

2017/9/5 17:27

版本:V1.0

 

 

1、全志R16的tinav2.1系统下,在串口中经常会显示CPU热插拔hotplug的打印,并且不停地显示

[ 2842.461841] [hotplug]: cpu(0) try to kill cpu(1)

[ 2842.468034] [hotplug]: cpu1 is killed! .

[ 2842.510453] CPU1: Booted secondary processor

[ 2842.530462] CPU2: Booted secondary processor

[ 2844.036078] CPU2: shutdown

[ 2844.040645] [hotplug]: cpu(0) try to kill cpu(2)

[ 2844.047033] [hotplug]: cpu2 is killed! .

[ 2844.076101] CPU1: shutdown

 

 

 

 

2、查找并关闭:热插拔hotplug的打印

rootroot@cm-System-Product-Name:~$ cd /home/wwt

rootroot@cm-System-Product-Name:/home/wwt$

rootroot@cm-System-Product-Name:/home/wwt$ tar zxvf r16_tinav2.1_csdn_20170901_1040.tar.gz 

rootroot@cm-System-Product-Name:/home/wwt$ mv tina openmp_csdn_tinav2.1

rootroot@cm-System-Product-Name:/home/wwt$ cd openmp_csdn_tinav2.1/lichee/linux-3.4/

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1/lichee/linux-3.4$grep "Booted secondary processor" . -R

grep: ./.git/svn: 没有那个文件或目录

./arch/arm/kernel/smp.c:printk("CPU%u: Booted secondary processor\n", cpu);

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1/lichee/linux-3.4$

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1/lichee/linux-3.4$

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1/lichee/linux-3.4$grep "is killed!" . -R

grep: ./.git/svn: 没有那个文件或目录

./arch/arm/mach-sunxi/sun8iw6-mcpm.c: pr_debug("sun8i hotplug: cpu:%d is killed!\n", cpu);

./arch/arm/mach-sunxi/sun8i-mcpm.c: pr_debug("sun8i hotplug: cpu:%d is killed!\n", cpu);

./arch/arm/mach-sunxi/sunxi-hotplug.c:pr_info("[hotplug]: cpu%d is killed! .\n", cpu);

./arch/arm/mach-sunxi/sun9i-mcpm.c: pr_debug("sun9i hotplug: cpu:%d is killed!\n", cpu);

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1/lichee/linux-3.4$

 

 

很容易找到这里:

W:\openmp_csdn_tinav2.1\lichee\linux-3.4\arch\arm\kernel\smp.c

/*

 * called on the thread which is asking for a CPU to be shutdown -

 * waits until shutdown has completed, or it is timed out.

 */

void __cpuinit __cpu_die(unsigned int cpu)

{

if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {

pr_err("CPU%u: cpu didn't die\n", cpu);

return;

}

//printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);

 

if (!platform_cpu_kill(cpu))

printk("CPU%u: unable to kill\n", cpu);

}

 

/*

 * This is the secondary CPU boot entry.  We're using this CPUs

 * idle thread stack, but a set of temporary page tables.

 */

asmlinkage void __cpuinit secondary_start_kernel(void)

{

struct mm_struct *mm = &init_mm;

unsigned int cpu;

 

/*

 * The identity mapping is uncached (strongly ordered), so

 * switch away from it before attempting any exclusive accesses.

 */

cpu_switch_mm(mm->pgd, mm);

enter_lazy_tlb(mm, current);

local_flush_tlb_all();

 

/*

 * All kernel threads share the same mm context; grab a

 * reference and switch to it.

 */

cpu = smp_processor_id();

atomic_inc(&mm->mm_count);

current->active_mm = mm;

cpumask_set_cpu(cpu, mm_cpumask(mm));

 

//printk("CPU%u: Booted secondary processor\n", cpu);

 

cpu_init();

preempt_disable();

trace_hardirqs_off();

 

/*

 * Give the platform a chance to do its own initialisation.

 */

platform_secondary_init(cpu);

 

notify_cpu_starting(cpu);

 

calibrate_delay();

 

smp_store_cpu_info(cpu);

 

/*

 * OK, now it's safe to let the boot CPU continue.  Wait for

 * the CPU migration code to notice that the CPU is online

 * before we continue - which happens after __cpu_up returns.

 */

set_cpu_online(cpu, true);

complete(&cpu_running);

 

local_irq_enable();

local_fiq_enable();

 

/*

 * OK, it's off to the idle thread for us

 */

cpu_idle();

}

 

 

W:\openmp_csdn_tinav2.1\lichee\linux-3.4\arch\arm\mach-sunxi\sunxi-hotplug.c

int  sunxi_cpu_kill(unsigned int cpu)

{

int k;

int tmp_cpu = get_cpu();

put_cpu();

//pr_info("[hotplug]: cpu(%d) try to kill cpu(%d)\n", tmp_cpu, cpu);

 

for (k = 0; k < 1000; k++) {

if (cpumask_test_cpu(cpu, &dead_cpus) && IS_WFI_MODE(cpu)) {

/* power-off cpu */

    disable_cpu(cpu);

 

//pr_info("[hotplug]: cpu%d is killed! .\n", cpu);

 

return 1;

}

mdelay(1);

}

 

pr_err("[hotplug]: try to kill cpu:%d failed!\n", cpu);

return 0;

}

 

 

 

 

3、现在编译打包刷机之后就不会看见讨厌的多核CPU的热插拔hotplug的打印

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1$ make -j12

rootroot@cm-System-Product-Name:/home/wwt/openmp_csdn_tinav2.1$ pack -d

 

 

阅读全文
0 0
原创粉丝点击