[ 
https://issues.apache.org/jira/browse/YUNIKORN-3351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dale Richardson updated YUNIKORN-3351:
--------------------------------------
    Description: 
{{Application.tryAllocate}} calls {{sa.queue.GetMaxAppUnschedAskBackoff()}} 
inside the loop that walks the application's asks, so a value that is constant 
for the whole scheduling cycle is re-fetched — under the queue lock — once per 
ask walked.

Hoist it above the loop. The entry guard changes from {{sa.sortedRequests == 
nil}} to {{len(sa.sortedRequests) == 0}} so the hoisted call still only happens 
when there is at least one ask to walk, preserving the existing "not called 
when there is no work" property.

  was:
{{Application.tryAllocate}} calls {{sa.queue.GetMaxAppUnschedAskBackoff()}} 
inside the loop that walks the application's asks, so a value that is constant 
for the whole scheduling cycle is re-fetched — under the queue lock — once per 
ask walked.

Hoist it above the loop. The entry guard changes from {{sa.sortedRequests == 
nil}} to
 {{len(sa.sortedRequests) == 0}} so the hoisted call still only happens when 
there is at least one ask to walk, preserving the existing "not called when 
there is no work" property.


> Hoist the per-ask backoff getter out of tryAllocate
> ---------------------------------------------------
>
>                 Key: YUNIKORN-3351
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3351
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: core - scheduler
>            Reporter: Dale Richardson
>            Assignee: Dale Richardson
>            Priority: Major
>
> {{Application.tryAllocate}} calls {{sa.queue.GetMaxAppUnschedAskBackoff()}} 
> inside the loop that walks the application's asks, so a value that is 
> constant for the whole scheduling cycle is re-fetched — under the queue lock 
> — once per ask walked.
> Hoist it above the loop. The entry guard changes from {{sa.sortedRequests == 
> nil}} to {{len(sa.sortedRequests) == 0}} so the hoisted call still only 
> happens when there is at least one ask to walk, preserving the existing "not 
> called when there is no work" property.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to