Skip to contentSkip to conversation

Question: Are there conflicts between the paragraph and the figure?

DISCUSSION Alan Huang 2 participants 9 messages May 1, 2023 – May 3, 2023

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

Hi,

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Thanks,
Alan

author
#1 lore raw
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 10 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Thanks,
Alan

#2 lore raw
Quoted 11 lines · Alan Huang
Quoted 11 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

Quoted 10 lines
Quoted 2 lines

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 4 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

Does that help, or am I missing the point of your question?

Thanx, Paul

author
#3 lore raw
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

	      				mcp = xchg(&curconfig, mcp);
	rcu_read_lock(); 
	mcp = …
	*cur_a = mcp->a; 

-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul

#4 lore raw
Quoted 38 lines · Alan Huang
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

Quoted 7 lines
	      				mcp = xchg(&curconfig, mcp);
	rcu_read_lock(); 
	mcp = …
	*cur_a = mcp->a; 

-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

Ah, I understand now, good catch and thank you! I updated that paragraph to the following, with your Reported-by:

The two horizontal grey dashed lines represent the period of time during which different readers get different results, however, each reader will see one and only one of the two objects. All readers that end before the first horizontal line will see the leftmost myconfig structure, and all readers that start after the second horizontal line will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects, but as long as each reader loads the curconfig pointer only once, each reader will see a consistent view of its myconfig structure.

Does that help?

Quoted 7 lines

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

The trick is to use an SVG editor. For better or for worse, I use inkscape. But easy for me to change, so I did, again, with your Reported-by.

The trick is to flip each arrow horizontally and then vertically, which reverses the direction without having to test one's manual dexterity, which I lack in abundance. ;-)

Thanx, Paul

Quoted 8 lines

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul

author
#5 lore raw
Quoted 51 lines

2023年5月3日 01:28,Paul E. McKenney <[email protected]> 写道:

Quoted 38 lines · Alan Huang
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

Quoted 7 lines
       mcp = xchg(&curconfig, mcp);

rcu_read_lock();
mcp = …
*cur_a = mcp->a;
-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

Quoted 7 lines

Ah, I understand now, good catch and thank you! I updated that paragraph to the following, with your Reported-by:

The two horizontal grey dashed lines represent the period of time during which different readers get different results, however, each reader will see one and only one of the two objects. All readers that end before the first horizontal line will see the

How about this:

        				mcp = xchg(&curconfig, mcp);
	rcu_read_lock(); 
	mcp = …
	*cur_a = mcp->a; 
	rcu_read_unlock();

-------------------------------------------------first horizontal line-------------------------------------------------

The reader above end before the first horizontal line, but still get the rightmost myconfig structure.

The point is that there is a time period between xchg and the first horizontal line during which a reader will see the rightmost myconfig structure.

One possible solution is to move xchg behind the first horizontal line, assuming that I understand correctly.

Quoted 17 lines

leftmost myconfig structure, and all readers that start after the second horizontal line will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects, but as long as each reader loads the curconfig pointer only once, each reader will see a consistent view of its myconfig structure.

Does that help?

Quoted 7 lines

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

Quoted 7 lines

The trick is to use an SVG editor. For better or for worse, I use inkscape. But easy for me to change, so I did, again, with your Reported-by.

The trick is to flip each arrow horizontally and then vertically, which reverses the direction without having to test one's manual dexterity, which I lack in abundance. ;-)

Thanks for the tricks, will try to use it!

Thanks,
Alan

Quoted 10 lines

Thanx, Paul

Quoted 7 lines

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul

#6 lore raw
Quoted 67 lines · Alan Huang
Quoted 51 lines

2023年5月3日 01:28,Paul E. McKenney <[email protected]> 写道:

Quoted 38 lines · Alan Huang
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

Quoted 7 lines
       mcp = xchg(&curconfig, mcp);

rcu_read_lock();
mcp = …
*cur_a = mcp->a;
-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

Quoted 7 lines

Ah, I understand now, good catch and thank you! I updated that paragraph to the following, with your Reported-by:

