Page MenuHomeFreeBSD

w: remove proc_compare()
AbandonedPublic

Authored by yuripv on Jun 22 2020, 7:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 27, 4:39 PM
Unknown Object (File)
Tue, Jun 24, 11:08 PM
Unknown Object (File)
Mon, Jun 23, 3:09 AM
Unknown Object (File)
Fri, Jun 20, 2:59 AM
Unknown Object (File)
Apr 24 2025, 7:37 PM
Unknown Object (File)
Apr 16 2025, 4:05 PM
Unknown Object (File)
Mar 5 2025, 1:37 AM
Unknown Object (File)
Mar 4 2025, 3:53 PM

Details

Reviewers
pstef
Summary

proc_compare() is no-op since rS29310 (almost 23 years ago!), and as everyone seems to be happy with what processes w currently reports, just remove it entirely.

Test Plan

Check w output with/without this change.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

It's not immediately obvious to me why rS29310 would render this a no-op, but I know that the use of ki_estcpu instead of ki_pctcpu is bogus for anything but the 4BSD scheduler.

It's not immediately obvious to me why rS29310 would render this a no-op, but I know that the use of ki_estcpu instead of ki_pctcpu is bogus for anything but the 4BSD scheduler.

That revision added a ep->kp == NULL check, which effectively means that first process that we got from proc_compare() is going to stay there. Also, when proc_compare() is called with one argument being NULL (and that is the only case we call it for last 23 years given the check I mentioned previously), you can guess what it would return :-)

I would also remove the "most interesting" comment.

This revision is now accepted and ready to land.Jul 27 2020, 5:46 AM

looking at this again, i'm not sure if the logic should be simply removed and not fixed instead -- i'll file a bug in case someone else would like to fix this properly