Re: [PATCH 1/3] powerpc: copy preempt.h into arch/include/asm

From: Christophe Leroy
Date: Mon Dec 02 2024 - 13:17:47 EST




Le 02/12/2024 à 15:05, Shrikanth Hegde a écrit :


On 11/27/24 12:07, Christophe Leroy wrote:


Le 25/11/2024 à 05:22, Shrikanth Hegde a écrit :
PowerPC uses asm-generic preempt definitions as of now.
Copy that into arch/asm so that arch specific changes can be done.
This would help the next patch for enabling dynamic preemption.


The reason I want the content instead was to allow future patches where I thought of making preempt count per paca for ppc64 atleast. generic code assumes it is per thread. If this change is to be done at that point, that is fair too. I am okay with it.

I think it is better to keep series minimal and consistent. If you have a futur plan, no problem, keep it future and do everything at once unless it is heavy and better done in two steps.

As we say in French, a lot of water will have flowed under the bridge by then.

I'm sure there will be a lot of discussion when you do that and maybe at the end you will end up with something completely different than what you have in mind at the moment.



Instead of copying all the content of asm-generic version, can you just create a receptacle for your new macros, that will include asm- generic/ preempt.h ?

Look at arch/powerpc/include/asm/percpu.h for exemple.


You mean something like below right?


#ifndef __ASM_POWERPC_PREEMPT_H
#define __ASM_POWERPC_PREEMPT_H

#include <asm-generic/preempt.h>

#if defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY)
DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
#endif

#endif /* __ASM_POWERPC_PREEMPT_H */

Yes exactly.