On 1/12/24 01:27, Ilya Maximets wrote:
> On 1/10/24 20:29, Frode Nordahl wrote:
>> During testing of the implementation of cooperative multitasking
>> in the ovsdb-server we noticed that the very first yield being
>> called in the jsonrpc-server always fired.
>>
>> This indicates that the operations being after/before storage run
>> is taking too long as it currently is.
>>
>> Moving the storage run section to the top of the main loop lead
>> to successful results using less yield calls as documented in the
>> commit message of the next commit in this series.
>
> I don't really understand what exactly is taking so much time and
> why moving this part of the code helps. Could you elaborate?
I think, I got it. In the current version of a patch set we have:
main():
0. open_db()
raft_alloc() <-- register callback
read_db() <-- takes a lot of time
main_loop()
1. run jsonrpc <-- yields and warns because read_db
already took a lot of time.
yield()
raft_run() <-- updates the callback
2. storage_run()
raft_run() <-- updates the callback
The solution proposed in this patch is to swap 1 and 2,
so we call raft_run() directly before we yield for the
first time.
I suppose, my seggestion to not have _register() function would
solve that problem, because the callback will not be registered
until the first call to raft_run().
Is that correct?
>
> Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev