[Asterisk-code-review] pjsip: modify taskprocessor scheduling algorithm from round-... (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Mon Nov 5 15:01:01 CST 2018


Alexei Gradinari has posted comments on this change. ( https://gerrit.asterisk.org/10587 )

Change subject: pjsip: modify taskprocessor scheduling algorithm from round-robin to least-size
......................................................................


Patch Set 2:

> > > (1 comment)
 > > >
 > > > WHY???
 > > >
 > > > Why take something that works and submit a patch that breaks
 > > stuff?
 > >
 > > The current round-robin method does not take the current
 > > taskprocessor load into consideration when distributing requests.
 > > Using the least-size method the request goes to the taskprocessor
 > > that is servicing the least number of active tasks at the current
 > > time.
 > >
 > > The long running task on round-robin method can slowdown a fast
 > > running tasks.
 > 
 > You are trying to optimize something that isn't used very much so
 > you get very little benefit with the change.  This is only going to
 > affect something that doesn't care which task processor something
 > gets queued onto.
 > 
 > i.e., Only things which go on the pjsip/default-xxxxxxx
 > serializers.
 > 

I found 24 usage of ast_sip_push_task*(NULL
For example one of them send_initial_notify_all
which fires initial unsolicited MWI NOTIFY messages when we're fully booted.
This one is very long run task.

I made a patch which added a new dial-plan function PJSIP_PARSE_URI which must run on one of the PJSIP threads. The simple way is to run on default PJSIP serializers.

The dial-plan functions should complete asap.

So this patch tries to minimize an affect between tasks on default serializers.

 > >
 > > What does this patch break?
 > 
 > * A simple selection routine is now more complicated for little
 > benefit.
 > * The new selection routine calls the get count function more than
 > once per serializer.  Since Asterisk is multi-threaded you can get
 > different values each time it is called.
 > * Coding guidelines


Fixed * Coding guidelines


-- 
To view, visit https://gerrit.asterisk.org/10587
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I7b8d8cc2c2490494f579374b6af0a4868e3a37cd
Gerrit-Change-Number: 10587
Gerrit-PatchSet: 2
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Mon, 05 Nov 2018 21:01:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181105/3550ec86/attachment.html>


More information about the asterisk-code-review mailing list