[tip: locking/core] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-10-09 Thread tip-bot2 for Marco Elver
Committer: Paul E. McKenney CommitterDate: Mon, 24 Aug 2020 15:09:59 -07:00 locking/atomics: Use read-write instrumentation for atomic RMWs Use instrument_atomic_read_write() for atomic RMW ops. Cc: Will Deacon Cc: Boqun Feng Cc: Arnd Bergmann Cc: Acked-by: Peter Zijlstra (Intel) Signed-off

[PATCH kcsan 11/19] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-08-31 Thread paulmck
From: Marco Elver Use instrument_atomic_read_write() for atomic RMW ops. Cc: Will Deacon Cc: Boqun Feng Cc: Arnd Bergmann Cc: Acked-by: Peter Zijlstra (Intel) Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- include/asm-generic/atomic-instrumented.h | 330

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-08-14 Thread Mark Rutland
On Fri, Aug 14, 2020 at 01:59:08PM +0200, Marco Elver wrote: > On Fri, 14 Aug 2020 at 13:31, Mark Rutland wrote: > > On Fri, Aug 14, 2020 at 12:28:26PM +0100, Mark Rutland wrote: > > > Hi, > > > > > > Sorry to come to this rather late -- this comment equally applies to v2 > > > so I'm replying

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-08-14 Thread Marco Elver
On Fri, 14 Aug 2020 at 13:31, Mark Rutland wrote: > On Fri, Aug 14, 2020 at 12:28:26PM +0100, Mark Rutland wrote: > > Hi, > > > > Sorry to come to this rather late -- this comment equally applies to v2 > > so I'm replying here to have context. > > ... and now I see that was already applied, so

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-08-14 Thread Mark Rutland
On Fri, Aug 14, 2020 at 12:28:26PM +0100, Mark Rutland wrote: > Hi, > > Sorry to come to this rather late -- this comment equally applies to v2 > so I'm replying here to have context. ... and now I see that was already applied, so please ignore this! Mark.

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-08-14 Thread Mark Rutland
Hi, Sorry to come to this rather late -- this comment equally applies to v2 so I'm replying here to have context. On Wed, Jul 22, 2020 at 12:11:18PM +0200, Marco Elver wrote: > On Tue, 21 Jul 2020 at 16:19, Peter Zijlstra wrote: > > > > On Tue, Jul 21, 2020 at 12:30:16PM +0200, Marco Elver

