Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Pranith Kumar
On Tue, Sep 2, 2014 at 12:08 PM, Paul E. McKenney
 wrote:

> Could you please adjust in this way?  Again, the point is to be the
> first few items in a full set of permutations, not to illustrate selected
> orderings/outcomes.
>

OK, if that is the case then replacing x with y is much easier. I will
send an updated patch. Thanks!

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Paul E. McKenney
On Thu, Aug 28, 2014 at 05:45:10PM -0400, Pranith Kumar wrote:
> On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
>  wrote:
> > On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
> >> On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
> >>  wrote:
> >> >
> >> > I am really confused by the ordering of the new lines, as I would have
> >> > expected the "x"s to be replaced with "y"s and vice versa.  But the
> >> > ordering of the various combinations does not matter, and each line
> >> > looks OK.
> >>
> >> Since x = A was replaced by x = B and y = B was replaced by y = A, I
> >> just converted all x = load A to x = load B. Similarly for y. I think
> >> we can do either this or as you suggested replacing x's with y's.
> >
> > Fair enough.  The other thing that confused me was the "STORE B=4,"
> > showing up early in your replacement.
> 
> So I converted
> 
> STORE A=3, x=LOAD A->3
> 
> to
> 
> STORE B=4, x=LOAD B->4
> 
> since the later load into x wanted an updated value of B and not the
> default. That is the reason you see STORE B = 4  in place of STORE A =
> 3

Fair enough.

However, the list is supposed to be part of the full set of 24 possible
outcomes.  Many readers would therefore expect the permutations to be
ordered in some way, so that the first column would have six of one thing,
six of the next thing, and so on, according to some pattern.

Could you please adjust in this way?  Again, the point is to be the
first few items in a full set of permutations, not to illustrate selected
orderings/outcomes.

Thanx, Paul

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Paul E. McKenney
On Thu, Aug 28, 2014 at 05:45:10PM -0400, Pranith Kumar wrote:
 On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
 paul...@linux.vnet.ibm.com wrote:
  On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
  On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
  paul...@linux.vnet.ibm.com wrote:
  
   I am really confused by the ordering of the new lines, as I would have
   expected the xs to be replaced with ys and vice versa.  But the
   ordering of the various combinations does not matter, and each line
   looks OK.
 
  Since x = A was replaced by x = B and y = B was replaced by y = A, I
  just converted all x = load A to x = load B. Similarly for y. I think
  we can do either this or as you suggested replacing x's with y's.
 
  Fair enough.  The other thing that confused me was the STORE B=4,
  showing up early in your replacement.
 
 So I converted
 
 STORE A=3, x=LOAD A-3
 
 to
 
 STORE B=4, x=LOAD B-4
 
 since the later load into x wanted an updated value of B and not the
 default. That is the reason you see STORE B = 4  in place of STORE A =
 3

Fair enough.

However, the list is supposed to be part of the full set of 24 possible
outcomes.  Many readers would therefore expect the permutations to be
ordered in some way, so that the first column would have six of one thing,
six of the next thing, and so on, according to some pattern.

Could you please adjust in this way?  Again, the point is to be the
first few items in a full set of permutations, not to illustrate selected
orderings/outcomes.

Thanx, Paul

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Pranith Kumar
On Tue, Sep 2, 2014 at 12:08 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 Could you please adjust in this way?  Again, the point is to be the
 first few items in a full set of permutations, not to illustrate selected
 orderings/outcomes.


OK, if that is the case then replacing x with y is much easier. I will
send an updated patch. Thanks!

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
 wrote:
> On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
>> On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
>>  wrote:
>> >
>> > I am really confused by the ordering of the new lines, as I would have
>> > expected the "x"s to be replaced with "y"s and vice versa.  But the
>> > ordering of the various combinations does not matter, and each line
>> > looks OK.
>>
>> Since x = A was replaced by x = B and y = B was replaced by y = A, I
>> just converted all x = load A to x = load B. Similarly for y. I think
>> we can do either this or as you suggested replacing x's with y's.
>
> Fair enough.  The other thing that confused me was the "STORE B=4,"
> showing up early in your replacement.
>

