Page MenuHomeFreeBSD

w: remove proc_compare()
AcceptedPublic

Authored by yuripv on Jun 22 2020, 7:15 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
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