[PATCH v2 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-07-24 Thread Marco Elver
Use instrument_atomic_read_write() for atomic RMW ops. Signed-off-by: Marco Elver --- v2: * Update inline comment. --- include/asm-generic/atomic-instrumented.h | 330 +++--- scripts/atomic/gen-atomic-instrumented.sh | 21 +- 2 files changed, 180 insertions(+), 171 deletions(-)

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-07-22 Thread Marco Elver
On Tue, 21 Jul 2020 at 16:19, Peter Zijlstra wrote: > > On Tue, Jul 21, 2020 at 12:30:16PM +0200, Marco Elver wrote: > > > diff --git a/scripts/atomic/gen-atomic-instrumented.sh > > b/scripts/atomic/gen-atomic-instrumented.sh > > index 6afadf73da17..5cdcce703660 100755 > > ---

Re: [PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-07-21 Thread Peter Zijlstra
On Tue, Jul 21, 2020 at 12:30:16PM +0200, Marco Elver wrote: > diff --git a/scripts/atomic/gen-atomic-instrumented.sh > b/scripts/atomic/gen-atomic-instrumented.sh > index 6afadf73da17..5cdcce703660 100755 > --- a/scripts/atomic/gen-atomic-instrumented.sh > +++

[PATCH 8/8] locking/atomics: Use read-write instrumentation for atomic RMWs

2020-07-21 Thread Marco Elver
Use instrument_atomic_read_write() for atomic RMW ops. Signed-off-by: Marco Elver --- include/asm-generic/atomic-instrumented.h | 330 +++--- scripts/atomic/gen-atomic-instrumented.sh | 20 +- 2 files changed, 179 insertions(+), 171 deletions(-) diff --git

Re: Write is not atomic?

2012-10-16 Thread Juliusz Chroboczek
> This seems out of context. > If the file was open(2)ed with O_APPEND, the file offset is first > set to the end of the file before writing. The adjustment of the > file offset and the write operation are performed as an atomic > step. > Sounds different, doesn't it?

Re: Write is not atomic?

2012-10-16 Thread Juliusz Chroboczek
This seems out of context. If the file was open(2)ed with O_APPEND, the file offset is first set to the end of the file before writing. The adjustment of the file offset and the write operation are performed as an atomic step. Sounds different, doesn't it? Yes, it

Re: Write is not atomic?

2012-10-15 Thread Jochen Striepe
Hello, On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: > The Linux manual page for write(2) says: > > The adjustment of the file offset and the write operation are > performed as an atomic step. This seems out of context. Over here write(2) reads: If

Re: Write is not atomic?

2012-10-15 Thread Max Filippov
On Tue, Oct 16, 2012 at 3:24 AM, Philippe Troin wrote: > On Tue, 2012-10-16 at 10:13 +1100, Dave Chinner wrote: >> On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: >> > The following fragment of code >> > >> > int fd; >> > fd = open("exemple", O_CREAT | O_WRONLY |

Re: Write is not atomic?

2012-10-15 Thread Juliusz Chroboczek
> You don't check return code here, does write succeed at all? Yes, both writes return 6. > Does it ever produce e.g. OuOuilleille No. > (as this is what atomicity is about here)? I was referring to the claim that under Linux writing and adjusting the file offset are performed as an atomic

Re: Write is not atomic?

2012-10-15 Thread Philippe Troin
On Tue, 2012-10-16 at 10:13 +1100, Dave Chinner wrote: > On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: > > Hi, > > > > The Linux manual page for write(2) says: > > > > The adjustment of the file offset and the write operation are > > performed as an atomic step. >

Re: Write is not atomic?

2012-10-15 Thread Dave Chinner
On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: > Hi, > > The Linux manual page for write(2) says: > > The adjustment of the file offset and the write operation are > performed as an atomic step. That's wrong. The file offset update is not synchronised at all with

Re: Write is not atomic?

2012-10-15 Thread Max Filippov
On Tue, Oct 16, 2012 at 1:36 AM, Juliusz Chroboczek wrote: > Hi, > > The Linux manual page for write(2) says: > > The adjustment of the file offset and the write operation are > performed as an atomic step. > > This is apparently an extension to POSIX, which says > > This volume of

Write is not atomic?

2012-10-15 Thread Juliusz Chroboczek
Hi, The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. This is apparently an extension to POSIX, which says This volume of IEEE Std 1003.1-2001 does not specify behavior of concurrent writes to a

Write is not atomic?

2012-10-15 Thread Juliusz Chroboczek
Hi, The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. This is apparently an extension to POSIX, which says This volume of IEEE Std 1003.1-2001 does not specify behavior of concurrent writes to a

Re: Write is not atomic?

2012-10-15 Thread Max Filippov
On Tue, Oct 16, 2012 at 1:36 AM, Juliusz Chroboczek j...@pps.jussieu.fr wrote: Hi, The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. This is apparently an extension to POSIX, which says This

Re: Write is not atomic?

2012-10-15 Thread Dave Chinner
On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: Hi, The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. That's wrong. The file offset update is not synchronised at all with the

Re: Write is not atomic?

2012-10-15 Thread Philippe Troin
On Tue, 2012-10-16 at 10:13 +1100, Dave Chinner wrote: On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: Hi, The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. That's wrong.

Re: Write is not atomic?

2012-10-15 Thread Juliusz Chroboczek
You don't check return code here, does write succeed at all? Yes, both writes return 6. Does it ever produce e.g. OuOuilleille No. (as this is what atomicity is about here)? I was referring to the claim that under Linux writing and adjusting the file offset are performed as an atomic step,

Re: Write is not atomic?

2012-10-15 Thread Max Filippov
On Tue, Oct 16, 2012 at 3:24 AM, Philippe Troin p...@fifi.org wrote: On Tue, 2012-10-16 at 10:13 +1100, Dave Chinner wrote: On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: The following fragment of code int fd; fd = open(exemple, O_CREAT | O_WRONLY | O_TRUNC,

Re: Write is not atomic?

2012-10-15 Thread Jochen Striepe
Hello, On Mon, Oct 15, 2012 at 11:36:15PM +0200, Juliusz Chroboczek wrote: The Linux manual page for write(2) says: The adjustment of the file offset and the write operation are performed as an atomic step. This seems out of context. Over here write(2) reads: If the