Page MenuHomeFreeBSD

remove cyclic and replace its uses with callout
ClosedPublic

Authored by avg on Nov 14 2014, 3:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 12:07 PM
Unknown Object (File)
Nov 10 2024, 5:57 AM
Unknown Object (File)
Nov 3 2024, 2:28 AM
Unknown Object (File)
Oct 23 2024, 8:22 PM
Unknown Object (File)
Oct 17 2024, 9:03 PM
Unknown Object (File)
Oct 17 2024, 9:02 PM
Unknown Object (File)
Oct 17 2024, 9:02 PM
Unknown Object (File)
Oct 17 2024, 9:02 PM
Subscribers

Details

Summary

Sub-changes:

  • callout(9): add sbt flavors of callout_schedule
  • dtrace profile: make use of callout_schedule_sbt_curcpu, callout_schedule_sbt
NOTE: Previously the cyclic code would set cpu_profile_pc and cpu_profile_upc, but now we have to extract them correctly. Note that when a CPU transitions from idle state to active state cpu_activeclock() function would process timer events that might have been missed while idle and in that case there will be no interrupted frame abd thus the program counter arguments would not be set.

To do: remove solaris_cpu_t, replace the remaining used fields with DPCPU

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

avg retitled this revision from to remove cyclic and replace its uses with callout.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: markj, jhb.
avg updated this object.

fix a typo in a local commit message

This all looks good to me. I'd like at least one other reviewer to chime in before this is committed.

This is awesome - thanks for doing it!

sys/cddl/dev/profile/profile.c
285

I think you need to check whether frame == NULL here too; I was able to get a page fault with interrupts disabled here when mucking around with tick probes, and the faulting thread was the idle thread for the cpu.

480

Elsewhere this is written as #if defined(sun), but it's up to you.

For code under cddl/dev, I usually don't bother keeping the upstream code at all, since we don't merge to that directory from the vendor branch, and the code there tends to be fairly divergent from upstream anyway. But again, up to you.

sys/sys/callout.h
97

Is it actually necessary to paranthesize the macro arguments when they're being passed as separate arguments to a function call? It looks like the existing macros do it though, so callout_schedule_sbt_on might as well be consistent.

sys/cddl/dev/profile/profile.c
285

Yes, thank you, will fix this.

NB: I would prefer cpu_idle() -> cpu_activeclock() path would also set td_intr_frame to something reasonable, but not sure how to do that.

480

I think that we are gradually switching from 'sun' to 'illumos' in new zfs code, so I applied the same approach here.

Yeah, I noticed that we keep two copies of many dtrace related files in the tree, one that is closer to the upstream and one that is actually used. I think the former is confusing and quite redundant given the vendor area. So, in this instance I decided to keep the original code for the reference.

sys/sys/callout.h
97

Good point. I think that the parentheses are not strictly needed here, but I'll fix the code to be consistent.

avg edited edge metadata.
  • follow nearby style in callout_schedule_sbt family of macros
  • whitespace and cosmetic changes in callout_reset family of macros
  • profile_tick(): td_intr_frame could be NULL
markj edited edge metadata.

LGTM!

This revision is now accepted and ready to land.Nov 20 2014, 7:06 PM
avg updated this revision to Diff 2669.

Closed by commit rS275576 (authored by @avg).