search for: kref_sub_return

Displaying 13 results from an estimated 13 matches for "kref_sub_return".

2014 Feb 12
0
[PATCH net 1/3] kref: add kref_sub_return
...kref from remaining in + * function returns 0, you still can not count on the kref remaining in * memory. Only use the return value if you want to see if the kref is now * gone, not present. */ @@ -78,6 +78,38 @@ static inline int kref_sub(struct kref *kref, unsigned int count, } /** + * kref_sub_return - subtract a number of refcounts for object. + * @kref: object. + * @count: Number of recounts to subtract. + * @release: pointer to the function that will clean up the object when the + * last reference to the object is released. + * This pointer is required, and it is not acceptable to...
2014 Feb 12
0
[PATCH net 1/3] kref: add kref_sub_return
...ur own reference in the device. If it goes up again this means we didn't have to do cleanup, but an alternative is doing it all the time and that is slow. Yes I can rework vhost to open-code this kref use, it's no big deal. Alternatively since most of the use does match kref model, maybe __kref_sub_return with disclaimers that you must know what you are doing? Please let me know. Thanks! -- MST
2014 Feb 13
0
[PATCH net 1/3] kref: add kref_sub_return
From: Greg Kroah-Hartman <gregkh at linuxfoundation.org> Date: Wed, 12 Feb 2014 08:56:30 -0800 > On Wed, Feb 12, 2014 at 06:38:21PM +0200, Michael S. Tsirkin wrote: >> It is sometimes useful to get the value of the reference count after >> decrement. >> For example, vhost wants to execute some periodic cleanup operations >> once number of references drops below a
2014 Feb 13
0
[PATCH net 1/3] kref: add kref_sub_return
From: Greg KH <gregkh at linuxfoundation.org> Date: Wed, 12 Feb 2014 17:39:02 -0800 > Yes, that's horrible as well, but as was already pointed out in this > thread, you can't rely on that value to really be "1" after reading it > due to the way krefs work, what happened if someone else just grabbed > it? > > If all they want is a "count" for
2014 Feb 14
0
[PATCH net 1/3] kref: add kref_sub_return
On Wed, Feb 12, 2014 at 11:09:53PM -0500, David Miller wrote: > From: David Miller <davem at davemloft.net> > Date: Wed, 12 Feb 2014 23:05:06 -0500 (EST) > > > From: Greg KH <gregkh at linuxfoundation.org> > > Date: Wed, 12 Feb 2014 17:39:02 -0800 > > > >> Yes, that's horrible as well, but as was already pointed out in this > >>
2014 Feb 13
2
[PATCH net 1/3] kref: add kref_sub_return
On Wed, Feb 12, 2014 at 07:06:37PM -0500, David Miller wrote: > From: Greg Kroah-Hartman <gregkh at linuxfoundation.org> > Date: Wed, 12 Feb 2014 08:56:30 -0800 > > > On Wed, Feb 12, 2014 at 06:38:21PM +0200, Michael S. Tsirkin wrote: > >> It is sometimes useful to get the value of the reference count after > >> decrement. > >> For example, vhost
2014 Feb 13
2
[PATCH net 1/3] kref: add kref_sub_return
On Wed, Feb 12, 2014 at 07:06:37PM -0500, David Miller wrote: > From: Greg Kroah-Hartman <gregkh at linuxfoundation.org> > Date: Wed, 12 Feb 2014 08:56:30 -0800 > > > On Wed, Feb 12, 2014 at 06:38:21PM +0200, Michael S. Tsirkin wrote: > >> It is sometimes useful to get the value of the reference count after > >> decrement. > >> For example, vhost
2014 Feb 13
2
[PATCH net 1/3] kref: add kref_sub_return
From: David Miller <davem at davemloft.net> Date: Wed, 12 Feb 2014 23:05:06 -0500 (EST) > From: Greg KH <gregkh at linuxfoundation.org> > Date: Wed, 12 Feb 2014 17:39:02 -0800 > >> Yes, that's horrible as well, but as was already pointed out in this >> thread, you can't rely on that value to really be "1" after reading it >> due to the way
2014 Feb 13
2
[PATCH net 1/3] kref: add kref_sub_return
From: David Miller <davem at davemloft.net> Date: Wed, 12 Feb 2014 23:05:06 -0500 (EST) > From: Greg KH <gregkh at linuxfoundation.org> > Date: Wed, 12 Feb 2014 17:39:02 -0800 > >> Yes, that's horrible as well, but as was already pointed out in this >> thread, you can't rely on that value to really be "1" after reading it >> due to the way
2014 Feb 12
4
[PATCH net 0/3] vhost fixes for 3.14, -stable
This fixes a deadlock with vhost reported in the field, as well as a theoretical race issue found by code review. Patches 1+2 are needed for stable. Thanks to Qin Chuanyu for reporting the issue! Michael S. Tsirkin (3): kref: add kref_sub_return vhost: fix ref cnt checking deadlock vhost: fix a theoretical race in device cleanup include/linux/kref.h | 33 ++++++++++++++++++++++++++++++++- drivers/vhost/net.c | 15 ++++++++++----- 2 files changed, 42 insertions(+), 6 deletions(-) -- MST
2014 Feb 12
4
[PATCH net 0/3] vhost fixes for 3.14, -stable
This fixes a deadlock with vhost reported in the field, as well as a theoretical race issue found by code review. Patches 1+2 are needed for stable. Thanks to Qin Chuanyu for reporting the issue! Michael S. Tsirkin (3): kref: add kref_sub_return vhost: fix ref cnt checking deadlock vhost: fix a theoretical race in device cleanup include/linux/kref.h | 33 ++++++++++++++++++++++++++++++++- drivers/vhost/net.c | 15 ++++++++++----- 2 files changed, 42 insertions(+), 6 deletions(-) -- MST
2014 Feb 12
6
[PATCH net 1/3] kref: add kref_sub_return
On Wed, Feb 12, 2014 at 06:38:21PM +0200, Michael S. Tsirkin wrote: > It is sometimes useful to get the value of the reference count after > decrement. > For example, vhost wants to execute some periodic cleanup operations > once number of references drops below a specific value, before it > reaches zero (for efficiency). You should never care about what the value of the kref is,
2014 Feb 12
6
[PATCH net 1/3] kref: add kref_sub_return
On Wed, Feb 12, 2014 at 06:38:21PM +0200, Michael S. Tsirkin wrote: > It is sometimes useful to get the value of the reference count after > decrement. > For example, vhost wants to execute some periodic cleanup operations > once number of references drops below a specific value, before it > reaches zero (for efficiency). You should never care about what the value of the kref is,