So I converted

STORE A=3, x=LOAD A->3

to

STORE B=4, x=LOAD B->4

since the later load into x wanted an updated value of B and not the
default. That is the reason you see STORE B = 4  in place of STORE A =
3


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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Paul E. McKenney
On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
> On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
>  wrote:
> >
> > I am really confused by the ordering of the new lines, as I would have
> > expected the "x"s to be replaced with "y"s and vice versa.  But the
> > ordering of the various combinations does not matter, and each line
> > looks OK.
> 
> Since x = A was replaced by x = B and y = B was replaced by y = A, I
> just converted all x = load A to x = load B. Similarly for y. I think
> we can do either this or as you suggested replacing x's with y's.

Fair enough.  The other thing that confused me was the "STORE B=4,"
showing up early in your replacement.

Thanx, Paul

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
 wrote:
>
> I am really confused by the ordering of the new lines, as I would have
> expected the "x"s to be replaced with "y"s and vice versa.  But the
> ordering of the various combinations does not matter, and each line
> looks OK.
>

Since x = A was replaced by x = B and y = B was replaced by y = A, I
just converted all x = load A to x = load B. Similarly for y. I think
we can do either this or as you suggested replacing x's with y's.

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 I am really confused by the ordering of the new lines, as I would have
 expected the xs to be replaced with ys and vice versa.  But the
 ordering of the various combinations does not matter, and each line
 looks OK.


Since x = A was replaced by x = B and y = B was replaced by y = A, I
just converted all x = load A to x = load B. Similarly for y. I think
we can do either this or as you suggested replacing x's with y's.

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Paul E. McKenney
On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
 On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
 paul...@linux.vnet.ibm.com wrote:
 
  I am really confused by the ordering of the new lines, as I would have
  expected the xs to be replaced with ys and vice versa.  But the
  ordering of the various combinations does not matter, and each line
  looks OK.
 
 Since x = A was replaced by x = B and y = B was replaced by y = A, I
 just converted all x = load A to x = load B. Similarly for y. I think
 we can do either this or as you suggested replacing x's with y's.

Fair enough.  The other thing that confused me was the STORE B=4,
showing up early in your replacement.

Thanx, Paul

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


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:
 On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
 On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
 paul...@linux.vnet.ibm.com wrote:
 
  I am really confused by the ordering of the new lines, as I would have
  expected the xs to be replaced with ys and vice versa.  But the
  ordering of the various combinations does not matter, and each line
  looks OK.

 Since x = A was replaced by x = B and y = B was replaced by y = A, I
 just converted all x = load A to x = load B. Similarly for y. I think
 we can do either this or as you suggested replacing x's with y's.

 Fair enough.  The other thing that confused me was the STORE B=4,
 showing up early in your replacement.


So I converted

STORE A=3, x=LOAD A-3

to

STORE B=4, x=LOAD B-4

since the later load into x wanted an updated value of B and not the
default. That is the reason you see STORE B = 4  in place of STORE A =
3


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


[PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-25 Thread Pranith Kumar
Correct the example of memory orderings in memory-barriers.txt

Commit 615cc2c9cf95 "Documentation/memory-barriers.txt: fix important typo re
memory barriers" changed the assignment to x and y. Change the rest of the
example to match this change.

Reported-by: Ganesh Rapolu 
Signed-off-by: Pranith Kumar 
---
 Documentation/memory-barriers.txt | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/memory-barriers.txt 
b/Documentation/memory-barriers.txt
index a4de88f..cf31875 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -121,22 +121,22 @@ For example, consider the following sequence of events:
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
 
-   STORE A=3,  STORE B=4,  x=LOAD A->3,y=LOAD B->4
-   STORE A=3,  STORE B=4,  y=LOAD B->4,x=LOAD A->3
-   STORE A=3,  x=LOAD A->3,STORE B=4,  y=LOAD B->4
-   STORE A=3,  x=LOAD A->3,y=LOAD B->2,STORE B=4
-   STORE A=3,  y=LOAD B->2,STORE B=4,  x=LOAD A->3
-   STORE A=3,  y=LOAD B->2,x=LOAD A->3,STORE B=4
-   STORE B=4,  STORE A=3,  x=LOAD A->3,y=LOAD B->4
+   STORE A=3,  STORE B=4,  x=LOAD B->4,y=LOAD A->3
+   STORE A=3,  STORE B=4,  y=LOAD A->3,x=LOAD B->4
+   STORE B=4,  x=LOAD B->4,STORE A=3,  y=LOAD A->3
+   STORE A=3,  x=LOAD B->2,y=LOAD A->3,STORE B=4
+   STORE B=4,  y=LOAD A->1,STORE A=3,  x=LOAD B->4
+   STORE B=4,  y=LOAD A->1,x=LOAD B->4,STORE A=3
+   STORE B=4,  STORE A=3,  x=LOAD B->4,y=LOAD A->3
STORE B=4, ...
...
 
 and can thus result in four different combinations of values:
 
-   x == 1, y == 2
-   x == 1, y == 4
-   x == 3, y == 2
-   x == 3, y == 4
+   x == 2, y == 1
+   x == 2, y == 3
+   x == 4, y == 1
+   x == 4, y == 3
 
 
 Furthermore, the stores committed by a CPU to the memory system may not be
-- 
1.9.1

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


[PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-25 Thread Pranith Kumar
Correct the example of memory orderings in memory-barriers.txt

Commit 615cc2c9cf95 Documentation/memory-barriers.txt: fix important typo re
memory barriers changed the assignment to x and y. Change the rest of the
example to match this change.

Reported-by: Ganesh Rapolu ganesh.rap...@hotmail.com
Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 Documentation/memory-barriers.txt | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/memory-barriers.txt 
b/Documentation/memory-barriers.txt
index a4de88f..cf31875 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -121,22 +121,22 @@ For example, consider the following sequence of events:
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
 
-   STORE A=3,  STORE B=4,  x=LOAD A-3,y=LOAD B-4
-   STORE A=3,  STORE B=4,  y=LOAD B-4,x=LOAD A-3
-   STORE A=3,  x=LOAD A-3,STORE B=4,  y=LOAD B-4
-   STORE A=3,  x=LOAD A-3,y=LOAD B-2,STORE B=4
-   STORE A=3,  y=LOAD B-2,STORE B=4,  x=LOAD A-3
-   STORE A=3,  y=LOAD B-2,x=LOAD A-3,STORE B=4
-   STORE B=4,  STORE A=3,  x=LOAD A-3,y=LOAD B-4
+   STORE A=3,  STORE B=4,  x=LOAD B-4,y=LOAD A-3
+   STORE A=3,  STORE B=4,  y=LOAD A-3,x=LOAD B-4
+   STORE B=4,  x=LOAD B-4,STORE A=3,  y=LOAD A-3
+   STORE A=3,  x=LOAD B-2,y=LOAD A-3,STORE B=4
+   STORE B=4,  y=LOAD A-1,STORE A=3,  x=LOAD B-4
+   STORE B=4,  y=LOAD A-1,x=LOAD B-4,STORE A=3
+   STORE B=4,  STORE A=3,  x=LOAD B-4,y=LOAD A-3
STORE B=4, ...
...
 
 and can thus result in four different combinations of values:
 
-   x == 1, y == 2
-   x == 1, y == 4
-   x == 3, y == 2
-   x == 3, y == 4
+   x == 2, y == 1
+   x == 2, y == 3
+   x == 4, y == 1
+   x == 4, y == 3
 
 
 Furthermore, the stores committed by a CPU to the memory system may not be
-- 
1.9.1

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