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
Unknown Object (File)
Thu, May 30, 3:39 PM
Unknown Object (File)
Apr 26 2024, 1:14 AM
Unknown Object (File)
Apr 22 2024, 5:24 PM
Unknown Object (File)
Apr 21 2024, 6:54 AM
Unknown Object (File)
Jan 27 2024, 5:49 AM
Unknown Object (File)
Jan 27 2024, 5:39 AM
Unknown Object (File)
Jan 27 2024, 5:39 AM
Unknown Object (File)
Jan 27 2024, 5:39 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 Not Applicable
Unit
Tests Not Applicable

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
727–728

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

957–958

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

1207–1208

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

contrib/ofed/libibverbs/device.c
285–286

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

contrib/ofed/libibverbs/verbs.h
2170–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.