Page MenuHomeFreeBSD

LinuxKPI: Add compiler barriers to list_for_each_entry_lockless macro
ClosedPublic

Authored by wulf on Jun 16 2021, 11:55 PM.

Details

Summary

so this list-traversal primitive may safely run concurrently with
the _rcu list-mutation primitives such as list_add_rcu()
as long as the traversal is guarded by rcu_read_lock().

Do it with reusing of list_for_each_entry_rcu macro which
does the same. On Linux it implements some additional
lockdep stuff which we skip.

Also move the macro to linux/rculist.h where it resides on Linux.

Diff Detail

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

Event Timeline

wulf requested review of this revision.Jun 16 2021, 11:55 PM

The commit message has some spelling errors - can you fix?

wulf retitled this revision from LinuxKPI: Use list_for_each_entry_rcu macro as a base to to LinuxKPI: Add compiler barriers to list_for_each_entry_lockless macro.Jun 17 2021, 11:41 AM
wulf edited the summary of this revision. (Show Details)

The commit message has some spelling errors - can you fix?

Did it with copy-paste from Linux header

Spelling:

Do it with reusing of list_for_each_entry_rcu macro which
does the same. On Linux it implements some additional
lockdep stuff which we skip.

Corrected:

Do it by reusing the "list_for_each_entry_rcu" macro which
does the same. On Linux it implements some additional
lockdep stuff which we skip.

This revision is now accepted and ready to land.Jun 17 2021, 1:14 PM

Thank you! I replaced my spelling with yours in my local git repo.