Page MenuHomeFreeBSD

glebius (Gleb Smirnoff)
User

Projects

User Details

User Since
May 28 2014, 2:27 PM (445 w, 6 h)

Recent Activity

Today

glebius committed rG3f89900bf1a4: udp6: fix build with INET6 and without INVARIANTS (authored by glebius).
udp6: fix build with INET6 and without INVARIANTS
Wed, Dec 7, 8:30 PM
glebius committed rG78ec11361759: tests/netinet: mark more tests that require python (authored by glebius).
tests/netinet: mark more tests that require python
Wed, Dec 7, 7:54 PM
glebius committed rG1aed3b34301e: udp: add protocol method declarations to udp_var.h (authored by glebius).
udp: add protocol method declarations to udp_var.h
Wed, Dec 7, 7:53 PM
glebius committed rG5bfc014f2345: udp6: inline udp6_output() into udp6_send() (authored by glebius).
udp6: inline udp6_output() into udp6_send()
Wed, Dec 7, 7:53 PM
glebius committed rG32920f038a3a: udp: inline udp_output() into udp_send() (authored by glebius).
udp: inline udp_output() into udp_send()
Wed, Dec 7, 7:53 PM
glebius committed rG483fe96511ec: udp: embed inpcb into udpcb (authored by glebius).
udp: embed inpcb into udpcb
Wed, Dec 7, 7:52 PM
glebius committed rG0c0d8a4f7e54: udp: rearrange declarations in udp_var.h into user and _KERNEL halves (authored by glebius).
udp: rearrange declarations in udp_var.h into user and _KERNEL halves
Wed, Dec 7, 5:57 PM
glebius committed rG294a609fc07d: udp: destroy UDP and UDP-Lite inpcbinfos in single SYSUNINIT (authored by glebius).
udp: destroy UDP and UDP-Lite inpcbinfos in single SYSUNINIT
Wed, Dec 7, 5:57 PM
glebius committed rG446ccdd08e2a: tcp: use single locked callout per tcpcb for the TCP timers (authored by glebius).
tcp: use single locked callout per tcpcb for the TCP timers
Wed, Dec 7, 5:54 PM
glebius committed rG918fa4227d5b: tcp: remove tcp_timer_suspend() (authored by glebius).
tcp: remove tcp_timer_suspend()
Wed, Dec 7, 5:54 PM
glebius committed rGe68b3792440c: tcp: embed inpcb into tcpcb (authored by glebius).
tcp: embed inpcb into tcpcb
Wed, Dec 7, 5:54 PM

Yesterday

glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.
  • Zero t_precisions[which] in tcp_timer_enter(), by mav@
Tue, Dec 6, 7:54 PM
glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.
  • Provide precision calculation in tcp_timer_next() per Alexander's suggestion.
Tue, Dec 6, 7:36 PM
glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.
  • Save precisions from callout_when() and use them when scheduling.
Tue, Dec 6, 6:45 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
In D37321#855299, @mav wrote:

Is this returned precision going to be the same for any ticks argument or not? For example I call callout_when for TT_DELACK and store the result, but then I see that TT_PERSIST is going to be run earlier. Can I use precision returned by callout_when() for TT_DELACK to schedule TT_PERSIST?

callout_when() returns precision value as the biggest of two: percent of relative time (either system-wide or passed explicitly with C_PREL() via flags), or explicitly passed to it absolute value. Once with callout_when() you switch from relative to absolute times, you have no relative time and so you can only use absolute precision returned by it as-is. What I think you should do to properly aggregate the events with each other and with other system, is to make tcp_timer_next() return absolute time of the first event (t1) as time and min(time+precision) of all events minus t1 as precision.

Tue, Dec 6, 5:51 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

Oh, thanks! I got another question then. Is this returned precision going to be the same for any ticks argument or not? For example I call callout_when for TT_DELACK and store the result, but then I see that TT_PERSIST is going to be run earlier. Can I use precision returned by callout_when() for TT_DELACK to schedule TT_PERSIST?

Tue, Dec 6, 5:37 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
In D37321#855262, @mav wrote:
In D37321#855218, @mav wrote:

Even old callout_reset_on() is not that strict by using system-wide precision of 5%.

I don't see that. In sys/callout.h:

See tc_precexp in callout_when(). You've lost it when you dropped precision argument returned by callout_when().

Tue, Dec 6, 5:28 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
In D37321#855218, @mav wrote:

