diff options
| author | Sebastian Andrzej Siewior <[email protected]> | 2025-04-16 16:29:01 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2025-05-03 10:02:04 +0000 |
| commit | 3efa66ce6ee1b55ab687b316e48e1e9ddc1f780a (patch) | |
| tree | 427f2fe8041ef5427cdbf73d202f5fb8c1c1a43f /mm/vmalloc.c | |
| parent | Linux 6.15-rc4 (diff) | |
| download | kernel-3efa66ce6ee1b55ab687b316e48e1e9ddc1f780a.tar.gz kernel-3efa66ce6ee1b55ab687b316e48e1e9ddc1f780a.zip | |
rcuref: Provide rcuref_is_dead()
rcuref_read() returns the number of references that are currently held.
If 0 is returned then it is not safe to assume that the object ca be
scheduled for deconstruction because it is marked DEAD. This happens if
the return value of rcuref_put() is ignored and assumptions are made.
If 0 is returned then the counter transitioned from 0 to RCUREF_NOREF.
If rcuref_put() did not return to the caller then the counter did not
yet transition from RCUREF_NOREF to RCUREF_DEAD. This means that there
is still a chance that the counter will transition from RCUREF_NOREF to
0 meaning it is still valid and must not be deconstructed. In this brief
window rcuref_read() will return 0.
Provide rcuref_is_dead() to determine if the counter is marked as
RCUREF_DEAD.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'mm/vmalloc.c')
0 files changed, 0 insertions, 0 deletions
