Thread (65 messages) 65 messages, 9 authors, 2019-06-17

Re: [PATCH 1/7] General notification queue with user mmap()'able ring buffer

From: David Howells <dhowells@redhat.com>
Date: 2019-05-31 17:12:56
Also in: keyrings, linux-api, linux-block, linux-fsdevel, lkml

Peter Zijlstra [off-list ref] wrote:
quoted
quoted
(and it has already been established that refcount_t doesn't work for
usage count scenarios)
?

Does that mean struct kref doesn't either?
Indeed, since kref is just a pointless wrapper around refcount_t it does
not either.

The main distinction between a reference count and a usage count is that
0 means different things. For a refcount 0 means dead. For a usage count
0 is merely unused but valid.
Ah - I consider the terms interchangeable.

Take Documentation/filesystems/vfs.txt for instance:

  dget: open a new handle for an existing dentry (this just increments
	the usage count)

  dput: close a handle for a dentry (decrements the usage count). ...

  ...

  d_lookup: look up a dentry given its parent and path name component
	It looks up the child of that given name from the dcache
	hash table. If it is found, the reference count is incremented
	and the dentry is returned. The caller must use dput()
	to free the dentry when it finishes using it.

Here we interchange the terms.

Or https://www.kernel.org/doc/gorman/html/understand/understand013.html
which seems to interchange the terms in reference to struct page.

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help