Even old callout_reset_on() is not that strict by using system-wide precision of 5%.

Tue, Dec 6, 5:17 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
In D37321#855218, @mav wrote:

Do I understand it correct that the "precision" argument to callout_reset_sbt_on() becomes pretty useless if we specify C_HARDLOCK?

It is not useless if specific CPU is idle when the time of the event comes. The current patch passing zero precision would wake up CPU exactly on that hardclock tick, whenever it is needed for anything else or not. May be it could aggregate with some other hardclock callouts there, but more likely not. Even old callout_reset_on() is not that strict by using system-wide precision of 5%. If TCP can allow lower precision, then you should specify it. It allows the callout to be handled at some later time when CPU finally wake up. For that to work you should probably store the absolute precision values in addition to absolute times and make tcp_timer_next() return both time and precision, if different TCP timers may have too different precisions that may conflict (formally later timer may have smaller precision and so can not wait for long precision of the formally first timer, that is normally resolved by callouts subsystem).

I am not a big fan of C_HARDCLOCK any more. With fast TSC clocks everywhere C_HARDCLOCK's ability to save on sbinuptime() gives much less benefits. It is still OK to use it, if the area is really tied to hardclock in some way, but I would prefer the precision mechanism to be used when possible instead or in addition to reach events aggregation.

Tue, Dec 6, 5:12 PM
glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.
  • Use callout_when() to make sure that we are rounded down
  • Don't use local variable named "ticks"
Tue, Dec 6, 12:27 AM

Mon, Dec 5

glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

I see. The current code uses callout_reset_on() which has C_HARDCLOCK in the macro, that does this rounding down. Do I understand it correct that the "precision" argument to callout_reset_sbt_on() becomes pretty useless if we specify C_HARDLOCK?

Mon, Dec 5, 11:17 PM
glebius added a comment to D37601: Mark imported state as PFTM_UNLINKED before freeing it.
Mon, Dec 5, 10:30 PM
glebius requested review of D37610: tcp: fix counter leak for SYN_RCVD state when syncache_socket() fails.
Mon, Dec 5, 10:23 PM

Fri, Dec 2

glebius committed rG0aa120d52f3c: inpcb: allow to provide protocol specific pcb size (authored by glebius).
inpcb: allow to provide protocol specific pcb size
Fri, Dec 2, 10:11 PM
glebius committed rG657729a89dd5: Retire trpt(8). (authored by glebius).
Retire trpt(8).
Fri, Dec 2, 10:11 PM
glebius closed D37126: inpcb: allow to provide protocol specific pcb size.
Fri, Dec 2, 10:11 PM
glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

I plan to push this change next week.

Fri, Dec 2, 7:44 PM

Fri, Nov 25

glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

I got some profiling data when running without WITNESS and with patch that counts the loops. The machines were serving 10 - 100 Gbit/s, but as they are using RACK, they use TCP timers not as often as the default stack does. Some machines didn't detect any looping but most experienced very little looping:

Fri, Nov 25, 5:13 AM
glebius added inline comments to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
Fri, Nov 25, 5:03 AM

Mon, Nov 21

glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

Profiling data for longer period. Note that the kernel is with WITNESS, I believe this explains very long spin times. In a day or two I will have larger profiling data for a group of machines and without WITNESS.

# sysctl net.inet.tcp.timer_stop_loops
net.inet.tcp.timer_stop_loops: 0 5 4 5 2 3 5 7 3 3 1 0 2 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0
# uptime
 5:12PM  up 3 days,  7:58, 2 users, load averages: 9.67, 9.64, 9.86
Mon, Nov 21, 5:13 PM
glebius added inline comments to D37321: tcp: use single locked callout per tcpcb for the TCP timers.
Mon, Nov 21, 5:11 PM
glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.
  • Rename the flag.
  • Check absence of flag before setting.
Mon, Nov 21, 5:09 PM

Fri, Nov 18

glebius added a comment to D37321: tcp: use single locked callout per tcpcb for the TCP timers.

Some profiling on how often and how long the looping happens. With this patch:

Fri, Nov 18, 5:04 PM
glebius added a reviewer for D37321: tcp: use single locked callout per tcpcb for the TCP timers: kib.
Fri, Nov 18, 4:57 PM
glebius updated the diff for D37321: tcp: use single locked callout per tcpcb for the TCP timers.

Add a handler for callout_stop() failure and a comment explaining what's going on.

Fri, Nov 18, 4:56 PM

Thu, Nov 17