The two horizontal grey dashed lines represent the period of time during which different readers get different results, however, each reader will see one and only one of the two objects. All readers that end before the first horizontal line will see the

How about this:

        				mcp = xchg(&curconfig, mcp);
	rcu_read_lock(); 
	mcp = …
	*cur_a = mcp->a; 
	rcu_read_unlock();
Quoted 8 lines

-------------------------------------------------first horizontal line-------------------------------------------------

The reader above end before the first horizontal line, but still get the rightmost myconfig structure.

The point is that there is a time period between xchg and the first horizontal line during which a reader will see the rightmost myconfig structure.

One possible solution is to move xchg behind the first horizontal line, assuming that I understand correctly.

Yes, it would in some sense be more accurate to run that horizontal line right through the "mcp = xchg(&curconfig, mcp);".

But can you do that so that the diagram looks OK and is legible?

Thanx, Paul

Quoted 43 lines
Quoted 17 lines

leftmost myconfig structure, and all readers that start after the second horizontal line will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects, but as long as each reader loads the curconfig pointer only once, each reader will see a consistent view of its myconfig structure.

Does that help?

Quoted 7 lines

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

Quoted 7 lines

The trick is to use an SVG editor. For better or for worse, I use inkscape. But easy for me to change, so I did, again, with your Reported-by.

The trick is to flip each arrow horizontally and then vertically, which reverses the direction without having to test one's manual dexterity, which I lack in abundance. ;-)

Thanks for the tricks, will try to use it!

Thanks,
Alan

Quoted 10 lines

Thanx, Paul

Quoted 7 lines

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul

author
#7 lore raw
Quoted 79 lines

2023年5月3日 12:44,Paul E. McKenney <[email protected]> 写道:

Quoted 74 lines · Alan Huang
Quoted 51 lines

2023年5月3日 01:28,Paul E. McKenney <[email protected]> 写道:

Quoted 38 lines · Alan Huang
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

Quoted 7 lines
      mcp = xchg(&curconfig, mcp);

rcu_read_lock();
mcp = …
*cur_a = mcp->a;
-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

Quoted 7 lines

Ah, I understand now, good catch and thank you! I updated that paragraph to the following, with your Reported-by:

The two horizontal grey dashed lines represent the period of time during which different readers get different results, however, each reader will see one and only one of the two objects. All readers that end before the first horizontal line will see the

How about this:

       				mcp = xchg(&curconfig, mcp);
	rcu_read_lock(); 
	mcp = …
	*cur_a = mcp->a; 
	rcu_read_unlock();

-------------------------------------------------first horizontal line-------------------------------------------------

The reader above end before the first horizontal line, but still get the rightmost myconfig structure.

The point is that there is a time period between xchg and the first horizontal line during which a reader will see the rightmost myconfig structure.

Quoted 6 lines
Quoted 1 line

One possible solution is to move xchg behind the first horizontal line, assuming that I understand correctly.

Yes, it would in some sense be more accurate to run that horizontal line right through the "mcp = xchg(&curconfig, mcp);".

But can you do that so that the diagram looks OK and is legible?

I will do my best to do it

Thanks,
Alan

Quoted 46 lines

Thanx, Paul

Quoted 43 lines
Quoted 17 lines

leftmost myconfig structure, and all readers that start after the second horizontal line will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects, but as long as each reader loads the curconfig pointer only once, each reader will see a consistent view of its myconfig structure.

Does that help?

Quoted 7 lines

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

Quoted 7 lines

The trick is to use an SVG editor. For better or for worse, I use inkscape. But easy for me to change, so I did, again, with your Reported-by.

The trick is to flip each arrow horizontally and then vertically, which reverses the direction without having to test one's manual dexterity, which I lack in abundance. ;-)

Thanks for the tricks, will try to use it!

Thanks,
Alan

Quoted 10 lines

Thanx, Paul

Quoted 7 lines

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul

author
#8 lore raw
In reply to Paul E. McKenney
Quoted 79 lines

2023年5月3日 12:44,Paul E. McKenney <[email protected]> 写道:

Quoted 74 lines · Alan Huang
Quoted 51 lines

