danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Implement io_uring TASKRUN COOP and SINGLE ISSUER support #303

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

This PR introduces some changes on how the io_uring queue is initialized enabling TASKRUN COOP and SINGLE ISSUER on the supported kernels, for instance the former requires kernel 5.19 meanwhile the latter requires kernel 6.0.

With the TASKRUN COOP there isn't a direct performance benefit, infact cachegrand in normal cases will not be running when there are no CQEs to process so io_uring will not interrupt cachegrand to generate CQEs (although, for clarity, under heavy load the io_uring might return fewer CQEs and try to process more later therefore TASKRUN COOP would improve the performances).

It's a very different story with the SINGLE ISSUER flag as cachegrand never shares the queues between different threads so there is no risk of race conditions.