Re: [PATCH v2] x86/traps.c: refactor preemption and interrupt flag handling

From: Borislav Petkov
Date: Sun Jan 17 2016 - 12:49:57 EST


On Sun, Jan 17, 2016 at 07:09:44PM +0600, Alexander Kuleshov wrote:
> The arch/x86/kernel/traps.c contains definition of two pair of helpers
> conditional_{sti,cli} to enable/disable interrupts depends on state of
> the interrupt flag and *preempt* versions of these helpers.
>
> This patch tries to make the preemption and interrupt flag handling more
> readable by removing preempt_conditional_sti() and
> preempt_conditional_cli() helpers and usage preempt_disable() and
> preempt_enable_no_resched() for preemption in place, instead of these helpers.
>
> The contitional_sti() and conditional_cli() are renamed to more understandable
> names: cond_local_irq_enable() and cond_local_irq_disable() respectively. So
> so that one doesn't have to go and lookup the function definition when
> looking at the code flow.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@xxxxxxxxx>
> Suggested-by: Borislav Petkov <bp@xxxxxxx>
> ---
> Changelog v2:
> 1. Use preempt_enable_no_resched() instead of sched_preempt_enable_no_resched()
>
> arch/x86/kernel/traps.c | 47 +++++++++++++++++++----------------------------
> 1 file changed, 19 insertions(+), 28 deletions(-)

Applied, thanks.

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--