glebius committed rGbc5708c0e2fc: counter: fix SYSCTL_COUNTER_U64_ARRAY type (authored by glebius).
counter: fix SYSCTL_COUNTER_U64_ARRAY type
Thu, Nov 17, 4:18 PM

Thu, Nov 10

glebius added a comment to D37326: if_ovpn: ensure we're in vnet context when calling sorele().

Just a fractional micropercent optimization suggestion. First set the VNET context, then enter the epoch. Same at the end: first exit the epoch, then restore VNET pointer. The VNET context set on a thread for extra time doesn't have any negative impact. The epoch prolonged for extra time does.

Thu, Nov 10, 6:09 PM

Wed, Nov 9

glebius accepted D37314: tcp: account sent/received IP ECN markings independently.
Wed, Nov 9, 11:09 PM
glebius abandoned D37123: tcp: provide macros to access inpcb and socket from a tcpcb.

Has been committed 9eb0e8326d0fe73ae947959c1df327238d3b2d53

Wed, Nov 9, 11:04 PM
glebius abandoned D37261: tcp: use locked callouts for the TCP timers.

Yes, you are right. It is impossible to create raceless self-freeing callout with two callouts embedded into the same structure. This revision superseded by D37321.

Wed, Nov 9, 11:02 PM
glebius requested review of D37321: tcp: use single locked callout per tcpcb for the TCP timers.
Wed, Nov 9, 11:02 PM

Tue, Nov 8

glebius committed rGb40ae8c9fe73: tcp: fix build without INVARIANTS and VIMAGE (authored by glebius).
tcp: fix build without INVARIANTS and VIMAGE
Tue, Nov 8, 8:36 PM
glebius committed rG326f4556250d: tcp: forward declare struct tcpcb in the TCP logging header (authored by glebius).
tcp: forward declare struct tcpcb in the TCP logging header
Tue, Nov 8, 6:33 PM
glebius committed rG73bebcc5bd53: inpcb: remove TCP includes, all TCP specific code was moved (authored by glebius).
inpcb: remove TCP includes, all TCP specific code was moved
Tue, Nov 8, 6:26 PM
glebius committed rG8840ae228807: tcp: don't store VNET in every tcpcb, take it from the inpcbinfo (authored by glebius).
tcp: don't store VNET in every tcpcb, take it from the inpcbinfo
Tue, Nov 8, 6:26 PM
glebius committed rGab0ef9455f73: hpts: move inp initialization from the generic inpcb code to TCP (authored by glebius).
hpts: move inp initialization from the generic inpcb code to TCP
Tue, Nov 8, 6:26 PM
glebius committed rG9eb0e8326d0f: tcp: provide macros to access inpcb and socket from a tcpcb (authored by glebius).
tcp: provide macros to access inpcb and socket from a tcpcb
Tue, Nov 8, 6:26 PM
glebius closed D37125: tcp: don't store VNET in every tcpcb, take it from the inpcbinfo.
Tue, Nov 8, 6:26 PM
glebius committed rGf71cb9f74808: tcp: inp_socket is valid through the lifetime of a TCP inpcb (authored by glebius).
tcp: inp_socket is valid through the lifetime of a TCP inpcb
Tue, Nov 8, 6:26 PM
glebius closed D37124: hpts: move inp initialization from the generic inpcb code to TCP.
Tue, Nov 8, 6:26 PM
glebius closed D37062: tcp: inp_socket is valid through the lifetime of a TCP inpcb.
Tue, Nov 8, 6:26 PM
glebius committed rGada90cb978e1: tcp: remove INP_DROPPED check from notify functions (authored by glebius).
tcp: remove INP_DROPPED check from notify functions
Tue, Nov 8, 6:26 PM
glebius closed D37061: inpcb: don't return INP_DROPPED entries from pcb lookups.
Tue, Nov 8, 6:25 PM
glebius committed rGf567d55f5152: inpcb: don't return INP_DROPPED entries from pcb lookups (authored by glebius).
inpcb: don't return INP_DROPPED entries from pcb lookups
Tue, Nov 8, 6:25 PM
glebius added a comment to D37261: tcp: use locked callouts for the TCP timers.

Note: this version will fire KASSERT at certain conditions, as it is incorrect. However, even with correct assert this version has potential use after free, that is hidden by the use of SMR memory for tcpcbs. Right now this revision is not targeted to cgit, it is posted just to share code.

Tue, Nov 8, 1:51 AM

Nov 4 2022

glebius requested review of D37261: tcp: use locked callouts for the TCP timers.
Nov 4 2022, 3:54 AM

Nov 3 2022

glebius added a comment to D37112: tcp: Don't try to disconnect a socket multiple times..

I'm also putting that on tomorrows TCP talk agenda with tuexen, rscheff and others.

Nov 3 2022, 3:19 AM
glebius added a comment to D37112: tcp: Don't try to disconnect a socket multiple times..

May I ask for more time? I just found out that the only reason the TIME_WAIT persists correctly with the current code is that callout_drain_async() doesn't really behave as it is documented. Even when it is able to stop callout immediately, it will leave it for a drain at the scheduled time. So, when I was doing the 9c3507f91987b7c8ce3b895a5ee46a1de6bc42f2 change, I was puzzled why I can safely remove all this TIME_WAIT handling from here, as it seems right, but is never executing. Now I realized why it happened so. I'm working towards standard callout KPI for the TCP timers and this will very likely almost revert 9c3507f91987b7c8ce3b895a5ee46a1de6bc42f2 back to original Robert's code. It could be that the TOE problem will go away or it could manifest itself in a different manner.

Nov 3 2022, 3:19 AM

Nov 2 2022

glebius added a comment to D37229: ng_parse: disallow negative length for malloc.

Looking at 267334. IMHO, we should return the error for invalid message as close as possible to the userland. Don't let the invalid data travel this down.

Nov 2 2022, 6:16 PM
glebius requested changes to D37229: ng_parse: disallow negative length for malloc.

Can we return unsigned value from ng_get_composite_len() instead?

Nov 2 2022, 6:14 PM

Oct 31 2022

glebius committed R11:85afc194241b: go.mk: enable PIE build for amd64 only (authored by glebius).
go.mk: enable PIE build for amd64 only
Oct 31 2022, 10:35 PM
glebius committed rG620042a66b68: tcp.4: undocument compressed TIME_WAIT (authored by glebius).
tcp.4: undocument compressed TIME_WAIT
Oct 31 2022, 4:04 PM
glebius committed rGc348e8805365: tcp: make tcp_handle_wakeup() static and robust (authored by glebius).
tcp: make tcp_handle_wakeup() static and robust
Oct 31 2022, 3:58 PM
glebius added a reverting change for rG5f311da2ccb6: Port randomization leads to extremely fast port reuse at high: rG19acc50667bf: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 31 2022, 3:58 PM
glebius added a reverting change for rG6ee79c59d2c0: o Document net.inet.ip.portrange.random* sysctls.: rG19acc50667bf: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 31 2022, 3:58 PM
glebius committed rG19acc50667bf: inpcb: retire suppresion of randomization of ephemeral ports (authored by glebius).
inpcb: retire suppresion of randomization of ephemeral ports
Oct 31 2022, 3:58 PM
glebius closed D37115: tcp: make tcp_handle_wakeup() static and robust.
Oct 31 2022, 3:58 PM
glebius closed D37042: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 31 2022, 3:58 PM
glebius committed rG65a58d63902a: icmp: doesn't need tcp_var.h (authored by glebius).
icmp: doesn't need tcp_var.h
Oct 31 2022, 3:45 PM
glebius committed rGf504685a7ade: rack/bbr: put back assertion that connection is not in TIME-WAIT (authored by glebius).
rack/bbr: put back assertion that connection is not in TIME-WAIT
Oct 31 2022, 3:34 PM
glebius added a comment to D37112: tcp: Don't try to disconnect a socket multiple times..

@jhb can you please share the actual panic message and trace with TOE? Also the suggested change is actually two different changes preventing call tp tcp_usr_disconnect() in TIME-WAIT. Is there two different panic paths?

Oct 31 2022, 3:20 PM

Oct 29 2022

glebius added a comment to D37112: tcp: Don't try to disconnect a socket multiple times..

May I ask for time until Wednesday to think more about this? If it critical for further work on TOE it is fine to just commit as is.

Oct 29 2022, 4:09 AM

Oct 26 2022

glebius committed rG77fe40cf2f39: netinet*: add back necessary headers (authored by glebius).
netinet*: add back necessary headers
Oct 26 2022, 3:18 PM

Oct 25 2022

