Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317071

Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port

From Grygorii Strashko <grygorii.strashko@ti.com>
Newsgroups linux.kernel
Subject Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port
Date 2016-01-25 18:20 +0100
Message-ID <qUSY2-7hD-23@gated-at.bofh.it> (permalink)
References <qSdZ0-6VF-3@gated-at.bofh.it> <qSorp-5DG-23@gated-at.bofh.it> <qTIxI-3xw-19@gated-at.bofh.it> <qTJtM-497-7@gated-at.bofh.it> <qTQOC-Mq-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/22/2016 10:40 PM, Sebastian Andrzej Siewior wrote:
> * Sebastian Andrzej Siewior | 2016-01-22 13:54:43 [+0100]:
>
>>> Should _TIF_WORK_MASK also contain _TIF_NEED_RESCHED_LAZY?
>>
>> Yes, and arm64 lacks the same bits.
>
> That would be this. If a compiler is reading here and knows how to
> improve the following, please let me know :)
>
> diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
> index 46cc07b5cae6..1f36a4eccc72 100644
> --- a/arch/arm/include/asm/thread_info.h
> +++ b/arch/arm/include/asm/thread_info.h
> @@ -143,8 +143,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
>   #define TIF_SYSCALL_TRACE	4	/* syscall trace active */
>   #define TIF_SYSCALL_AUDIT	5	/* syscall auditing active */
>   #define TIF_SYSCALL_TRACEPOINT	6	/* syscall tracepoint instrumentation */
> -#define TIF_SECCOMP		7	/* seccomp syscall filtering active */
> -#define TIF_NEED_RESCHED_LAZY	8
> +#define TIF_SECCOMP		8	/* seccomp syscall filtering active */
> +#define TIF_NEED_RESCHED_LAZY	7
>
>   #define TIF_NOHZ		12	/* in adaptive nohz mode */
>   #define TIF_USING_IWMMXT	17
> @@ -170,7 +170,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
>    * Change these and you break ASM code in entry-common.S
>    */
>   #define _TIF_WORK_MASK		(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
> -				 _TIF_NOTIFY_RESUME | _TIF_UPROBE)
> +				 _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
> +				 _TIF_NEED_RESCHED_LAZY)
>
>   #endif /* __KERNEL__ */
>   #endif /* __ASM_ARM_THREAD_INFO_H */
> diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
> index 30a7228eaceb..c3bd6cbfce4b 100644
> --- a/arch/arm/kernel/entry-common.S
> +++ b/arch/arm/kernel/entry-common.S
> @@ -36,7 +36,9 @@
>    UNWIND(.cantunwind	)
>   	disable_irq_notrace			@ disable interrupts
>   	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
> -	tst	r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
> +	tst	r1, #((_TIF_SYSCALL_WORK | _TIF_WORK_MASK) & ~_TIF_SECCOMP)
> +	bne	fast_work_pending
		^^^^^^^^^^^^^^^^

> +	tst	r1, #_TIF_SECCOMP
>   	bne	fast_work_pending
		^^^^^^^^^^^^^^^^^

Should it be "fast_work_pending" in both cases?

>
>   	/* perform architecture specific actions before user return */
> @@ -62,8 +64,11 @@ ENDPROC(ret_fast_syscall)
>   	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
>   	disable_irq_notrace			@ disable interrupts
>   	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
> -	tst	r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
> +	tst	r1, #((_TIF_SYSCALL_WORK | _TIF_WORK_MASK) & ~_TIF_SECCOMP)
> +	bne 	do_slower_path
> +	tst	r1, #_TIF_SECCOMP
>   	beq	no_work_pending
> +do_slower_path:
>    UNWIND(.fnend		)
>   ENDPROC(ret_fast_syscall)
>
[...]

-- 
regards,
-grygorii

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-01-18 10:10 +0100
  Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-18 21:20 +0100
    Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-01-19 03:40 +0100
      Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-21 14:00 +0100
        Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-22 13:30 +0100
          Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-22 14:20 +0100
            Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-22 14:40 +0100
              Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-22 15:20 +0100
                Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-22 16:10 +0100
                Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-22 19:30 +0100
    Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-01-19 05:50 +0100
      Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-01-19 06:20 +0100
    Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-22 13:00 +0100
      Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-22 14:00 +0100
        Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-22 21:50 +0100
          Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Grygorii Strashko <grygorii.strashko@ti.com> - 2016-01-25 18:20 +0100

csiph-web