linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port
Date: Mon, 25 Jan 2016 19:14:05 +0200	[thread overview]
Message-ID: <56A657DD.8080602@ti.com> (raw)
In-Reply-To: <20160122204018.GA3883@linutronix.de>

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

  reply	other threads:[~2016-01-25 17:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  9:08 [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith
2016-01-18 20:18 ` Sebastian Andrzej Siewior
2016-01-19  2:29   ` Mike Galbraith
2016-01-21 12:54     ` Sebastian Andrzej Siewior
2016-01-22 12:24       ` Grygorii Strashko
2016-01-22 13:19         ` Sebastian Andrzej Siewior
2016-01-22 13:34           ` Grygorii Strashko
2016-01-22 14:14             ` Sebastian Andrzej Siewior
2016-01-22 15:04               ` Grygorii Strashko
2016-01-22 18:21                 ` Grygorii Strashko
2016-02-21 15:11       ` [patch] sched,rt: __always_inline preemptible_lazy() Mike Galbraith
2016-01-19  4:41   ` [rfc patch v4.4-rt2] sched: fix up preempt lazy forward port Mike Galbraith
2016-01-19  5:14     ` Mike Galbraith
2016-01-22 11:58   ` Grygorii Strashko
2016-01-22 12:54     ` Sebastian Andrzej Siewior
2016-01-22 20:40       ` Sebastian Andrzej Siewior
2016-01-25 17:14         ` Grygorii Strashko [this message]
2016-02-01 13:04           ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A657DD.8080602@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).