Skip to contentSkip to conversation

RFC: OCFS2 heartbeat improvements

Ocfs2-devel Jie Liu 4 participants 11 messages Aug 22, 2012 – Aug 24, 2012 OCFS2

lore
Share & tools
lore

Jie Liu

author
#0 lore raw

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or
something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or even
submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120822/c454d0b4/attachment.html

#1 lore raw
Quoted 15 lines · Jie Liu

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or
something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Quoted 7 lines

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or
even submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

This was submitted before by Noboru Iwamatsu and acked by sunil and tao but some how didn't get merged

https://oss.oracle.com/pipermail/ocfs2-devel/2011-December/008438.html

Quoted 25 lines

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

Quoted 4 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120822/7967b991/attachment-0001.html

#2 lore raw

Yes. WRITE_SYNC should be good. Not FUA.

Also, you may want to look into using io priorities. The code is all there. Just needs activation.

Quoted 56 lines · srinivas eeda

On 8/22/2012 7:17 AM, Jie Liu wrote:

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or
something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or even
submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

This was submitted before by Noboru Iwamatsu and acked by sunil and tao but some how didn't get merged

https://oss.oracle.com/pipermail/ocfs2-devel/2011-December/008438.html

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

Quoted 9 lines

_______________________________________________
Ocfs2-devel mailing listOcfs2-devel at oss.oracle.comhttps://oss.oracle.com/mailman/listinfo/ocfs2-devel

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120822/1b3588dd/attachment.html

author
#4 lore raw
In reply to srinivas eeda
Quoted 24 lines · srinivas eeda
Quoted 15 lines · Jie Liu

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Quoted 7 lines

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or
even submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

Quoted 4 lines

This was submitted before by Noboru Iwamatsu and acked by sunil and tao but some how didn't get merged

https://oss.oracle.com/pipermail/ocfs2-devel/2011-December/008438.html

Thanks for the info!

-Jeff

Quoted 31 lines
Quoted 25 lines

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

Quoted 4 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Quoted 4 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120823/86e5aeeb/attachment.html

author
#3 lore raw
In reply to Sunil Mushran
Quoted 4 lines · Sunil Mushran

Yes. WRITE_SYNC should be good. Not FUA.

Also, you may want to look into using io priorities. The code is all there. Just needs activation.

Yes, I'll search the list to find them out.

Thanks,
-Jeff

Quoted 63 lines

On Wed, Aug 22, 2012 at 10:13 AM, srinivas eeda <srinivas.eeda at oracle.com <mailto:[email protected]>> wrote:

    On 8/22/2012 7:17 AM, Jie Liu wrote:
Quoted 15 lines

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Quoted 8 lines

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC,
or even submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

This was submitted before by Noboru Iwamatsu and acked by sunil and tao but some how didn't get merged

https://oss.oracle.com/pipermail/ocfs2-devel/2011-December/008438.html

Quoted 25 lines

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

Quoted 4 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com <mailto:[email protected]>
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Quoted 6 lines

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com <mailto:[email protected]>
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120823/407d3586/attachment.html

#5 lore raw
In reply to Jie Liu

Hi Jeff,

Quoted 15 lines · Jie Liu

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or
something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Quoted 7 lines

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or even
submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

yes, WRITE is too much easy to be preempted in cfq since it is in the async queue, so if we have a lot of read or sync write, the heartbeat write will be delayed a lot.

So as Srini has said in another e-mail, WRITE_SYNC should help in case it will let you have the chance of be a sync write and be treated the same as the read. Please check it first to see whether it is OK.

I guess the final solution will be WRITE_FUA, and I see btrfs uses it to write out the superblock. It will be handled differently by the underlying block layer so that it will not be in the elevator queue. It should work but I am not sure whether we need to be so aggressive. Maybe some test will show.

Thanks
Tao

Quoted 23 lines

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

author
#6 lore raw

Hi Tao,

Quoted 24 lines · Tao Ma

Hi Jeff,

Quoted 15 lines · Jie Liu

Hi All,

These days, I am investigating an issue regarding OCFS2 unexpected reboot in some real world use cases.
This problem occurred when the network status goes south, when the disk IO load is too high, etc...
I suspect it might caused by ocfs2 fencing if it's BIO reading/writing can not be scheduled and processed quickly, or
something like this happened in the network IO heartbeat thread.

Now am trying to reproduce this problem locally. In the meantime, I'd like to ping you guys with some rough ideas
to improve the disk IO heartbeat to see if they are sounds reasonable or not.

Quoted 7 lines

