diff options
| author | Jason Gunthorpe <[email protected]> | 2018-07-10 20:55:16 -0600 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2018-07-25 14:21:22 -0600 |
| commit | 5671f79b42da197466bf0908bce6f7ab4e35488f (patch) | |
| tree | d72f406aa9c4d25cd0bb3312c272d4b160d37962 /tools/perf/scripts/python/call-graph-from-sql.py | |
| parent | c561c288463102b12c9089a42c6c2a9f55c4fb53 (diff) | |
IB/uverbs: Revise the placement of get/puts on uobject
This wasn't wrong, but the placement of two krefs didn't make any
sense. Follow some simple rules.
- A kref is held inside uobjects_list
- A kref is held inside the IDR
- A kref is held inside file->private
- A stack based kref is passed bettwen alloc_begin and
alloc_abort/alloc_commit
Any place we destroy one of the above pointers, we stick a put,
or 'move' the kref into another pointer.
The key functions have sensible semantics:
- alloc_uobj fully initializes the common members in uobj, including
the list
- Get rid of the uverbs_idr_remove_uobj helper since IDR remove
does require put, but it depends on the situation. Later
patches will re-consolidate this differently.
- alloc_abort always consumes the passed kref, done in the type
- alloc_commit always consumes the passed kref, done in the type
- rdma_remove_commit_uobject always pairs with a lookup_get
After it is all done the only control flow change is to:
- move a get from alloc_commit_fd_uobject to rdma_alloc_commit_uobject
- add a put to remove_commit_idr_uobject
- Consistenly use rdma_lookup_put in rdma_remove_commit_uobject at
the right place
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-sql.py')
0 files changed, 0 insertions, 0 deletions