Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Matthew Wilcox
On Mon, Jul 27, 2020 at 12:31:49PM -0400, Alan Stern wrote: > On Mon, Jul 27, 2020 at 04:28:27PM +0100, Matthew Wilcox wrote: > > On Mon, Jul 27, 2020 at 11:17:46AM -0400, Alan Stern wrote: > > > Given a type "T", an object x of type pointer-to-T, and a function > > > "func" that takes various argu

Re: [PATCH 5.7 024/179] dm mpath: pass IO start time to path selector

2020-07-27 Thread Gabriel Krisman Bertazi
Greg Kroah-Hartman writes: > From: Gabriel Krisman Bertazi > > [ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ] > > The HST path selector needs this information to perform path > prediction. For request-based mpath, struct request's io_start_time_ns > is used, while for bio-based, us

Re: [PATCH 5.4 024/138] dm mpath: pass IO start time to path selector

2020-07-27 Thread Gabriel Krisman Bertazi
Greg Kroah-Hartman writes: > From: Gabriel Krisman Bertazi > > [ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ] > > The HST path selector needs this information to perform path > prediction. For request-based mpath, struct request's io_start_time_ns > is used, while for bio-based, us

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Alan Stern
On Mon, Jul 27, 2020 at 04:28:27PM +0100, Matthew Wilcox wrote: > On Mon, Jul 27, 2020 at 11:17:46AM -0400, Alan Stern wrote: > > Given a type "T", an object x of type pointer-to-T, and a function > > "func" that takes various arguments and returns a pointer-to-T, the > > accepted API for calling f

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Paul E. McKenney
On Mon, Jul 27, 2020 at 04:28:27PM +0100, Matthew Wilcox wrote: > On Mon, Jul 27, 2020 at 11:17:46AM -0400, Alan Stern wrote: > > Given a type "T", an object x of type pointer-to-T, and a function > > "func" that takes various arguments and returns a pointer-to-T, the > > accepted API for calling f

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Matthew Wilcox
On Mon, Jul 27, 2020 at 11:17:46AM -0400, Alan Stern wrote: > Given a type "T", an object x of type pointer-to-T, and a function > "func" that takes various arguments and returns a pointer-to-T, the > accepted API for calling func once would be to create once_func() as > follows: > > T *once_func(

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Alan Stern
On Fri, Jul 17, 2020 at 10:28:18PM -0700, Eric Biggers wrote: > I'm still not sure this is the best API. I cast my vote for something along the following lines. It's simple, easily understood and easily used. The approach has two variants: One that returns an integer and one that returns a point

[PATCH 5.4 024/138] dm mpath: pass IO start time to path selector

2020-07-27 Thread Greg Kroah-Hartman
From: Gabriel Krisman Bertazi [ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ] The HST path selector needs this information to perform path prediction. For request-based mpath, struct request's io_start_time_ns is used, while for bio-based, use the start_time stored in dm_io. Signed

[PATCH 5.7 056/179] net: fec: fix hardware time stamping by external devices

2020-07-27 Thread Greg Kroah-Hartman
From: Sergey Organov [ Upstream commit 340746398b67e3ce5019698748ebaa7adf048114 ] Fix support for external PTP-aware devices such as DSA or PTP PHY: Make sure we never time stamp tx packets when hardware time stamping is disabled. Check for PTP PHY being in use and then pass ioctls related to

[PATCH 5.7 024/179] dm mpath: pass IO start time to path selector

2020-07-27 Thread Greg Kroah-Hartman
From: Gabriel Krisman Bertazi [ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ] The HST path selector needs this information to perform path prediction. For request-based mpath, struct request's io_start_time_ns is used, while for bio-based, use the start_time stored in dm_io. Signed

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-27 Thread Matthew Wilcox
On Fri, Jul 17, 2020 at 06:02:47PM -0700, Eric Biggers wrote: > On Fri, Jul 17, 2020 at 01:51:38PM -0400, Alan Stern wrote: > > On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > > > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > > ... > > > > + /* on s

Re: [PATCH 0/9] arm64: Stolen time support

2020-07-27 Thread Steven Price
On 21/07/2020 04:26, zhukeqian wrote: Hi Steven, Hi Keqian, On 2019/8/2 22:50, Steven Price wrote: This series add support for paravirtualized time for arm64 guests and KVM hosts following the specification in Arm's document DEN 0057A: https://developer.arm.com/docs/den0057/

[PATCH] media: ov8856: decrease hs_trail time

2020-07-26 Thread David Lu
To meet mipi hi speed transmission, decrease hs_trail time to pass mipi test. Signed-off-by: David Lu --- drivers/media/i2c/ov8856.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index 4ca27675cc5a..1f1835b14a24

[PATCH 05/21] init: initialize ramdisk_execute_command at compile time

2020-07-26 Thread Christoph Hellwig
Set ramdisk_execute_command to "/init" at compile time. The command line can still override it, but this saves a few instructions and removes a NULL check. Signed-off-by: Christoph Hellwig --- init/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ini

[tip: locking/urgent] locking/lockdep: Fix overflow in presentation of average lock-time

2020-07-25 Thread tip-bot2 for Chris Wilson
Committer: Ingo Molnar CommitterDate: Sat, 25 Jul 2020 21:47:42 +02:00 locking/lockdep: Fix overflow in presentation of average lock-time Though the number of lock-acquisitions is tracked as unsigned long, this is passed as the divisor to div_s64() which interprets it as a s32, giving nonsense

[PATCH] locking/lockdep: Fix overflow in presentation of average lock-time

2020-07-25 Thread Chris Wilson
Though the number of lock-acquisitions is tracked as unsigned long, this is passed as the divisor to div_s64() which interprets it as a s32, giving nonsense values with more than 2 billion acquisitons. E.g. acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg --

[tip: x86/timers] x86/xen/time: Set the X86_FEATURE_TSC_KNOWN_FREQ flag in xen_tsc_khz()

2020-07-25 Thread tip-bot2 for Hayato Ohhashi
: Ingo Molnar CommitterDate: Sat, 25 Jul 2020 15:49:41 +02:00 x86/xen/time: Set the X86_FEATURE_TSC_KNOWN_FREQ flag in xen_tsc_khz() If the TSC frequency is known from the pvclock page, the TSC frequency does not need to be recalibrated. We can avoid recalibration by setting

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-24 Thread Kees Cook
wrote: > > > > The compressed kernel currently contains bogus run-time relocations in > > > > the startup code in head_{32,64}.S, which are generated by the linker, > > > > but must not actually be processed at run-time. > > > > > > > > This gen

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-24 Thread Catalin Marinas
> > On Sat, Jul 04, 2020 at 11:40:55PM -0700, Andrei Vagin wrote: > > > > > On Wed, Jun 24, 2020 at 01:33:15AM -0700, Andrei Vagin wrote: > > > > > > Allocate the time namespace page among VVAR pages and add the logic > > > > > > to han

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-24 Thread Christian Brauner
gt; On Wed, Jun 24, 2020 at 01:33:15AM -0700, Andrei Vagin wrote: > > > > > Allocate the time namespace page among VVAR pages and add the logic > > > > > to handle faults on VVAR properly. > > > > > > > > > > If a task belongs to a time nam

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-24 Thread Thomas Gleixner
Catalin Marinas writes: > On Thu, Jul 23, 2020 at 10:25:35PM +0200, Thomas Gleixner wrote: >> Andrei Vagin writes: >> > On Wed, Jul 22, 2020 at 07:15:06PM +0100, Catalin Marinas wrote: >> > >> > I don't think that we need to handle this case in the kernel. Users >> > must understand what they are

Re: [PATCH 6/8] regulator: mt6359: Set the enable time for LDOs

2020-07-24 Thread Mark Brown
On Thu, Jul 23, 2020 at 08:58:51PM +0800, Hsin-Hsiung Wang wrote: > Add the enable time for LDOs. > This patch is preparing for adding mt6359p regulator support. Acked-by: Mark Brown signature.asc Description: PGP signature

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-24 Thread Catalin Marinas
On Thu, Jul 23, 2020 at 10:25:35PM +0200, Thomas Gleixner wrote: > Andrei Vagin writes: > > On Wed, Jul 22, 2020 at 07:15:06PM +0100, Catalin Marinas wrote: > > > > I don't think that we need to handle this case in the kernel. Users > > must understand what they are doing and have to write code so

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-23 Thread Thomas Gleixner
Andrei Vagin writes: > On Wed, Jul 22, 2020 at 07:15:06PM +0100, Catalin Marinas wrote: > > I don't think that we need to handle this case in the kernel. Users > must understand what they are doing and have to write code so that avoid > these sort of situations. In general, I would say that in mos

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-23 Thread Andrei Vagin
On Wed, Jul 22, 2020 at 07:15:06PM +0100, Catalin Marinas wrote: > On Mon, Jul 13, 2020 at 06:57:43PM -0700, Andrei Vagin wrote: > > On Sat, Jul 04, 2020 at 11:40:55PM -0700, Andrei Vagin wrote: > > > On Wed, Jun 24, 2020 at 01:33:15AM -0700, Andrei Vagin wrote: > > > &g

[PATCH 6/8] regulator: mt6359: Set the enable time for LDOs

2020-07-23 Thread Hsin-Hsiung Wang
Add the enable time for LDOs. This patch is preparing for adding mt6359p regulator support. Signed-off-by: Hsin-Hsiung Wang --- drivers/regulator/mt6359-regulator.c | 65 +++- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/drivers/regulator

Re: [PATCH v5 0/6] arm64: add the time namespace support

2020-07-22 Thread Catalin Marinas
On Mon, Jul 13, 2020 at 06:57:43PM -0700, Andrei Vagin wrote: > On Sat, Jul 04, 2020 at 11:40:55PM -0700, Andrei Vagin wrote: > > On Wed, Jun 24, 2020 at 01:33:15AM -0700, Andrei Vagin wrote: > > > Allocate the time namespace page among VVAR pages and add the logic > > &g

Re: [PATCH 2/2] i2c: cadence: Clear HOLD bit at correct time in Rx path

2020-07-22 Thread Wolfram Sang
On Fri, Jul 03, 2020 at 07:26:12PM +0530, Raviteja Narayanam wrote: > There are few issues on Zynq SOC observed in the stress tests causing > timeout errors. Even though all the data is received, timeout error > is thrown. This is due to an IP bug in which the COMP bit in ISR is > not set at end of

Re: [PATCH] x86/xen/time: set the X86_FEATURE_TSC_KNOWN_FREQ flag in xen_tsc_khz()

2020-07-21 Thread Boris Ostrovsky
On 7/21/20 12:12 PM, Hayato Ohhashi wrote: > If the TSC frequency is known from the pvclock page, > the TSC frequency does not need to be recalibrated. > We can avoid recalibration by setting X86_FEATURE_TSC_KNOWN_FREQ. > > Signed-off-by: Hayato Ohhashi Reviewed-by: Boris Ostrovsky

[PATCH 01/23 v3] tools lib traceevent: Add API to read time information from kbuffer

2020-07-21 Thread Steven Rostedt
From: "Steven Rostedt (Red Hat)" Add the functions kbuffer_subbuf_timestamp() and kbuffer_ptr_delta() to get the timing data stored in the ring buffer that is used to produced the time stamps of the records. This is useful for tools like trace-cmd to be able to display the content o

[PATCH 07/24] init: initialize ramdisk_execute_command at compile time

2020-07-21 Thread Christoph Hellwig
Set ramdisk_execute_command to "/init" at compile time. The command line can still override it, but this saves a few instructions and removes a NULL check. Signed-off-by: Christoph Hellwig --- init/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ini

[PATCH] x86/xen/time: set the X86_FEATURE_TSC_KNOWN_FREQ flag in xen_tsc_khz()

2020-07-21 Thread Hayato Ohhashi
/time.c b/arch/x86/xen/time.c index c8897aad13cd..91f5b330dcc6 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -39,6 +39,7 @@ static unsigned long xen_tsc_khz(void) struct pvclock_vcpu_time_info *info = &HYPERVISOR_shared_info->vcpu_info[

Re: [PATCH 0/9] arm64: Stolen time support

2020-07-20 Thread zhukeqian
Hi Steven, On 2019/8/2 22:50, Steven Price wrote: > This series add support for paravirtualized time for arm64 guests and > KVM hosts following the specification in Arm's document DEN 0057A: > > https://developer.arm.com/docs/den0057/a > > It implements support for st

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Paul E. McKenney
On Mon, Jul 20, 2020 at 06:48:50PM +0200, pet...@infradead.org wrote: > On Mon, Jul 20, 2020 at 09:04:34AM -0700, Paul E. McKenney wrote: > > 2. If we were to say "unlock" instead of "release", consistency > > would demand that we also say "lock" instead of "acquire". > > But "lock" is sub

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread peterz
On Mon, Jul 20, 2020 at 09:04:34AM -0700, Paul E. McKenney wrote: > 2.If we were to say "unlock" instead of "release", consistency > would demand that we also say "lock" instead of "acquire". > But "lock" is subtlely different than "acquire", and there is > a history of people

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Matthew Wilcox
ent I want to read. : This document describes the ideas underlying the LKMM. It is meant : for people who want to understand how the model was designed. It does : not go into the details of the code in the .bell and .cat files; : rather, it explains in English what the code expresses symbol

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Darrick J. Wong
at. > > For another, you appear to be confusing the LKMM with the kernel's API, > and reference documents with programming guides (or recipes). I'm sure > that you aren't doing this deliberately and are well aware of these > distinctions, but that's the impre

[PATCH 5.4 035/215] thermal/drivers: imx: Fix missing of_node_put() at probe time

2020-07-20 Thread Greg Kroah-Hartman
From: Anson Huang [ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ] After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-ema

[PATCH 01/24] init: initialize ramdisk_execute_command at compile time

2020-07-20 Thread Christoph Hellwig
Set ramdisk_execute_command to "/init" at compile time. The command line can still override it, but this saves a few instructions and removes a NULL check. Signed-off-by: Christoph Hellwig --- init/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ini

[PATCH 5.7 037/244] thermal/drivers: imx: Fix missing of_node_put() at probe time

2020-07-20 Thread Greg Kroah-Hartman
From: Anson Huang [ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ] After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-ema

[PATCH 5.7 228/244] drm/amdgpu/display: create fake mst encoders ahead of time (v4)

2020-07-20 Thread Greg Kroah-Hartman
From: Alex Deucher commit 3168470142e0a82b5732c04ed4c031a9322ae170 upstream. Prevents a warning in the MST create connector case. v2: create global fake encoders rather per connector fake encoders to avoid running out of encoder indices. v3: use the actual number of crtcs on the asic rather th

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Alan Stern
On Mon, Jul 20, 2020 at 04:39:11PM +0100, Matthew Wilcox wrote: > Honestly, even the term "release semantics" trips me up _every_ time. > It's a barrier to understanding because I have to translate it into "Oh, > he means it's like an unlock". Why can'

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Paul E. McKenney
; : for people who want to understand how the model was designed. It does > : not go into the details of the code in the .bell and .cat files; > : rather, it explains in English what the code expresses symbolically. > > I don't want to know how the model was designed. I want to

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Alan Stern
> > That > > file was specifically written for non-experts to help them overcome the > > learning curve. It tries to define the vocabulary as terms are > > introduced and to avoid using obscure syntax. > > It tries to teach people about what a memory model is at t

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-20 Thread Peter Zijlstra
On Mon, Jul 20, 2020 at 12:07:31PM +1000, Dave Chinner wrote: > The whole serialisation/atomic/ordering APIs have fallen badly off > the macro cliff, to the point where finding out something as simple > as the order of parameters passed to cmpxchg and what semantics it > provides requires macro-spe

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-19 Thread Dave Chinner
On Fri, Jul 17, 2020 at 10:28:18PM -0700, Eric Biggers wrote: > What do people think about the following instead? (Not proofread / tested > yet, > so please comment on the high-level approach, not minor mistakes :-) ) No huge long macros, please. We don't accept people writing long complex stat

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-19 Thread Dave Chinner
s. > That > file was specifically written for non-experts to help them overcome the > learning curve. It tries to define the vocabulary as terms are > introduced and to avoid using obscure syntax. It tries to teach people about what a memory model is at the same time it tries to defin

Re: [PATCHv4 2/4] watchdog: add support for adjusting last known HW keepalive time

2020-07-19 Thread Guenter Roeck
On 7/17/20 6:29 AM, Tero Kristo wrote: > Certain watchdogs require the watchdog only to be pinged within a > specific time window, pinging too early or too late cause the watchdog > to fire. In cases where this sort of watchdog has been started before > kernel comes up, we must adjust

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
On Fri, Jul 17, 2020 at 10:28:18PM -0700, Eric Biggers wrote: > /** > * INIT_ONCE() - do one-time initialization > * @done: pointer to a 'bool' flag that tracks whether initialization has been > * done yet or not. Must be false by default. > * @mutex: poi

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
On Sat, Jul 18, 2020 at 12:00:01PM +1000, Dave Chinner wrote: > Recipes are aimed at people who simply don't understand any of that > goobledegook. This won't help them -write correct code-. Indeed. Perhaps this writeup belongs in a different document (with a pointer from the recipes file), and

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
> This is one of the reasons that the LKMM documetnation is so damn > difficult to read and understand: just understanding the vocabulary > it uses requires a huge learning curve, and it's not defined > anywhere. Understanding the syntax of examples requires a huge > learning curve, because it's no

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-18 Thread Sedat Dilek
> > > > The compressed kernel currently contains bogus run-time relocations in > > > > the startup code in head_{32,64}.S, which are generated by the linker, > > > > but must not actually be processed at run-time. > > > > > > > > This generates

[PATCH v7 09/18] perf ftrace: add support for trace option sleep-time

2020-07-17 Thread Changbin Du
This adds an option '--graph-opts nosleep-time' which allow us only to measure on-CPU time. This option is function_graph tracer only. Signed-off-by: Changbin Du --- v3: switch to uniform option --graph-opts. v2: option name '--nosleep-time' -> '--graph-no

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Ard Biesheuvel
On Fri, 17 Jul 2020 at 21:17, Nick Desaulniers wrote: > > On Fri, Jul 17, 2020 at 6:46 AM Arvind Sankar wrote: > > > > On Tue, Jul 14, 2020 at 08:41:26PM -0400, Arvind Sankar wrote: > > > The compressed kernel currently contains bogus run-time relocations in > >

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Eric Biggers
t; > +If that doesn't apply, you'll have to implement one-time init yourself. > > > > + > > > > +The simplest implementation just uses a mutex and an 'inited' flag. > > > > +This implementation should be used where feasible: > > > >

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Matthew Wilcox
On Fri, Jul 17, 2020 at 06:38:39PM -0700, Eric Biggers wrote: > On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > > > +If that doesn't apply, you'll have to implement one-time init

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Dave Chinner
On Fri, Jul 17, 2020 at 09:25:55PM -0400, Alan Stern wrote: > On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote: > > On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote: > > > > +There are also cases in which the smp_load_acquire() can be replaced by > > > > +the more lightwe

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Eric Biggers
On Fri, Jul 17, 2020 at 09:25:55PM -0400, Alan Stern wrote: > On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote: > > On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote: > > > > +There are also cases in which the smp_load_acquire() can be replaced by > > > > +the more lightwe

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Dave Chinner
On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > From: Eric Biggers > > The "one-time init" pattern is implemented incorrectly in various places > in the kernel. And when people do try to implement it correctly, it is > unclear what to use. Try to

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Matthew Wilcox
On Fri, Jul 17, 2020 at 09:25:55PM -0400, Alan Stern wrote: > On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote: > > On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote: > > > > +There are also cases in which the smp_load_acquire() can be replaced by > > > > +the more lightwe

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Eric Biggers
On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > > +If that doesn't apply, you'll have to implement one-time init yourself. > > + > > +The simplest implementation just uses a mutex

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Alan Stern
On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote: > On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote: > > > +There are also cases in which the smp_load_acquire() can be replaced by > > > +the more lightweight READ_ONCE(). (smp_store_release() is still > > > +required.)

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Eric Biggers
On Fri, Jul 17, 2020 at 01:51:38PM -0400, Alan Stern wrote: > On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > ... > > > + /* on success, pairs with smp_load_acquire() above and below */ > > > + if (c

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Eric Biggers
On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote: > > +There are also cases in which the smp_load_acquire() can be replaced by > > +the more lightweight READ_ONCE(). (smp_store_release() is still > > +required.) Specifically, if all initialized memory is transitively > > +reachable

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Darrick J. Wong
On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > > +If that doesn't apply, you'll have to implement one-time init yourself. > > + > > +The simplest implementation just uses a mutex

Re: [PATCH-next v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Nick Desaulniers
entries out of the .got section > x86/boot/compressed: Force hidden visibility for all symbol references > x86/boot/compressed: Get rid of GOT fixup code > > Arvind Sankar (4): > x86/boot: Add .text.* to setup.ld > x86/boot: Remove run-time relocations from .head.text code

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Darrick J. Wong
On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > > +If that doesn't apply, you'll have to implement one-time init yourself. > > + > > +The simplest implementation just uses a mutex

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Darrick J. Wong
On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > From: Eric Biggers > > The "one-time init" pattern is implemented incorrectly in various places > in the kernel. And when people do try to implement it correctly, it is > unclear what to use. Try to

[PATCH-next v5 5/7] x86/boot: Remove run-time relocations from .head.text code

2020-07-17 Thread Arvind Sankar
The assembly code in head_{32,64}.S, while meant to be position-independent, generates run-time relocations because it uses instructions such as lealgdt(%edx), %eax which make the assembler and linker think that the code is using %edx as an index into gdt, and hence gdt needs to be

[PATCH-next v5 6/7] x86/boot: Remove run-time relocations from head_{32,64}.S

2020-07-17 Thread Arvind Sankar
The BFD linker generates run-time relocations for z_input_len and z_output_len, even though they are absolute symbols. This is fixed for binutils-2.35 [1]. Work around this for earlier versions by defining two variables input_len and output_len in addition to the symbols, and use them via

[PATCH-next v5 7/7] x86/boot: Check that there are no run-time relocations

2020-07-17 Thread Arvind Sankar
Add a linker script check that there are no run-time relocations, and remove the old one that tries to check via looking for specially-named sections in the object files. Drop the tests for -fPIE compiler option and -pie linker option, as they are available in all supported gcc and binutils

[PATCH-next v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Arvind Sankar
references x86/boot/compressed: Get rid of GOT fixup code Arvind Sankar (4): x86/boot: Add .text.* to setup.ld x86/boot: Remove run-time relocations from .head.text code x86/boot: Remove run-time relocations from head_{32,64}.S x86/boot: Check that there are no run-time relocations arch

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Sedat Dilek
On Fri, Jul 17, 2020 at 8:17 PM Nick Desaulniers wrote: > > On Fri, Jul 17, 2020 at 6:46 AM Arvind Sankar wrote: > > > > On Tue, Jul 14, 2020 at 08:41:26PM -0400, Arvind Sankar wrote: > > > The compressed kernel currently contains bogus run-time relocations in >

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Nick Desaulniers
On Fri, Jul 17, 2020 at 6:46 AM Arvind Sankar wrote: > > On Tue, Jul 14, 2020 at 08:41:26PM -0400, Arvind Sankar wrote: > > The compressed kernel currently contains bogus run-time relocations in > > the startup code in head_{32,64}.S, which are generated by the linker, > &g

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Alan Stern
On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote: > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: ... > > + /* on success, pairs with smp_load_acquire() above and below */ > > + if (cmpxchg_release(&foo, NULL, p) != NULL) { > > Why do we have cmpxc

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Matthew Wilcox
On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: > +If that doesn't apply, you'll have to implement one-time init yourself. > + > +The simplest implementation just uses a mutex and an 'inited' flag. > +This implementation should be used where feasibl

[PATCH v6 09/17] perf ftrace: add support for trace option sleep-time

2020-07-17 Thread Changbin Du
This adds an option '--graph-opts nosleep-time' which allow us only to measure on-CPU time. This option is function_graph tracer only. Signed-off-by: Changbin Du --- v3: switch to uniform option --graph-opts. v2: option name '--nosleep-time' -> '--graph-no

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Alan Stern
On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote: ... > +Note that when the cmpxchg_release() fails due to another task already > +having done it, a second smp_load_acquire() is required, since we still > +need to acquire the data that the other task released. When people talk about r

Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel

2020-07-17 Thread Arvind Sankar
On Tue, Jul 14, 2020 at 08:41:26PM -0400, Arvind Sankar wrote: > The compressed kernel currently contains bogus run-time relocations in > the startup code in head_{32,64}.S, which are generated by the linker, > but must not actually be processed at run-time. > > This generate

[PATCHv4 2/4] watchdog: add support for adjusting last known HW keepalive time

2020-07-17 Thread Tero Kristo
Certain watchdogs require the watchdog only to be pinged within a specific time window, pinging too early or too late cause the watchdog to fire. In cases where this sort of watchdog has been started before kernel comes up, we must adjust the watchdog keepalive window to match the actually running

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-17 Thread Matthew Wilcox
mpxchg_release() to cmpxchg() with the goal of it > +acting as both ACQUIRE and RELEASE, but that doesn't work here because > +cmpxchg() only guarantees memory ordering if it succeeds. > + > +Because of the above subtlety, the version with the mutex instead of > +cmpxchg_release()

Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-16 Thread Sedat Dilek
On Fri, Jul 17, 2020 at 6:48 AM Eric Biggers wrote: > > From: Eric Biggers ... > This is motivated by the discussion at > https://lkml.kernel.org/linux-fsdevel/2020071300.205104-1-ebigg...@kernel.org/T/#u ... > +In where cases where taking the mutex in the "already initialized" case "In case

[PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-16 Thread Eric Biggers
From: Eric Biggers The "one-time init" pattern is implemented incorrectly in various places in the kernel. And when people do try to implement it correctly, it is unclear what to use. Try to give some proper guidance. This is motivated by the discussion at https://lkml.kernel

Re: [PATCH v3 net] net: fec: fix hardware time stamping by external devices

2020-07-16 Thread Sergey Organov
Jakub Kicinski writes: > On Thu, 16 Jul 2020 23:38:13 +0300 Sergey Organov wrote: >> > Applied, and added to the stable queue, thanks! >> >> Thanks, and I've also got a no-brainer patch that lets this bug fix >> compile as-is with older kernels, where there were no phy_has_hwtstamp() >> functi

Re: [PATCH v3 net] net: fec: fix hardware time stamping by external devices

2020-07-16 Thread Jakub Kicinski
On Thu, 16 Jul 2020 23:38:13 +0300 Sergey Organov wrote: > > Applied, and added to the stable queue, thanks! > > Thanks, and I've also got a no-brainer patch that lets this bug fix > compile as-is with older kernels, where there were no phy_has_hwtstamp() > function. Dunno how to properly handle

Re: [PATCH v3 net] net: fec: fix hardware time stamping by external devices

2020-07-16 Thread Sergey Organov
Jakub Kicinski writes: > On Tue, 14 Jul 2020 19:28:02 +0300 Sergey Organov wrote: >> Fix support for external PTP-aware devices such as DSA or PTP PHY: >> >> Make sure we never time stamp tx packets when hardware time stamping >> is disabled. >> >> Check

Re: [PATCH v3 net] net: fec: fix hardware time stamping by external devices

2020-07-16 Thread Jakub Kicinski
On Tue, 14 Jul 2020 19:28:02 +0300 Sergey Organov wrote: > Fix support for external PTP-aware devices such as DSA or PTP PHY: > > Make sure we never time stamp tx packets when hardware time stamping > is disabled. > > Check for PTP PHY being in use and then pass ioctls related

Re: [PATCH] time/sched_clock: Use raw_read_seqcount_latch()

2020-07-15 Thread Leo Yan
Hi Peter, Ahemd, On Wed, Jul 15, 2020 at 05:58:50PM +0200, Peter Zijlstra wrote: [...] > > > diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c > > > index fa3f800d7d76..ea007928d681 100644 > > > --- a/kernel/time/sched_clock.c > >

[PATCH v3 2/7] time/sched_clock: Use raw_read_seqcount_latch()

2020-07-15 Thread Leo Yan
arwish Signed-off-by: Leo Yan --- kernel/time/sched_clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 0acaadc3156c..0deaf4b79fb4 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -70,7 +70,

Re: [PATCH] time/sched_clock: Use raw_read_seqcount_latch()

2020-07-15 Thread Peter Zijlstra
...@hirez.programming.kicks-ass.net > > Link: > > https://lkml.kernel.org/r/20200715092345.ga231...@debian-buster-darwi.lab.linutronix.de > > References: 1809bfa44e10 ("timers, sched/clock: Avoid deadlock during read > > from NMI") > > Signed-off-by: Ahmed S. Da

[PATCH net-next v2 2/4] net: fec: initialize clock with 0 rather than current kernel time

2020-07-15 Thread Sergey Organov
Initializing with 0 makes it much easier to identify time stamps from otherwise uninitialized clock. Initialization of PTP clock with current kernel time makes little sense as PTP time scale differs from UTC time scale that kernel time represents. It only leads to confusion when no actual PTP

[PATCH net-next v2 1/4] net: fec: enable to use PPS feature without time stamping

2020-07-15 Thread Sergey Organov
PPS feature could be useful even when hardware time stamping of network packets is not in use, so remove offending check for this condition from fec_ptp_enable_pps(). Signed-off-by: Sergey Organov --- drivers/net/ethernet/freescale/fec_ptp.c | 5 - 1 file changed, 5 deletions(-) diff --git

Re: [PATCH] time/sched_clock: Use raw_read_seqcount_latch()

2020-07-15 Thread Leo Yan
> References: 1809bfa44e10 ("timers, sched/clock: Avoid deadlock during read > from NMI") > Signed-off-by: Ahmed S. Darwish > --- > kernel/time/sched_clock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/time/sched_clock.c

[PATCH] time/sched_clock: Use raw_read_seqcount_latch()

2020-07-15 Thread Ahmed S. Darwish
5745.gd117...@hirez.programming.kicks-ass.net Link: https://lkml.kernel.org/r/20200715092345.ga231...@debian-buster-darwi.lab.linutronix.de References: 1809bfa44e10 ("timers, sched/clock: Avoid deadlock during read from NMI") Signed-off-by: Ahmed S. Darwish --- kernel/time/sched_clock.c |

Re: [PATCH v5 7/7] x86/boot: Check that there are no run-time relocations

2020-07-15 Thread Sedat Dilek
On Wed, Jul 15, 2020 at 11:00 AM Sedat Dilek wrote: > > On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > > > Add a linker script check that there are no run-time relocations, and > > remove the old one that tries to check via looking for specially-named > >

Re: [PATCH v5 6/7] x86/boot: Remove run-time relocations from head_{32,64}.S

2020-07-15 Thread Sedat Dilek
On Wed, Jul 15, 2020 at 11:03 AM Ard Biesheuvel wrote: > > On Wed, 15 Jul 2020 at 11:58, Sedat Dilek wrote: > > > > On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > > > > > The BFD linker generates run-time relocations for z_input_len and >

Re: [PATCH v5 6/7] x86/boot: Remove run-time relocations from head_{32,64}.S

2020-07-15 Thread Ard Biesheuvel
On Wed, 15 Jul 2020 at 11:58, Sedat Dilek wrote: > > On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > > > The BFD linker generates run-time relocations for z_input_len and > > z_output_len, even though they are absolute symbols. > > > > This is fixe

Re: [PATCH v5 7/7] x86/boot: Check that there are no run-time relocations

2020-07-15 Thread Sedat Dilek
On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > Add a linker script check that there are no run-time relocations, and > remove the old one that tries to check via looking for specially-named > sections in the object files. > > Drop the tests for -fPIE compiler opti

Re: [PATCH v5 6/7] x86/boot: Remove run-time relocations from head_{32,64}.S

2020-07-15 Thread Sedat Dilek
On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > The BFD linker generates run-time relocations for z_input_len and > z_output_len, even though they are absolute symbols. > > This is fixed for binutils-2.35 [1]. Work around this for earlier > versions by defining two v

Re: [PATCH v5 5/7] x86/boot: Remove run-time relocations from .head.text code

2020-07-15 Thread Sedat Dilek
On Wed, Jul 15, 2020 at 2:41 AM Arvind Sankar wrote: > > The assembly code in head_{32,64}.S, while meant to be > position-independent, generates run-time relocations because it uses > instructions such as > lealgdt(%edx), %eax > which make the assembler and linker t

<    8   9   10   11   12   13   14   15   16   17   >