Page MenuHomeFreeBSD

olce (Olivier Certner)
User

Projects (6)

User Details

User Since
Feb 26 2021, 3:47 PM (298 w, 5 d)

Recent Activity

Today

olce requested review of D61713: cpu_switch(): Move 'sw1wait' inside the function block.
Wed, Nov 18, 2:15 PM

Mon, Nov 16

olce accepted D61512: sched_ule: Skip the CPU search for threads bound to one CPU.

I tested your CPU_FFS()/CPU_FFS_AT() variant on the same workload (64-thread EPYC 7502P, sustained UDP receive, one bound worker per CPU). sched_pickcpu() itself went from 0.024% of total CPU time with the flag to 0.032% without it, a small increase, and cpu_search_lowest() was unchanged (0.113% vs 0.115%).

Mon, Nov 16, 9:57 PM
olce added a comment to D60648: For consistency, resolve link devices relative to the root object (/) rather than the ECDT Namepath, which is not always an absolute path..

After reading the spec a bit, I'm convinced that this change is most probably fine in all cases, as the ECDT is always supposed to contain in field EC_ID a "fully qualified reference to the namespace object", so every spec-compliant will continue to work as before, your case (missing the \, absolute path marker) will be fixed, and normally other cases with a garbage EC_ID should continue not working without ill effect.

Mon, Nov 16, 5:40 PM
olce accepted D61596: mac: Fix a couple of bugs in prison label handling.

That works too, but why is it better? In this patch all of the cleanup steps are at the end of the function, and error paths just have to pick one. In your proposal, the error path does some cleanup, then jumps to the end of the function to do some cleanup. Splitting it that way seems error-prone to me.

Mon, Nov 16, 5:16 PM
olce added a comment to D60391: linux: implement basic `sched_setattr` syscall.

I already did a review in Forgejo, but apparently it is currently inaccessible. So you spotted the main bug I wanted to report, that's great. Also, in order to mimick what we do in native calls and what is done in linux_sched_getattr(), I'd move the linux_tdfind() above, just after the copyin(). And I think there was some other minor thing I raised in Forgejo but I don't remember...

Mon, Nov 16, 2:25 PM
olce added a comment to D61596: mac: Fix a couple of bugs in prison label handling.

Alternative: Set mac.m_string to NULL in the intlabel == NULL case.

Mon, Nov 16, 2:11 PM
olce added a comment to D60655: acpica: Add a thread safe acpi_get_name.

Please also consider re-implementing acpi_name() on top of acpi_get_name().

Mon, Nov 16, 9:55 AM
olce added a reviewer for D61512: sched_ule: Skip the CPU search for threads bound to one CPU: scheduler.
Mon, Nov 16, 8:51 AM
olce added a comment to D61512: sched_ule: Skip the CPU search for threads bound to one CPU.

That change looks correct (all proper places having been updated), but I would please ask you to test an alternative without new flag at all, so without the need for cpuset_flags_update(), where the following code in sched_pickcpu():

	if (td->td_cpuset->cs_flags & CPU_SET_ONECPU) {
		SCHED_STAT_INC(pickcpu_onecpu);
		return (CPU_FFS(mask) - 1);
	}

is replaced by something like (to be amended as per style(9)):

	int first_cpu_ffs = CPU_FFS(mask);
        MPASS(first_cpu_ffs > 0);
        if (cpu_ffs == CPU_SETSIZE || CPU_FFS_AT(mask, first_cpu_ffs) == 0) {
		SCHED_STAT_INC(pickcpu_onecpu);
		return (first_cpu_ffs - 1);
	}

