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


Groups > linux.kernel > #1195445 > unrolled thread

[RFC][PATCH 0/7] sched: Remove finish_arch_switch()

Started byPeter Zijlstra <peterz@infradead.org>
First post2015-07-29 21:30 +0200
Last post2015-07-30 12:00 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFC][PATCH 0/7] sched: Remove finish_arch_switch() Peter Zijlstra <peterz@infradead.org> - 2015-07-29 21:30 +0200
    [RFC][PATCH 3/7] avr32: Remove finish_arch_switch() Peter Zijlstra <peterz@infradead.org> - 2015-07-29 21:30 +0200
      Re: [RFC][PATCH 3/7] avr32: Remove finish_arch_switch() Hans-Christian Egtvedt <egtvedt@samfundet.no> - 2015-07-30 07:50 +0200
    [RFC][PATCH 4/7] score: Remove finish_arch_switch() Peter Zijlstra <peterz@infradead.org> - 2015-07-29 21:30 +0200
    [RFC][PATCH 7/7] sched: Remove finish_arch_switch() Peter Zijlstra <peterz@infradead.org> - 2015-07-29 21:30 +0200
    Re: [RFC][PATCH 0/7] sched: Remove finish_arch_switch() Peter Zijlstra <peterz@infradead.org> - 2015-07-30 12:00 +0200

#1195445 — [RFC][PATCH 0/7] sched: Remove finish_arch_switch()

FromPeter Zijlstra <peterz@infradead.org>
Date2015-07-29 21:30 +0200
Subject[RFC][PATCH 0/7] sched: Remove finish_arch_switch()
Message-ID<pRFd7-AH-3@gated-at.bofh.it>
Hi,

There were only a few architectures utilizing finish_arch_switch() and it looks
like they can all do without.

This means we can remove finish_arch_switch(); partly to make up for
introducing finish_arch_post_lock_switch(), partly to reduce the number of arch
hooks to consider.

Much thanks to Ralf, Will and Chris for helping out with this!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1195448 — [RFC][PATCH 3/7] avr32: Remove finish_arch_switch()

FromPeter Zijlstra <peterz@infradead.org>
Date2015-07-29 21:30 +0200
Subject[RFC][PATCH 3/7] avr32: Remove finish_arch_switch()
Message-ID<pRFd8-AH-17@gated-at.bofh.it>
In reply to#1195445
Fold the tracing hook into switch_to() in order to remove
finish_arch_switch().

Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/avr32/include/asm/switch_to.h |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/arch/avr32/include/asm/switch_to.h
+++ b/arch/avr32/include/asm/switch_to.h
@@ -15,11 +15,13 @@
  */
 #ifdef CONFIG_OWNERSHIP_TRACE
 #include <asm/ocd.h>
-#define finish_arch_switch(prev)			\
+#define ocd_switch(prev, next)				\
 	do {						\
 		ocd_write(PID, prev->pid);		\
-		ocd_write(PID, current->pid);		\
+		ocd_write(PID, next->pid);		\
 	} while(0)
