Bug 210098 - Refine slightly search of highest priority thread on the queue(sleepq_signal).
Summary: Refine slightly search of highest priority thread on the queue(sleepq_signal).
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-threads mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-07 12:34 UTC by Bulat
Modified: 2017-01-15 11:57 UTC (History)
0 users

See Also:


Attachments
patch loop by eliminating otherwise redundant comparisons besttd against NULL. (716 bytes, patch)
2016-06-07 12:34 UTC, Bulat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bulat 2016-06-07 12:34:50 UTC
Created attachment 171139 [details]
patch loop by eliminating otherwise redundant comparisons besttd against NULL.

File:          kern/subr_sleepqueue.c
File revision: r300109

Slightly optimise searching of highest priority thread 
on the queue by initializing besttd to first element on the tailq 
and then iterating over sq_blocked[queue] starting from second element, thus utilizing TAILQ_FOREACH_FROM. Also catch empty queue of blocked threads by early testing besttd after first assignment.
Comment 1 Bulat 2017-01-15 11:57:23 UTC
Mark, could you please mark the bug as solved? Thanks.