where you will have to (trivially) define CPU_FFS_AT() in terms of __BIT_FFS_AT() (as CPU_FFS() is on top of __BIT_FFS().

Mon, Nov 16, 8:50 AM
olce committed rG7d43e93a75e8: sched_ule: Fix two typos in comments introduced in previous commit.
Mon, Nov 16, 8:08 AM

Sat, Nov 14

olce requested review of D61548: acpi: Tasks: Always enqueue in the taskqueue right away.
Sat, Nov 14, 4:47 PM
olce requested review of D61547: acpi: Tasks: Remove the now-redundant 'acpi_task_count'.
Sat, Nov 14, 4:47 PM
olce requested review of D61546: acpi: Tasks: Count task slots used during boot separately.
Sat, Nov 14, 4:47 PM
olce closed D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Sat, Nov 14, 4:31 PM
olce committed rG538c48bf6247: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Sat, Nov 14, 4:31 PM
olce committed rG2210a2f8d470: sched_ule: tdq_move(): INVARIANTS: Remove a superfluous assertion.
Sat, Nov 14, 4:30 PM
olce committed rG3a1f5a28f007: proc.h: Order thread_lock*() functions more logically.
Sat, Nov 14, 4:30 PM
olce committed rG136e3a3eba5b: sched_ule: sched_rem(): Use THREAD_LOCKPTR_ASSERT() instead of MPASS().
Sat, Nov 14, 4:30 PM
olce committed rG00add43b882c: sched_ule: tdq_add(): INVARIANTS: Add check, fix name in assertion strings.
Sat, Nov 14, 4:30 PM
olce committed rG2ba9debd3ac9: sched_ule: Document fields of 'struct runq_steal_pred_data'.
Sat, Nov 14, 4:30 PM

Fri, Nov 13

olce added inline comments to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Fri, Nov 13, 10:39 PM
olce updated the diff for D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
  • Update again the commit message and the comment in sched_switch_migrate() for better clarity.
  • Optimize tdq_lock_pair() by first trying an optimistic lock of two if one is already held before dropping one and doing a full cycle.
Fri, Nov 13, 10:35 PM
olce committed rGfde43820f31d: acpi: Tasks: Precisely report the maximum number of slots used.
Fri, Nov 13, 6:50 PM
olce committed rG067161c31fe8: acpi: Tasks: Ensure sane values for number of tasks and threads.
Fri, Nov 13, 6:50 PM
olce committed rGee417f9f7f27: acpi: Tasks: Use M_WAITOK to allocate the taskqueue.
Fri, Nov 13, 6:50 PM
olce closed D60375: acpi: Tasks: Precisely report the maximum number of slots used.
Fri, Nov 13, 6:50 PM
olce closed D60373: acpi: Tasks: Ensure sane values for number of tasks and threads.
Fri, Nov 13, 6:50 PM
olce closed D60379: acpi: Tasks: Use M_WAITOK to allocate the taskqueue.
Fri, Nov 13, 6:50 PM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.

A short note on the commit message: (snip)

Fri, Nov 13, 6:05 PM
olce updated the diff for D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
  • Start the commit message with a short summary.
  • Drop the erroneous MTX_DUPOK removal.
Fri, Nov 13, 5:44 PM
olce added inline comments to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Fri, Nov 13, 4:00 PM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.

(snip) That would be the first ideas coming to my mind.

Fri, Nov 13, 2:55 PM
olce added inline comments to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Fri, Nov 13, 2:52 PM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.

That said, I've just checked and the struct tdq objects have their addresses effectively ordered by CPU ID (see, e.g., DPCPU_ID_PTR()), which can be useful to quickly infer the ordering.

Fri, Nov 13, 2:42 PM
olce updated the summary of D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Fri, Nov 13, 2:42 PM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
In D61448#1409540, @avg wrote:

I would not really be able to confirm that.
So far, it happened only once in many years on a fleet of thousands of systems.

Fri, Nov 13, 2:28 PM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
In D61448#1409577, @avg wrote:

Also, the description says that locks are ordered based on CPU ID, but in the code tdq addresses are compared.
Not sure if the they have the same order as CPU IDs.
At least, it's not obvious.

Fri, Nov 13, 2:15 PM
olce added a comment to D61168: build: sys: Define NORMAL_CPP variable, to be used in 'files*'.

Ping? I'd like to move this one and the next (D61169) forward, as they look quite reasonable, but I'm not very familiar with the build system and if that goes against some specific plans or practice, so I'd prefer an external look.

Fri, Nov 13, 10:28 AM
olce added a comment to D60373: acpi: Tasks: Ensure sane values for number of tasks and threads.

should we also warn if we set silly sysctl values?

Fri, Nov 13, 10:25 AM
olce added a comment to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.

@avg : Could you please test that in your environment and confirm the deadlock is gone?

Fri, Nov 13, 9:10 AM

Thu, Nov 12

olce added inline comments to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Thu, Nov 12, 10:30 PM
olce updated the diff for D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
  • Change strategy to fix the problem (see updated commit message, in particular the paragraph starting with "The fix is similar...").
  • Update the commit message with what is hopefully a more precise and intelligible description (yes, it is very long).
  • Remove side changes (will go into separate trivial commits).
Thu, Nov 12, 10:27 PM
olce added inline comments to D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Thu, Nov 12, 10:15 PM

Wed, Nov 11

olce requested review of D61448: sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread.
Wed, Nov 11, 10:33 PM
olce accepted D57346: p1003_1b: Add capability mode checks.
Wed, Nov 11, 2:39 PM
olce accepted D61431: acpi_cpu: Bring back setting BM_RLD on resume.

Oh, sorry to have missed that too. :-)