2023年5月3日 01:28,Paul E. McKenney <[email protected]> 写道:

Quoted 38 lines · Alan Huang
Quoted 23 lines

2023年5月2日 03:02,Paul E. McKenney <[email protected]> 写道:

Quoted 18 lines · Alan Huang
Quoted 5 lines

2023年5月1日 下午7:05,Alan Huang <[email protected]> 写道:

Hi,

Quoted 8 lines

I’m reading section 9.5.4.9, in the second to the last paragraph, there is:

Before the first horizontal line, all readers see the leftmost myconfig structure, and after the second horizontal line, all readers will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects

I’m a little confused, in Figure 9.29, the xchg is before the first horizontal line, in my understanding, if the reader’s reading is before the xchg, it will read the leftmost myconfg structure.

And if reader’s reading is after the xchg, it will see the rightmost structure, and because xchg is before the first horizontal line, Readers before the first horizontal line may also see the rightmost structure.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So, are there some conflicts between the paragraph and the figure?

Please correct me if I’m wrong.

Consider the point in time just before the left-hand reader's rcu_read_unlock() and just after the right-hand reader's rcu_read_lock(). These two readers are both running at that time, and one of those readers sees the old state and the other sees the new state.

The sentence that may lead to conflict is this one from the original text:

Before the first horizontal line, all readers see the leftmost myconfig structure.

There may be a situation where:

Quoted 7 lines
      mcp = xchg(&curconfig, mcp);

rcu_read_lock();
mcp = …
*cur_a = mcp->a;
-------------------------------------------------first horizontal line-------------------------------------------------

So, the reader will see the rightmost myconfig structure although it is before the first horizontal line.

Quoted 7 lines

Ah, I understand now, good catch and thank you! I updated that paragraph to the following, with your Reported-by:

The two horizontal grey dashed lines represent the period of time during which different readers get different results, however, each reader will see one and only one of the two objects. All readers that end before the first horizontal line will see the

How about this:

        mcp = xchg(&curconfig, mcp);

rcu_read_lock();
mcp = …
*cur_a = mcp->a;
rcu_read_unlock();
-------------------------------------------------first horizontal line-------------------------------------------------

The reader above end before the first horizontal line, but still get the rightmost myconfig structure.

The point is that there is a time period between xchg and the first horizontal line during which a reader will see the rightmost myconfig structure.

Quoted 6 lines
Quoted 1 line

One possible solution is to move xchg behind the first horizontal line, assuming that I understand correctly.

Yes, it would in some sense be more accurate to run that horizontal line right through the "mcp = xchg(&curconfig, mcp);".

But can you do that so that the diagram looks OK and is legible?

I will do my best to do it

Thanks,
Alan

Quoted 44 lines

Thanx, Paul

Quoted 41 lines
Quoted 17 lines

leftmost myconfig structure, and all readers that start after the second horizontal line will see the rightmost structure. Between the two lines, that is, during the grace period, different readers might see different objects, but as long as each reader loads the curconfig pointer only once, each reader will see a consistent view of its myconfig structure.

Does that help?

Quoted 7 lines

BTW, the original text says that black dotted arrows pointing from an older event to a newer event, but there exists two black dotted arrows in the wrong direction:

1.The arrow pointing from synchronize_rcu() to left-hand rcu_read_lock() 2.The arrow pointing right-hand rcu_read_lock() to synchronize_rcu()

The directions of the two arrows above may need to be adjusted. I tried to modify this, but after a few hours, I still can’t figure out the svg...

Quoted 7 lines

The trick is to use an SVG editor. For better or for worse, I use inkscape. But easy for me to change, so I did, again, with your Reported-by.

The trick is to flip each arrow horizontally and then vertically, which reverses the direction without having to test one's manual dexterity, which I lack in abundance. ;-)

Thanks for the tricks, will try to use it!

Thanks,
Alan

Quoted 10 lines

Thanx, Paul

Quoted 7 lines

Thanks,
Alan

Quoted 4 lines

Does that help, or am I missing the point of your question?

Thanx, Paul