Page MenuHomeFreeBSD

Cleanup pthread locks in ofed RDMA verbs
ClosedPublic

Authored by sean.lim_dell.com on Jul 20 2023, 12:24 AM.
Tags
None
Referenced Files
F102446602: D41105.diff
Tue, Nov 12, 9:46 AM
Unknown Object (File)
Wed, Nov 6, 2:58 PM
Unknown Object (File)
Wed, Nov 6, 2:58 PM
Unknown Object (File)
Wed, Nov 6, 2:58 PM
Unknown Object (File)
Wed, Nov 6, 2:58 PM
Unknown Object (File)
Tue, Nov 5, 2:38 AM
Unknown Object (File)
Mon, Oct 21, 12:59 AM
Unknown Object (File)
Mon, Oct 21, 12:59 AM

Details

Summary

On FreeBSD pthread mutex, cond, and spinlocks allocate memory. On Linux based systems, these calls do not allocate memory. So there was a safe assumption that the ofed RDMA verb calls do not need to explicitly destroy the pthread locks. This assumption is false on FreeBSD. So let us rearrange the code to cleanup the pthread locks.

Test Plan

I was able to test and exercise the ibverbs, mlx4 and mlx5 libraries by call the specific calls and then calling free, while using a memory leak detector tool.

I was able to do this for the simpler calls in those libraries. All other _ex version of calls I was unable to do. The cxgb4 ones I was not able to test.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

vangyzen added subscribers: hselasky, network.

In light of @hselasky's untimely departure, would someone on network like to review this, or suggest another reviewer?

contrib/ofed/libibverbs/cmd.c
728

This comment made sense in the OneFS tree, but not here. Nuke it.

959

This comment made sense in the OneFS tree, but not here. Nuke it.

1210

This comment made sense in the OneFS tree, but not here. Nuke it.

contrib/ofed/libibverbs/device.c
286

This comment made sense in the OneFS tree, but not here. Nuke it.

contrib/ofed/libibverbs/verbs.h
2171

This comment made sense in the OneFS tree, but not here. Nuke it.

contrib/ofed/libmlx4/mlx4.c
264

Check indentation. It should be one tab.

269

Check indentation. It should be one tab.

contrib/ofed/libmlx5/mlx5.c
962

Check indentation.

1007

Check indentation.

This revision is now accepted and ready to land.Jul 25 2023, 3:40 PM
This revision now requires review to proceed.Jul 26 2023, 10:43 PM

Ping. Any reviewers?

delphij added a subscriber: delphij.

The change LGTM. We should probably try to upstream the change...

This revision is now accepted and ready to land.Sep 11 2023, 7:01 PM

What is supposed to happen next? Do I need more reviews or does someone need to merge this code in?

This revision was automatically updated to reflect the committed changes.