Page MenuHomeFreeBSD

iscsi: Use calloutng instead of ticks in iscsi initiator
ClosedPublic

Authored by rscheff on Feb 9 2022, 10:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 2:39 AM
Unknown Object (File)
Mon, Dec 2, 12:41 AM
Unknown Object (File)
Mon, Dec 2, 12:41 AM
Unknown Object (File)
Mon, Dec 2, 12:41 AM
Unknown Object (File)
Mon, Dec 2, 12:41 AM
Unknown Object (File)
Mon, Dec 2, 12:40 AM
Unknown Object (File)
Mon, Nov 25, 6:36 PM
Unknown Object (File)
Nov 24 2024, 9:14 PM
Subscribers

Details

Summary

This is the initial patch to improve the timing system for
the iscsi initiator.

Preliminary plan to reduce ping/timeout scheduling overhead, while
also improving the functionality to more closely align with the
expected behavior:

  1. move to calloutng - with same 1-sec callouts (and a 10 ms

window, to allow some kernel scheduling improvements)

  1. change internal representation of (per session) timeouts

from seconds to milliseconds

  1. allow per-session timeouts to be freely configurable, with

bounded minimum of 100ms

  1. perform iscsid/login timeout callout only once (if configured)

instead of once every second.

  1. perform iscsi ping timeout three times in the

defined interval to transmit SCSI_NOP packets - rather than sending
one ping every second even when very long timeouts are configured.

  1. improve loss-of-connectivity detection by tracking socket buffer

levels between pings - if the socket buffer does not drain between
pings, better not wait for TCP RTO firing (which could be up to 512
seconds in between), but rather re-connect session quickly.

sysctls retain 1-sec granularity, only allow per-session settings
to be parsed as floats (e.g. 0.100 for 100 milliseconds)

Retain log output unless fractional-second timeouts are in use.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • make the call centered around the 1 sec mark
sys/dev/iscsi/icl_soft_proxy.c
188–190

Perhaps define these in terms of mstosbt()? I'm not sure rounding errors matter as much for milliseconds, but I think in general we prefer the APIs in <sys/time.h> over direct math with the SBT_* constants, something like:

sbt = mstosbt(995);
pr = mstosbt(10);
rscheff added inline comments.
sys/dev/iscsi/icl_soft_proxy.c
188–190

Thanks for this hint!

This revision is now accepted and ready to land.Feb 15 2022, 5:23 PM
This revision was automatically updated to reflect the committed changes.
rscheff marked an inline comment as done.

I'm sorry for late look. I was on vacation. I have no objections, just some comments.

sys/dev/iscsi/icl_soft_proxy.c
188–190

I just hope compiler preprocess those function calls all the way into a single value, as it would do for old SBT_* math. I'd also do it inline without using variables. I am also not sure it makes much sense to shift down the sbt value by half of precision, since I doubt there will be even distribution.