[PATCH 03/34] powerpc: Use CONFIG_PREEMPTION

Michael Ellerman mpe at ellerman.id.au
Wed Oct 16 20:33:08 AEDT 2019


Christophe Leroy <christophe.leroy at c-s.fr> writes:
> Le 15/10/2019 à 21:17, Sebastian Andrzej Siewior a écrit :
>> From: Thomas Gleixner <tglx at linutronix.de>
>> 
>> CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT.
>> Both PREEMPT and PREEMPT_RT require the same functionality which today
>> depends on CONFIG_PREEMPT.
>> 
>> Switch the entry code over to use CONFIG_PREEMPTION. Add PREEMPT_RT
>> output in __die().
>
> powerpc doesn't select ARCH_SUPPORTS_RT, so this change is useless as 
> CONFIG_PREEMPT_RT cannot be selected.

Yeah I don't think there's any point adding the "_RT" to the __die()
output until/if we ever start supporting PREEMPT_RT.

cheers


>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 3e56c9c2f16ee..8ead8d6e1cbc8 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -106,7 +106,7 @@ config LOCKDEP_SUPPORT
>>   config GENERIC_LOCKBREAK
>>   	bool
>>   	default y
>> -	depends on SMP && PREEMPT
>> +	depends on SMP && PREEMPTION
>>   
>>   config GENERIC_HWEIGHT
>>   	bool
>> diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
>> index d60908ea37fb9..e1a4c39b83b86 100644
>> --- a/arch/powerpc/kernel/entry_32.S
>> +++ b/arch/powerpc/kernel/entry_32.S
>> @@ -897,7 +897,7 @@ user_exc_return:		/* r10 contains MSR_KERNEL here */
>>   	bne-	0b
>>   1:
>>   
>> -#ifdef CONFIG_PREEMPT
>> +#ifdef CONFIG_PREEMPTION
>>   	/* check current_thread_info->preempt_count */
>>   	lwz	r0,TI_PREEMPT(r2)
>>   	cmpwi	0,r0,0		/* if non-zero, just restore regs and return */
>> @@ -921,7 +921,7 @@ user_exc_return:		/* r10 contains MSR_KERNEL here */
>>   	 */
>>   	bl	trace_hardirqs_on
>>   #endif
>> -#endif /* CONFIG_PREEMPT */
>> +#endif /* CONFIG_PREEMPTION */
>>   restore_kuap:
>>   	kuap_restore r1, r2, r9, r10, r0
>>   
>> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
>> index 6467bdab8d405..83733376533e8 100644
>> --- a/arch/powerpc/kernel/entry_64.S
>> +++ b/arch/powerpc/kernel/entry_64.S
>> @@ -840,7 +840,7 @@ _GLOBAL(ret_from_except_lite)
>>   	bne-	0b
>>   1:
>>   
>> -#ifdef CONFIG_PREEMPT
>> +#ifdef CONFIG_PREEMPTION
>>   	/* Check if we need to preempt */
>>   	andi.	r0,r4,_TIF_NEED_RESCHED
>>   	beq+	restore
>> @@ -871,7 +871,7 @@ _GLOBAL(ret_from_except_lite)
>>   	li	r10,MSR_RI
>>   	mtmsrd	r10,1		  /* Update machine state */
>>   #endif /* CONFIG_PPC_BOOK3E */
>> -#endif /* CONFIG_PREEMPT */
>> +#endif /* CONFIG_PREEMPTION */
>>   
>>   	.globl	fast_exc_return_irq
>>   fast_exc_return_irq:
>> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
>> index 82f43535e6867..23d2f20be4f2e 100644
>> --- a/arch/powerpc/kernel/traps.c
>> +++ b/arch/powerpc/kernel/traps.c
>> @@ -252,14 +252,19 @@ NOKPROBE_SYMBOL(oops_end);
>>   
>>   static int __die(const char *str, struct pt_regs *regs, long err)
>>   {
>> +	const char *pr = "";
>> +
>
> Please follow the same approach as already existing. Don't add a local 
> var for that.
>
>>   	printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
>>   
>> +	if (IS_ENABLED(CONFIG_PREEMPTION))
>> +		pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT";
>> +
>
> drop
>
>>   	printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s%s %s\n",
>
> Add one %s
>
>>   	       IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
>>   	       PAGE_SIZE / 1024,
>>   	       early_radix_enabled() ? " MMU=Radix" : "",
>>   	       early_mmu_has_feature(MMU_FTR_HPTE_TABLE) ? " MMU=Hash" : "",
>> -	       IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
>
> Replace by: 	IS_ENABLED(CONFIG_PREEMPTION) ? " PREEMPT" : ""
>
>> +	       pr,
>
> add something like: IS_ENABLED(CONFIG_PREEMPT_RT) ? "_RT" : ""
>
>>   	       IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
>>   	       IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
>>   	       debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
>> 
>
> Christophe


More information about the Linuxppc-dev mailing list