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


Groups > linux.kernel > #1260434

Re: [PATCH v1 19/20] ARC: [plat-eznps] replace sync with proper cpu barrier

From Vineet Gupta <Vineet.Gupta1@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH v1 19/20] ARC: [plat-eznps] replace sync with proper cpu barrier
Date 2015-11-02 08:50 +0100
Message-ID <qqi2n-2yF-41@gated-at.bofh.it> (permalink)
References <qpEeC-3hu-3@gated-at.bofh.it> <qqi2n-2yF-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


+CC Peter.

On Saturday 31 October 2015 06:53 PM, Noam Camus wrote:
> From: Tal Zilcer <talz@ezchip.com>
>
> In SMT system like we have the generic "sync" is not working with
> HW threads. The replacement is "schd.rw" instruction that is served
> as cpu barrier for HW threads.
> Signed-off-by: Noam Camus <noamc@ezchip.com>
> ---
>  arch/arc/kernel/ctx_sw.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arc/kernel/ctx_sw.c b/arch/arc/kernel/ctx_sw.c
> index 92e2e82..2a2f50e 100644
> --- a/arch/arc/kernel/ctx_sw.c
> +++ b/arch/arc/kernel/ctx_sw.c
> @@ -61,7 +61,11 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
>  		"st      sp, [r24]       \n\t"
>  #endif
>  
> +#ifdef CONFIG_EZNPS_MTM_EXT
> +		".word %5   \n\t"
> +#else
>  		"sync   \n\t"
> +#endif
>  
>  		/*
>  		 * setup _current_task with incoming tsk.
> @@ -122,6 +126,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
>  #ifdef CONFIG_ARC_PLAT_EZNPS
>  		, "i"(CTOP_AUX_LOGIC_GLOBAL_ID)
>  #endif
> +#ifdef CONFIG_EZNPS_MTM_EXT
> +		, "i"(CTOP_INST_SCHD_RW)
> +#endif
>  		: "blink"
>  	);

Since u bring this up - I think we don't need the original SYNC and/or SMT thread
schedule at all.
The SYNC here is a historic relic at best and we can get rid of it per reasoning
below:

In UP context it is obviously useless, why would we want to stall the core for all
updates to stack memory of t0 to complete before loading kernel ode callee
registers from t1 stack's memory.

In SMP, we could have a potential race in which outdoing task could be
concurrently picked for running, thus the writes to stack here need to be visible
before the reads from stack on other core. But I think since this is the same rq,
there would be a taken spinlock and once a core gives it up, an smp barrier would
come naturally.

Peter do u concur ?
--
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/

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


Thread

[PATCH v1 00/20] eznps a new ARC platform Noam Camus <noamc@ezchip.com> - 2015-10-31 14:20 +0100
  Re: [PATCH v1 02/20] clocksource: Add NPS400 timers driver Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-01 21:50 +0100
    RE: [PATCH v1 02/20] clocksource: Add NPS400 timers driver Noam Camus <noamc@ezchip.com> - 2015-11-02 09:00 +0100
  RE: [PATCH v1 07/20] ARC: mm: use generic macros _BITUL() Noam Camus <noamc@ezchip.com> - 2015-11-02 07:30 +0100
  Re: [PATCH v1 07/20] ARC: mm: use generic macros _BITUL() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 07:30 +0100
  Re: [PATCH v1 09/20] ARC: add CONFIG_CLKSRC_OF support to  time_init() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 07:40 +0100
  Re: [PATCH v1 08/20] ARC: Use res_service as entry point for  secondaries Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 07:40 +0100
    RE: [PATCH v1 08/20] ARC: Use res_service as entry point for  secondaries Noam Camus <noamc@ezchip.com> - 2015-11-02 09:10 +0100
  Re: [PATCH v1 19/20] ARC: [plat-eznps] replace sync with proper cpu  barrier Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 08:50 +0100
    Re: [PATCH v1 19/20] ARC: [plat-eznps] replace sync with proper cpu  barrier Peter Zijlstra <peterz@infradead.org> - 2015-11-02 10:30 +0100
  Re: [PATCH v1 16/20] ARC: [plat-eznps] Use dedicated cpu_relax() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 09:00 +0100
  Re: [PATCH v1 18/20] ARC: [plat-eznps] define IPI_IRQ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 09:00 +0100
    RE: [PATCH v1 18/20] ARC: [plat-eznps] define IPI_IRQ Noam Camus <noamc@ezchip.com> - 2015-11-02 13:20 +0100
  Re: [PATCH v1 14/20] ARC: [plat-eznps] Use dedicated SMP barriers Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 09:10 +0100
    RE: [PATCH v1 14/20] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus <noamc@ezchip.com> - 2015-11-02 14:10 +0100
  Re: [PATCH v1 05/20] ARC: rwlock: disable interrupts in !LLSC variant Peter Zijlstra <peterz@infradead.org> - 2015-11-02 10:20 +0100
  Re: [PATCH v1 16/20] ARC: [plat-eznps] Use dedicated cpu_relax() Peter Zijlstra <peterz@infradead.org> - 2015-11-02 10:30 +0100
    RE: [PATCH v1 16/20] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus <noamc@ezchip.com> - 2015-11-03 15:10 +0100
  Re: [PATCH v1 05/20] ARC: rwlock: disable interrupts in !LLSC variant Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 10:50 +0100
    Re: [PATCH v1 05/20] ARC: rwlock: disable interrupts in !LLSC variant Peter Zijlstra <peterz@infradead.org> - 2015-11-02 11:10 +0100
  Re: [PATCH v1 11/20] ARC: [plat-eznps] Add eznps platform Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 12:00 +0100
    RE: [PATCH v1 11/20] ARC: [plat-eznps] Add eznps platform Noam Camus <noamc@ezchip.com> - 2015-11-03 17:10 +0100
    RE: [PATCH v1 11/20] ARC: [plat-eznps] Add eznps platform Noam Camus <noamc@ezchip.com> - 2015-11-04 13:40 +0100
  Re: [PATCH v1 02/20] clocksource: Add NPS400 timers driver Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 12:10 +0100
    RE: [PATCH v1 02/20] clocksource: Add NPS400 timers driver Noam Camus <noamc@ezchip.com> - 2015-11-03 17:10 +0100
  Re: [PATCH v1 20/20] ARC: Add eznps platform to Kconfig and Makefile Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 12:10 +0100
    RE: [PATCH v1 20/20] ARC: Add eznps platform to Kconfig and Makefile Noam Camus <noamc@ezchip.com> - 2015-11-03 16:40 +0100
  Re: [PATCH v1 13/20] ARC: [plat-eznps] Use dedicated  bitops/atomic/cmpxchg Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-02 13:00 +0100
  Re: [PATCH v1 00/20] eznps a new ARC platform Vineet Gupta <vgupta@synopsys.com> - 2015-11-04 16:40 +0100
    RE: [PATCH v1 00/20] eznps a new ARC platform Noam Camus <noamc@ezchip.com> - 2015-11-04 17:00 +0100
      RE: [PATCH v1 00/20] eznps a new ARC platform Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-04 18:50 +0100
  Re: [PATCH v1 11/20] ARC: [plat-eznps] Add eznps platform Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-05 06:20 +0100
  Re: [PATCH v2 03/19] clocksource: Add NPS400 timers driver Thomas Gleixner <tglx@linutronix.de> - 2015-11-07 12:30 +0100
  Re: [PATCH v2 04/19] irqchip: add nps Internal and external  irqchips Thomas Gleixner <tglx@linutronix.de> - 2015-11-07 12:40 +0100
    Re: [PATCH v2 04/19] irqchip: add nps Internal and external irqchips Noam Camus <noamc@ezchip.com> - 2015-11-07 22:00 +0100
      Re: [PATCH v2 04/19] irqchip: add nps Internal and external  irqchips Thomas Gleixner <tglx@linutronix.de> - 2015-11-08 01:00 +0100
  Re: [PATCH v2 16/19] ARC: [plat-eznps] Use dedicated cpu_relax() Peter Zijlstra <peterz@infradead.org> - 2015-11-09 11:10 +0100
    Re: [PATCH v2 16/19] ARC: [plat-eznps] Use dedicated cpu_relax() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-11-09 11:30 +0100
      Re: [PATCH v2 16/19] ARC: [plat-eznps] Use dedicated cpu_relax() Peter Zijlstra <peterz@infradead.org> - 2015-11-09 11:50 +0100
        Re: [PATCH v2 16/19] ARC: [plat-eznps] Use dedicated cpu_relax() Vineet Gupta <vgupta@synopsys.com> - 2015-11-09 13:30 +0100
          Re: [PATCH v2 16/19] ARC: [plat-eznps] Use dedicated cpu_relax() Peter Zijlstra <peterz@infradead.org> - 2015-11-09 14:00 +0100

csiph-web