[ovs-dev] jsonrpc and unbounded amount of cpu

Ben Pfaff blp at ovn.org
Fri Mar 13 18:03:08 UTC 2020

On Tue, Mar 10, 2020 at 03:42:30PM -0400, Michael C Cambria via dev wrote:
> The input_buffer in struct jsonrpc was recently increased to 4k [ https://github.com/openvswitch/ovs/commit/ea5c1ba0e3b899b8b6684f23a44bbfd4331815ee
> ]
> Years ago there was a change [ https://github.com/openvswitch/ovs/commit/3a4548cfb2fb7e7344618f449ab9bf651ef83e6b
> ] to limit how much cpu jsonrpc_recv() could take before yielding back to
> its caller.  Should the value of 50 be adjusted down to compensate or is
> this no longer a problem?

This is a reasonable question (although I'm curious how it came to

Commit 3a4548cfb2fb ("jsonrpc: Keep jsonrpc_recv() from taking over the
CPU.") changed jsonrpc_recv() from using a potentially infinite amount
of CPU to a finite amount.  The bound that it chose was arbitrary (25
kB).  Multiplying it by 8 (200 kB) is also arbitrary.  I don't have a
reason to believe that either figure is better than the other.

More information about the dev mailing list