glebius requested review of D37127: tcp: embed inpcb into tcpcb.
Oct 25 2022, 6:58 PM
glebius requested review of D37126: inpcb: allow to provide protocol specific pcb size.
Oct 25 2022, 6:22 PM
glebius requested review of D37125: tcp: don't store VNET in every tcpcb, take it from the inpcbinfo.
Oct 25 2022, 6:22 PM
glebius requested review of D37124: hpts: move inp initialization from the generic inpcb code to TCP.
Oct 25 2022, 6:21 PM
glebius requested review of D37123: tcp: provide macros to access inpcb and socket from a tcpcb.
Oct 25 2022, 6:20 PM
glebius added inline comments to D37112: tcp: Don't try to disconnect a socket multiple times..
Oct 25 2022, 6:14 PM
glebius added a comment to D37112: tcp: Don't try to disconnect a socket multiple times..

I would prefer to understand and eliminate the scenario when we are calling disconnect on an already disconnected socket, instead of reintroducing this bandaid. Is there any way for me to reproduce it without Chelsio hardware?

Oct 25 2022, 6:12 PM
glebius committed rG92e190f11fe8: netinet*: remove unneeded headers from files that just declare domains (authored by glebius).
netinet*: remove unneeded headers from files that just declare domains
Oct 25 2022, 6:10 PM
glebius committed rGeda633455a63: tcp: remove useless today lock assertion in a middle of function (authored by glebius).
tcp: remove useless today lock assertion in a middle of function
Oct 25 2022, 6:10 PM
glebius requested review of D37115: tcp: make tcp_handle_wakeup() static and robust.
Oct 25 2022, 12:57 AM

Oct 24 2022

glebius committed rGba23f762ece5: acpi_ged: fix build with ACPI_DEBUG (authored by glebius).
acpi_ged: fix build with ACPI_DEBUG
Oct 24 2022, 4:03 PM

Oct 21 2022

glebius accepted D37080: Rack and BBR broken with the new timewait state purge..

This is how it gets through! I should also restore the KASSERT()s in rack/bbr, then.

Oct 21 2022, 2:30 PM

Oct 19 2022

glebius abandoned D23408: epoch support for taskqueues.

Was abandoned in favor of D23518

Oct 19 2022, 10:47 PM
glebius requested review of D37062: tcp: inp_socket is valid through the lifetime of a TCP inpcb.
Oct 19 2022, 10:44 PM
glebius added inline comments to D37061: inpcb: don't return INP_DROPPED entries from pcb lookups.
Oct 19 2022, 10:43 PM
glebius abandoned D26027: Catch illegal M_WAITOK immediately..

This legacy revision has some metadata legacy from subversion times. The arc tool fails on it. Will reopen this revision with git-arc.

Oct 19 2022, 10:41 PM
glebius changed the repository for D26027: Catch illegal M_WAITOK immediately. from rS FreeBSD src repository - subversion to rG FreeBSD src repository.
Oct 19 2022, 10:37 PM
glebius requested review of D37061: inpcb: don't return INP_DROPPED entries from pcb lookups.
Oct 19 2022, 10:22 PM
glebius committed rGb6a816f11688: inpcb: garbage collect so_sototcpcb() (authored by glebius).
inpcb: garbage collect so_sototcpcb()
Oct 19 2022, 10:19 PM
glebius committed rG24cf7a8d6285: inpcb: provide pcbinfo pointer argument to inp_apply_all() (authored by glebius).
inpcb: provide pcbinfo pointer argument to inp_apply_all()
Oct 19 2022, 10:19 PM
glebius committed rGb2c558c898b8: cxgbe: include headers required to include t4_tom.h (authored by glebius).
cxgbe: include headers required to include t4_tom.h
Oct 19 2022, 10:19 PM
glebius committed rGe1401f75790f: cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb (authored by glebius).
cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb
Oct 19 2022, 10:19 PM
glebius closed D37041: cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb.
Oct 19 2022, 10:18 PM
glebius added a comment to D37042: inpcb: retire suppresion of randomization of ephemeral ports.

More discussion on the suppression back when it was added: https://lists.freebsd.org/pipermail/freebsd-net/2004-December/006088.html

Oct 19 2022, 4:37 AM
glebius added a reverting change for rG5f311da2ccb6: Port randomization leads to extremely fast port reuse at high: D37042: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 19 2022, 2:17 AM
glebius added a reverting change for rG6ee79c59d2c0: o Document net.inet.ip.portrange.random* sysctls.: D37042: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 19 2022, 2:17 AM
glebius requested review of D37042: inpcb: retire suppresion of randomization of ephemeral ports.
Oct 19 2022, 2:17 AM