Page MenuHomeFreeBSD

epoch support for taskqueues [2]
ClosedPublic

Authored by glebius on Feb 5 2020, 5:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 10:56 PM
Unknown Object (File)
Sat, Dec 7, 4:22 AM
Unknown Object (File)
Mon, Nov 25, 5:17 PM
Unknown Object (File)
Sun, Nov 24, 7:26 AM
Unknown Object (File)
Nov 21 2024, 4:14 PM
Unknown Object (File)
Nov 20 2024, 9:00 AM
Unknown Object (File)
Nov 19 2024, 4:36 PM
Unknown Object (File)
Nov 19 2024, 1:03 AM

Details

Summary

[this is second invocation of D23408]

Add optional epoch to struct task and struct gtask. When processing a taskqueue and a task has associated epoch, then enter for duration of the task. If consecutive tasks belong to the same epoch, batch them.

Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process incoming packets in taskqueue context.

Add a temporary compatibility hack to ease transition to new ABI for people who have port modules (e.g. nvidia.ko).

https://github.com/glebius/FreeBSD/commits/taskq-epoch

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

glebius retitled this revision from Summary: epoch support for taskqueues [2] to epoch support for taskqueues [2].Feb 5 2020, 5:52 PM
glebius edited the summary of this revision. (Show Details)
sys/sys/taskqueue.h
113 ↗(On Diff #67820)

Should you add:

.ta_epoch = NULL

Even if that is implicit?

sys/sys/taskqueue.h
113 ↗(On Diff #67820)

I'd rather remove .ta_pending = 0 assignment, instead. The whole idea behind the C99 sparse initializers was to make it possible to change structure definition without necessity to touch every initializer. Explicit zeroing of every field brings functionality down to the level of C90 initializers.

I'm good with this change.

sys/sys/taskqueue.h
113 ↗(On Diff #67820)

I'm fine with that.

Convert pointer in struct task to a flag.

jeff added inline comments.
sys/sys/_task.h
69–70 ↗(On Diff #68101)

I would redefine these to be identical type widths to task.

It should be ABI compatible with just more wasted space if I am reading it correctly.

hselasky added inline comments.
sys/sys/_task.h
52 ↗(On Diff #68101)

In big endian machines this will be byte-swapped for binary compatibility (just a FYI)

uint16_t ta_priority:8;
uint16_t ta_flags:8;

--HPS

sys/kern/subr_gtaskqueue.c
366 ↗(On Diff #68101)

in_net_epoch needs update! It is currently only set once.

sys/kern/subr_taskqueue.c
469 ↗(On Diff #68101)

Where are you updating in_net_epoch ?

  • Add flag to struct task to mark the task as requiring network epoch.
  • Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
  • Revert "Temporarily force IFF_NEEDSEPOCH until drivers have been resolved."
This revision was not accepted when it landed; it landed in state Needs Review.Feb 11 2020, 6:48 PM
This revision was automatically updated to reflect the committed changes.