+#else
+#define ocd_switch(prev, next)
 #endif
 
 /*
@@ -38,6 +40,7 @@ extern struct task_struct *__switch_to(s
 				       struct cpu_context *);
 #define switch_to(prev, next, last)					\
 	do {								\
+		ocd_switch(prev, next);					\
 		last = __switch_to(prev, &prev->thread.cpu_context + 1,	\
 				   &next->thread.cpu_context);		\
 	} while (0)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195722 — Re: [RFC][PATCH 3/7] avr32: Remove finish_arch_switch()

FromHans-Christian Egtvedt <egtvedt@samfundet.no>
Date2015-07-30 07:50 +0200
SubjectRe: [RFC][PATCH 3/7] avr32: Remove finish_arch_switch()
Message-ID<pROT8-5YY-13@gated-at.bofh.it>
In reply to#1195448
Around Wed 29 Jul 2015 21:08:51 +0200 or thereabout, Peter Zijlstra wrote:
> Fold the tracing hook into switch_to() in order to remove
> finish_arch_switch().

AFAICT this should work, I do not have a nexus debugger to verify behavior.

> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>

> ---
>  arch/avr32/include/asm/switch_to.h |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> --- a/arch/avr32/include/asm/switch_to.h
> +++ b/arch/avr32/include/asm/switch_to.h
> @@ -15,11 +15,13 @@
>   */
>  #ifdef CONFIG_OWNERSHIP_TRACE
>  #include <asm/ocd.h>
> -#define finish_arch_switch(prev)			\
> +#define ocd_switch(prev, next)				\
>  	do {						\
>  		ocd_write(PID, prev->pid);		\
> -		ocd_write(PID, current->pid);		\
> +		ocd_write(PID, next->pid);		\
>  	} while(0)
> +#else
> +#define ocd_switch(prev, next)
>  #endif
>  
>  /*
> @@ -38,6 +40,7 @@ extern struct task_struct *__switch_to(s
>  				       struct cpu_context *);
>  #define switch_to(prev, next, last)					\
>  	do {								\
> +		ocd_switch(prev, next);					\
>  		last = __switch_to(prev, &prev->thread.cpu_context + 1,	\
>  				   &next->thread.cpu_context);		\
>  	} while (0)
-- 
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195450 — [RFC][PATCH 4/7] score: Remove finish_arch_switch()

FromPeter Zijlstra <peterz@infradead.org>
Date2015-07-29 21:30 +0200
Subject[RFC][PATCH 4/7] score: Remove finish_arch_switch()
Message-ID<pRFd8-AH-23@gated-at.bofh.it>
In reply to#1195445
An empty implementation, make it go away.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/score/include/asm/switch_to.h |    2 --
 1 file changed, 2 deletions(-)

--- a/arch/score/include/asm/switch_to.h
+++ b/arch/score/include/asm/switch_to.h
@@ -8,6 +8,4 @@ do {								\
 	(last) = resume(prev, next, task_thread_info(next));	\
 } while (0)
 
-#define finish_arch_switch(prev)	do {} while (0)
-
 #endif /* _ASM_SCORE_SWITCH_TO_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195451 — [RFC][PATCH 7/7] sched: Remove finish_arch_switch()

FromPeter Zijlstra <peterz@infradead.org>
Date2015-07-29 21:30 +0200
Subject[RFC][PATCH 7/7] sched: Remove finish_arch_switch()
Message-ID<pRFd8-AH-25@gated-at.bofh.it>
In reply to#1195445
One less arch hook..

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/sched/core.c  |    1 -
 kernel/sched/sched.h |    3 ---
 2 files changed, 4 deletions(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2468,7 +2468,6 @@ static struct rq *finish_task_switch(str
 	 */
 	prev_state = prev->state;
 	vtime_task_switch(prev);
-	finish_arch_switch(prev);
 	perf_event_task_sched_in(prev, current);
 	finish_lock_switch(rq, prev);
 	finish_arch_post_lock_switch();
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1055,9 +1055,6 @@ static inline int task_on_rq_migrating(s
 #ifndef prepare_arch_switch
 # define prepare_arch_switch(next)	do { } while (0)
 #endif
-#ifndef finish_arch_switch
-# define finish_arch_switch(prev)	do { } while (0)
-#endif
 #ifndef finish_arch_post_lock_switch
 # define finish_arch_post_lock_switch()	do { } while (0)
 #endif


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195875

FromPeter Zijlstra <peterz@infradead.org>
Date2015-07-30 12:00 +0200
Message-ID<pRSN3-391-1@gated-at.bofh.it>
In reply to#1195445
On Wed, Jul 29, 2015 at 09:08:48PM +0200, Peter Zijlstra wrote:
> Hi,
> 
> There were only a few architectures utilizing finish_arch_switch() and it looks
> like they can all do without.
> 
> This means we can remove finish_arch_switch(); partly to make up for
> introducing finish_arch_post_lock_switch(), partly to reduce the number of arch
> hooks to consider.
> 
> Much thanks to Ralf, Will and Chris for helping out with this!

So the mips patch is already in Ralf's mips-next tree, which means I
have to wait for that to his Linus' tree before I can commit the last
patch in this series.

It also means that all the other patches can go through their respective
arch tree.

So anybody who feels so inclined, go ahead, I'll check after the next
merge window and commit everything that's left -- unless there's
objections of course :-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web