Wed, Nov 11, 11:22 AM
olce added a reviewer for D57346: p1003_1b: Add capability mode checks: olce.
Wed, Nov 11, 10:08 AM
olce added a comment to D61412: sched_*(2), rtprio*(2): Add capability mode checks.

Looks generally good.

Wed, Nov 11, 9:58 AM
olce requested changes to D57348: rtprio(_thread): Add capability mode checks.

See inline comment and D61412.

Wed, Nov 11, 9:53 AM

Tue, Nov 10

olce added a comment to D60002: scheduler.4, sched_{4bsd,ule}.4: sync current scheduler sysctls.

Approved by: olce (mentor)

Tue, Nov 10, 9:44 PM
olce accepted D60002: scheduler.4, sched_{4bsd,ule}.4: sync current scheduler sysctls.
  1. Schedulers introduced in future might have a different notion of "quantum". 4BSD and ULE share the same meaning, but for EEVDF's quantum is not an absolute measure. Quantum (or time slice) in EEVDF is scaled by weight.
Tue, Nov 10, 9:43 PM
olce added a comment to D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.

Sorry for delay @olce. My fleet is back online so we can resume testing.

Tue, Nov 10, 3:49 PM · drivers
olce added a comment to D60002: scheduler.4, sched_{4bsd,ule}.4: sync current scheduler sysctls.

Looks good overall. See inline comments for reformulations/suggestions. Also, I would suggest moving kern.sched.*.quantum and kern.sched.*.slice into scheduler.4.

Tue, Nov 10, 1:34 PM
olce added a comment to D60031: runqueue.9: rewrite.

Recently I was thinking about removing this and scheduler.9. Talk on freebsd-hackers. To mention what applies specifically to those man pages:

  • I believe only interfaces that are exposed to driver API should be documented in man9 (with exception of things like luastyle) and iiuc sched and runqueue functions shouldn't be called by drivers. Drivers should only "hint" the scheduler (e.g. hmp).
  • runqueue.9 and scheduler.9 have been out of sync for years, probably more than a decade, because developers forgot to update the manpage when they modified the code. To prevent this in future, this should be documented in Doxygen style along the code. Doxygen allows Markdown to be used for code documentation, so we can use it for writing examples. @adrian already does this for net80211. @seuros is also interested in this approach for code documentation.
  • As @adrian and @seuros have noted in the mailing thread, we lack content in Doxygen documentation. Moving those two man pages to Doxygen will be a great starting point for documenting scheduler subsystem.

Do you think we should start documenting scheduler stuff in Doxygen and pull them out from man pages?

Tue, Nov 10, 12:45 PM

Mon, Nov 9

olce added a comment to D60031: runqueue.9: rewrite.

That's great work. Frankly, I wouldn't have gone to the burden of documenting this facility into that level of details. For example, a (non-pressing) goal is to remove RQ_PPQ. I left it after reworking the runqueues just in case we would need to revert to the old behavior. It has not been the case, so RQ_PPQ has been an unimportant implementation detail, and it should go. We also might want to evolve the interface. But anyway, now that this is written, let's integrate it!

Mon, Nov 9, 6:07 PM
olce accepted D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.

Are you really sure about the change for Alder Lake? Looking at Linux sources, I see #define TGL_PMC_SLP_S0_RES_COUNTER_STEP 0x7A. I also see #define TGL_PMC_LPM_RES_COUNTER_STEP_X2 61 /* 30.5us * 2 */, so 30500 looks like a confusion.

Mon, Nov 9, 5:20 PM · drivers
olce added inline comments to D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.
Mon, Nov 9, 5:09 PM · drivers
olce added a comment to D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.

Are you really sure about the change for Alder Lake? Looking at Linux sources, I see #define TGL_PMC_SLP_S0_RES_COUNTER_STEP 0x7A. I also see #define TGL_PMC_LPM_RES_COUNTER_STEP_X2 61 /* 30.5us * 2 */, so 30500 looks like a confusion. If that is indeed the case, then reverting to milliseconds instead of microseconds is probably better.

Mon, Nov 9, 4:59 PM · drivers

Fri, Nov 6

olce added a comment to D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.

Ping? If you do not have time to work on it in the very short term, I'd like to take it over as I need to make progress and implement newer generations here.

Fri, Nov 6, 4:17 PM · drivers
olce added inline comments to D59596: intel/intel_pmc: Add support for Cannon Lake through Meteor Lake.
Fri, Nov 6, 4:12 PM · drivers

Wed, Nov 4

olce added a comment to D61134: acpi: Implement debug.acpi.suspend_bounce for suspend-to-idle.

Funny is that, for debugging, I'm doing the reverse at the moment (i.e., prevent devices from actually suspending, and running just cpu_idle()).

Wed, Nov 4, 5:17 PM
olce accepted D61134: acpi: Implement debug.acpi.suspend_bounce for suspend-to-idle.
Wed, Nov 4, 5:15 PM
olce requested review of D61195: intel_cpu_cstate(4): New driver, reports CPU-specific C-states residency.
Wed, Nov 4, 2:02 PM
olce committed rGd326ee6e9826: x86/mp_x86.c: unbreak COUNT_IPIS (authored by kib).
Wed, Nov 4, 1:34 PM
olce committed rG52fd2aabb772: powerpc: powerpc_ipi_handler(): Stop first, preempt last.
Wed, Nov 4, 1:26 PM
olce committed rGa6bcee2c76bc: x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS.
Wed, Nov 4, 1:26 PM
olce committed rGd54cae6c5ad6: x86: ipi_bitmap_handler(): Preempt last, reduce critical section.
Wed, Nov 4, 1:26 PM
olce committed rGc9e5bf3e6e39: sched: INVARIANTS: Check sched_preempt() is called on 'curthread'.
Wed, Nov 4, 1:26 PM
olce committed rGf27e4afe6486: sched_ule: Use TDQ_CPU() macro instead of fiddling with DPCPU.
Wed, Nov 4, 1:26 PM
olce committed rG97313fef935d: sched_ule: sched_affinity(): Delineate steps.
Wed, Nov 4, 1:26 PM
olce committed rG7118fa2c90bb: sched_ule: tdq_notify(): Fix a typo in a comment.
Wed, Nov 4, 1:26 PM
olce committed rG847ef7cee8aa: sched_ule: tdq_runq_add(): Scope variables, delineate the different steps.
Wed, Nov 4, 1:26 PM
olce committed rG051de28eb9bb: ObsoleteFiles.inc: <sys/kpilite.h> was removed.
Wed, Nov 4, 1:26 PM
olce committed rGb8cadc76350d: systm.h: Remove unused <sys/kpilite.h>.
Wed, Nov 4, 1:25 PM
olce committed rG1bdd2609b80a: sched.h: Include <sys/pcpu.h> unconditionally.
Wed, Nov 4, 1:25 PM
olce committed rG2065d90fb00e: sched.h: Fix a typo and remove an extra line.
Wed, Nov 4, 1:25 PM
olce committed rG1cfafa761ec9: sched: New scheduler interface definition scheme.
Wed, Nov 4, 1:25 PM
olce committed rG7817357c2601: cred: freebsd14_setgroups(): Remove a now-unnecessary local variable.
Wed, Nov 4, 1:25 PM
olce committed rG6f2f1f34784e: cred: Fix a race in the FreeBSD-14-compatible setgroups(2).
Wed, Nov 4, 1:25 PM
olce committed rG208d30a8f594: amdsmu(4): Fix 32-bit compile.
Wed, Nov 4, 12:21 PM
olce committed rGcd33fd75e856: sys/modules.h: Fix too long line.
Wed, Nov 4, 12:21 PM
olce accepted D61179: RELNOTES: Fix the name of the loader tunable kern.sched.name.
Wed, Nov 4, 10:08 AM
olce accepted D61178: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Wed, Nov 4, 10:07 AM

Tue, Nov 3

olce closed D61167: sched: Fix building kernel independently of world.
Tue, Nov 3, 10:56 PM
olce committed rGe89d0e74e23e: sched: Fix building kernel independently of world.
Tue, Nov 3, 10:56 PM
olce requested review of D61169: sched: Use NORMAL_CPP in 'compile-with' for namespacing headers.
Tue, Nov 3, 9:59 PM
olce requested review of D61168: build: sys: Define NORMAL_CPP variable, to be used in 'files*'.
Tue, Nov 3, 9:58 PM
olce requested review of D61167: sched: Fix building kernel independently of world.
Tue, Nov 3, 9:58 PM
olce committed rG510331fa3763: sched: Automatically namespace schedulers' implementation functions.
Tue, Nov 3, 5:43 PM
olce closed D60644: sched: Automatically namespace schedulers' implementation functions.
Tue, Nov 3, 5:43 PM
olce closed D60860: critical_exit_preempt(): Re-check for preemption locked.
Tue, Nov 3, 5:43 PM
olce committed rG28c312427583: critical_exit_preempt(): Re-check for preemption locked.
Tue, Nov 3, 5:43 PM

Tue, Oct 20

olce updated the diff for D60860: critical_exit_preempt(): Re-check for preemption locked.

Put back the temporary entry into a critical section around the thread_lock() call. It is in fact not an optimization but necessary for correct operation.

Tue, Oct 20, 5:23 PM
olce committed rG07ab87b60d08: powerpc: powerpc_ipi_handler(): Stop first, preempt last.
Tue, Oct 20, 4:48 PM
olce committed rG3a0e2ca3eecd: x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS.
Tue, Oct 20, 4:48 PM
olce committed rGb83bd6fec075: x86: ipi_bitmap_handler(): Preempt last, reduce critical section.
Tue, Oct 20, 4:48 PM
olce closed D60863: powerpc: powerpc_ipi_handler(): Stop first, preempt last.
Tue, Oct 20, 4:47 PM
olce closed D60862: x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS.
Tue, Oct 20, 4:47 PM
olce closed D60861: x86: ipi_bitmap_handler(): Preempt last, reduce critical section.
Tue, Oct 20, 4:47 PM
olce closed D60558: Status/2026Q3/scheduler.adoc: Add report.
Tue, Oct 20, 11:51 AM