Firstly, if an OCFS2 node is suffer from heavy disk IO, how about to fix the bio read/write to make this IO request can not
be preempted by other requests? e.g, for o2hb_issue_node_write(), currently, it do bio submission with WRITE only,
'submit_bio(WRITE, bio)'. If we change the flag to WRITE_SYNC, or even
submit the request combine with REQ_FUA,
maybe could get highest priority for disk IO request.

Quoted 7 lines

yes, WRITE is too much easy to be preempted in cfq since it is in the async queue, so if we have a lot of read or sync write, the heartbeat write will be delayed a lot.

So as Srini has said in another e-mail, WRITE_SYNC should help in case it will let you have the chance of be a sync write and be treated the same as the read. Please check it first to see whether it is OK.

We have started a test with this flag.

Quoted 6 lines

I guess the final solution will be WRITE_FUA, and I see btrfs uses it to write out the superblock. It will be handled differently by the underlying block layer so that it will not be in the elevator queue. It should work but I am not sure whether we need to be so aggressive. Maybe some test will show.

Yes, this solution is really aggressive, the purpose is to make sure that the bio write
will hit the disk ASAP.
I'll update the test results for you guys then.

BTW, Sunil mentioned there already has an IO priority patch set but not yet merged. However, I only searched
an old posts back to 2006 at:
http://www.digipedia.pl/usenet/thread/11947/7120/

Am I missing something?

Thanks,
-Jeff

Quoted 26 lines

Thanks
Tao

Quoted 22 lines

Secondly, the comments for bio allocation at o2hb_setup_one_bio() indicates that we can pre-allocate bio instead of
acquire for each time. But I have not saw any code snippet doing such things in kernel. :(
how about creating a private bio set for each o2hb_region, so that we can do allocation out of it?
maybe it's faster than do allocation from global bio sets. Also, does it make sense if creating a memory pool
on each o2hb_region, so that we can have continuous pages bind to those bios?

Any comments are appreciated!

Thanks,
-Jeff

#7 lore raw
Quoted 7 lines · Jie Liu

BTW, Sunil mentioned there already has an IO priority patch set but not yet merged. However, I only searched
an old posts back to 2006 at:
http://www.digipedia.pl/usenet/thread/11947/7120/

Am I missing something?

No, I said the code is all in there. You just need to use it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120823/5a158b2c/attachment-0001.html

#9 lore raw
In reply to Tao Ma
Quoted 7 lines · Tao Ma

I guess the final solution will be WRITE_FUA, and I see btrfs uses it to write out the superblock. It will be handled differently by the underlying block layer so that it will not be in the elevator queue. It should work but I am not sure whether we need to be so aggressive. Maybe some test will show.

FUA is an overkill for the heartbeat data because we don't care if that data hits the platter or not. It can stay in the device's volatile cache.
Infact, staying
in the cache, and not hitting the platter, is better.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120823/46739e77/attachment.html

#10 lore raw
Quoted 10 lines · Sunil Mushran

On Wed, Aug 22, 2012 at 8:44 PM, Tao Ma <tm at tao.ma <mailto:[email protected]>> wrote:

I guess the final solution will be WRITE_FUA, and I see btrfs uses it to write out the superblock. It will be handled differently by the underlying block layer so that it will not be in the elevator queue. It should work but I am not sure whether we need to be so aggressive. Maybe some test will show.

Quoted 4 lines

FUA is an overkill for the heartbeat data because we don't care if that data hits the platter or not. It can stay in the device's volatile cache. Infact, staying
in the cache, and not hitting the platter, is better.

yes, but it has the benefit that the elevator will not try to add it in the queue and avoid any possible latency from the elevator. And my another concern is that if ocfs2 has some high-end shared storage, it should optimize the FUA command to be very fast and even within its cache if the storage can survive the power outage. Having said that, it may hurt if the backend storage doesn't implement FUA fast enough. So maybe we can add a new parameter so that the user can decide what type of heartbeat write he/she needs.

Thanks
Tao

author
#8 lore raw
In reply to Sunil Mushran
Quoted 9 lines · Sunil Mushran

On Wed, Aug 22, 2012 at 9:01 PM, Jie Liu <[email protected] <mailto:[email protected]>> wrote:

BTW, Sunil mentioned there already has an IO priority patch set but not
yet merged. However, I only searched
an old posts back to 2006 at:
http://www.digipedia.pl/usenet/thread/11947/7120/

Quoted 4 lines

Am I missing something?

No, I said the code is all in there. You just need to use it.

Ah, I know what I need to do.

Thanks,
-Jeff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120824/e2c2f110/attachment.html