Page MenuHomeFreeBSD

lio_listio(2): send signal even if number of jobs is zero
ClosedPublic

Authored by kib on Nov 30 2020, 1:30 PM.

Details

Summary

Right now, if lio registered zero jobs, syscall frees lio job structure, cleaning up queued ksi. As result, the realtime signal is dequeued and never delivered.

Fix it by allowing sendsig() to copy ksi when job count is zero.

Note that the same problem exists with the registered knote that is deleted from all kqueues on synchronous cleanup, but this one is harder to fix.

PR: 220398

NB. There are some style and comment fixes, I will commit this separately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Nov 30 2020, 1:30 PM
kib retitled this revision from lio: send signal even if number of jobs is zero to lio_listio(2): send signal even if number of jobs is zero.Nov 30 2020, 1:31 PM
kib edited the summary of this revision. (Show Details)

Thanks! BTW, you should also remove the atf_tc_expect_timeout lines from the lio_listio_empty_nowait_signal and lio_listio_empty_nowait_thread in tests/sys/aio/lio_test.c. Optimistically, you should also remove the atf_tc_skip from lio_listio_empty_nowait_thread.

This revision is now accepted and ready to land.Dec 1 2020, 2:46 AM

I would prefer that you handle tests.

In D27421#612963, @kib wrote:

I would prefer that you handle tests.

Sure. I can fix them after you commit.

This revision was automatically updated to reflect the committed changes.