* Re: [Drbd-dev] drbd-dev Digest, Vol 133, Issue 7 [not found] <mailman.3.1457694002.12272.drbd-dev@lists.linbit.com> @ 2016-03-14 5:37 ` 박경민 2016-03-14 10:23 ` [Drbd-dev] request_timer continuous loop if there is disk-timeout Lars Ellenberg 0 siblings, 1 reply; 4+ messages in thread From: 박경민 @ 2016-03-14 5:37 UTC (permalink / raw) To: drbd-dev [-- Attachment #1.1: Type: text/plain, Size: 5651 bytes --] I have known more request_timer_fn(). Thanks I think helper function *time_min_in_future() *function will return the nearest future time, right? And, next_trigger_time is initialize now value, so always is same. void request_timer_fn(unsigned long data) { if (dt) { ... if (device->disk_state[NOW] > D_FAILED) { next_trigger_time = *time_min_in_future*(now, next_trigger_time, oldest_submit_jif + dt); // 1st assign restart_timer = true; } ... } for_each_connection(connection, device->resource) { ... next_trigger_time = *time_min_in_future*(now, next_trigger_time, pre_send_jif + ent); // 2nd assign ... } ... if (restart_timer) { next_trigger_time = *time_min_in_future*(now, next_trigger_time, now + et); // 3rd assign ... } } Maybe, 3 assignments are always same, because now == next_trigger_time, which is the nearest. So, if restart_timer 's value is true, then loop continuously even dt or ent exists. I don't know how to put the different thing. Thanks. 2016-03-11 20:00 GMT+09:00 <drbd-dev-request@lists.linbit.com>: > Send drbd-dev mailing list submissions to > drbd-dev@lists.linbit.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.linbit.com/mailman/listinfo/drbd-dev > or, via email, send a message with subject or body 'help' to > drbd-dev-request@lists.linbit.com > > You can reach the person managing the list at > drbd-dev-owner@lists.linbit.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of drbd-dev digest..." > > > Today's Topics: > > 1. Re: request_timer continuous loop if there is disk-timeout > (Lars Ellenberg) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 11 Mar 2016 11:02:35 +0100 > From: Lars Ellenberg <lars.ellenberg@linbit.com> > Subject: Re: [Drbd-dev] request_timer continuous loop if there is > disk-timeout > To: drbd-dev@lists.linbit.com > Message-ID: <20160311100235.GD17669@soda.linbit> > Content-Type: text/plain; charset=utf-8 > > On Fri, Mar 11, 2016 at 04:30:27PM +0900, ??? wrote: > > Hello. > > I'm a software engineer in Mantech. > > > > In testing about disk-timeout property, > > if not default value, which will lead into a continuous loop. > > > > in request_timer_fn() > > ... > > if (device->disk_state[NOW] > D_FAILED) { > > et = min_not_zero(et, dt); > > next_trigger_time = time_min_in_future(now, > > next_trigger_time, oldest_submit_jif + dt); > > restart_timer = true; > > } > > ... > > I think, if there is no request, next_trigger_time should be calculated > > below > > next_trigger_time = time_min_in_future(now, > > next_trigger_time + *dt*, oldest_submit_jif + dt); > > > > However, I can't be sure. > > "dt" : disk timeout > "et" : effective timeout > "ent" : effective network timeout > "now" : well, now. > "next_trigger_time" : when to trigger the next timer > > next_trigger_time is initialized to "now". > > it gets adjusted using "time_min_in_future()", > which is this helper: > static unsigned long time_min_in_future(unsigned long now, > unsigned long t1, unsigned long t2) > { > t1 = time_after(now, t1) ? now : t1; > t2 = time_after(now, t2) ? now : t2; > return time_after(t1, t2) ? t2 : t1; > } > > time_after is ((long)((b) - (a)) < 0)), NOT <=. > > next_trigger_time will become larger than now, > or stay at its initial value, which is now. > > function ends with > > if (restart_timer) { > next_trigger_time = time_min_in_future(now, > next_trigger_time, now + et); > mod_timer(&device->request_timer, next_trigger_time); > } > > so in case next_trigger_time will still be equal to now at the end of the > function, it will be set to "now + et" before it is passed to mod_timer. > > et can only be zero if both network and disk timeout where zero, > in which case the whole thing would not even be used, > because that would mean timeouts are disabled. > > > Besides that, > I would be surprised if disk timeout in 9 worked properly yet. > > Also, disk timeout is evil in any case, and NOT TO BE USED > (not even in 8.4, where it *does* work properly ("as designed"), afaik) > > Why? Because if it triggers, and the IO subsystem ("disk") decides to > still process the submitted request some time later, > you'd get stuff RDMA'd to some random memory page which may well be > meanwhile > re-used for unrelated things. In which case we intentionally panic(). > > But you knew that already. > > -- > : Lars Ellenberg > : LINBIT | Keeping the Digital World Running > : DRBD -- Heartbeat -- Corosync -- Pacemaker > : R&D, Integration, Ops, Consulting, Support > > DRBD? and LINBIT? are registered trademarks of LINBIT > > > ------------------------------ > > _______________________________________________ > drbd-dev mailing list > drbd-dev@lists.linbit.com > http://lists.linbit.com/mailman/listinfo/drbd-dev > > > End of drbd-dev Digest, Vol 133, Issue 7 > **************************************** > -- 기술연구소 Mobile : 010-4762-0519 *박 경 민 차장* kmpak@mantech.co.kr 서울특별시 성동구 성수일로4길 25 서울숲코오롱디지털타워 12층 Fax : 02-575-4858 / Tel : (02) 2136-6978 (978) [-- Attachment #1.2: Type: text/html, Size: 33938 bytes --] [-- Attachment #2: image001.png --] [-- Type: image/png, Size: 4544 bytes --] [-- Attachment #3: image002.png --] [-- Type: image/png, Size: 16223 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Drbd-dev] request_timer continuous loop if there is disk-timeout 2016-03-14 5:37 ` [Drbd-dev] drbd-dev Digest, Vol 133, Issue 7 박경민 @ 2016-03-14 10:23 ` Lars Ellenberg 0 siblings, 0 replies; 4+ messages in thread From: Lars Ellenberg @ 2016-03-14 10:23 UTC (permalink / raw) To: drbd-dev On Mon, Mar 14, 2016 at 02:37:21PM +0900, 박경민 wrote: > I have known more request_timer_fn(). Thanks > > I think helper function *time_min_in_future() *function will return the > nearest future time, right? > And, next_trigger_time is initialize now value, so always is same. > void request_timer_fn(unsigned long data) > { > if (dt) { > ... > if (device->disk_state[NOW] > D_FAILED) { > next_trigger_time = *time_min_in_future*(now, > next_trigger_time, oldest_submit_jif + dt); // > 1st assign > restart_timer = true; > } > ... > } > for_each_connection(connection, device->resource) { > ... > next_trigger_time = *time_min_in_future*(now, > next_trigger_time, pre_send_jif + ent); // > 2nd assign > ... > } > ... > if (restart_timer) { > next_trigger_time = *time_min_in_future*(now, next_trigger_time, > now + et); // 3rd assign > ... > } > } > Maybe, 3 assignments are always same, because now == next_trigger_time, > which is the nearest. So, if restart_timer 's value is true, then > loop continuously even dt or ent exists. No. > I don't know how to put the different thing. Me neither. Also, you have seen this? > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of drbd-dev digest..." ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Drbd-dev] request_timer continuous loop if there is disk-timeout
@ 2016-03-11 7:30 박경민
2016-03-11 10:02 ` Lars Ellenberg
0 siblings, 1 reply; 4+ messages in thread
From: 박경민 @ 2016-03-11 7:30 UTC (permalink / raw)
To: drbd-dev
[-- Attachment #1.1: Type: text/plain, Size: 851 bytes --]
Hello.
I'm a software engineer in Mantech.
In testing about disk-timeout property,
if not default value, which will lead into a continuous loop.
in request_timer_fn()
...
if (device->disk_state[NOW] > D_FAILED) {
et = min_not_zero(et, dt);
next_trigger_time = time_min_in_future(now,
next_trigger_time, oldest_submit_jif + dt);
restart_timer = true;
}
...
I think, if there is no request, next_trigger_time should be calculated
below
next_trigger_time = time_min_in_future(now,
next_trigger_time + *dt*, oldest_submit_jif + dt);
However, I can't be sure.
Thanks
--
기술연구소 Mobile : 010-4762-0519
*박 경 민 차장* kmpak@mantech.co.kr
서울특별시 성동구 성수일로4길 25 서울숲코오롱디지털타워 12층
Fax : 02-575-4858 / Tel : (02) 2136-6978 (978)
[-- Attachment #1.2: Type: text/html, Size: 3499 bytes --]
[-- Attachment #2: image002.png --]
[-- Type: image/png, Size: 16223 bytes --]
[-- Attachment #3: image001.png --]
[-- Type: image/png, Size: 4544 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Drbd-dev] request_timer continuous loop if there is disk-timeout 2016-03-11 7:30 박경민 @ 2016-03-11 10:02 ` Lars Ellenberg 0 siblings, 0 replies; 4+ messages in thread From: Lars Ellenberg @ 2016-03-11 10:02 UTC (permalink / raw) To: drbd-dev On Fri, Mar 11, 2016 at 04:30:27PM +0900, 박경민 wrote: > Hello. > I'm a software engineer in Mantech. > > In testing about disk-timeout property, > if not default value, which will lead into a continuous loop. > > in request_timer_fn() > ... > if (device->disk_state[NOW] > D_FAILED) { > et = min_not_zero(et, dt); > next_trigger_time = time_min_in_future(now, > next_trigger_time, oldest_submit_jif + dt); > restart_timer = true; > } > ... > I think, if there is no request, next_trigger_time should be calculated > below > next_trigger_time = time_min_in_future(now, > next_trigger_time + *dt*, oldest_submit_jif + dt); > > However, I can't be sure. "dt" : disk timeout "et" : effective timeout "ent" : effective network timeout "now" : well, now. "next_trigger_time" : when to trigger the next timer next_trigger_time is initialized to "now". it gets adjusted using "time_min_in_future()", which is this helper: static unsigned long time_min_in_future(unsigned long now, unsigned long t1, unsigned long t2) { t1 = time_after(now, t1) ? now : t1; t2 = time_after(now, t2) ? now : t2; return time_after(t1, t2) ? t2 : t1; } time_after is ((long)((b) - (a)) < 0)), NOT <=. next_trigger_time will become larger than now, or stay at its initial value, which is now. function ends with if (restart_timer) { next_trigger_time = time_min_in_future(now, next_trigger_time, now + et); mod_timer(&device->request_timer, next_trigger_time); } so in case next_trigger_time will still be equal to now at the end of the function, it will be set to "now + et" before it is passed to mod_timer. et can only be zero if both network and disk timeout where zero, in which case the whole thing would not even be used, because that would mean timeouts are disabled. Besides that, I would be surprised if disk timeout in 9 worked properly yet. Also, disk timeout is evil in any case, and NOT TO BE USED (not even in 8.4, where it *does* work properly ("as designed"), afaik) Why? Because if it triggers, and the IO subsystem ("disk") decides to still process the submitted request some time later, you'd get stuff RDMA'd to some random memory page which may well be meanwhile re-used for unrelated things. In which case we intentionally panic(). But you knew that already. -- : Lars Ellenberg : LINBIT | Keeping the Digital World Running : DRBD -- Heartbeat -- Corosync -- Pacemaker : R&D, Integration, Ops, Consulting, Support DRBD® and LINBIT® are registered trademarks of LINBIT ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-14 10:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.3.1457694002.12272.drbd-dev@lists.linbit.com>
2016-03-14 5:37 ` [Drbd-dev] drbd-dev Digest, Vol 133, Issue 7 박경민
2016-03-14 10:23 ` [Drbd-dev] request_timer continuous loop if there is disk-timeout Lars Ellenberg
2016-03-11 7:30 박경민
2016-03-11 10:02 ` Lars Ellenberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox