Page MenuHomeFreeBSD

w: remove proc_compare()
AbandonedPublic

Authored by yuripv on Jun 22 2020, 7:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 5:20 AM
Unknown Object (File)
Dec 8 2023, 2:39 AM
Unknown Object (File)
Dec 5 2023, 12:35 PM
Unknown Object (File)
Nov 23 2023, 4:16 PM
Unknown Object (File)
Nov 22 2023, 9:23 AM
Unknown Object (File)
Nov 20 2023, 5:14 AM
Unknown Object (File)
Nov 11 2023, 10:12 PM
Unknown Object (File)
Nov 11 2023, 10:44 AM

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