lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] kref: Remove the memory barriers
Date
Am Montag, 12. Dezember 2011, 10:57:31 schrieb Ming Lei:
> On Mon, Dec 12, 2011 at 4:54 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, 2011-12-12 at 11:48 +0800, Ming Lei wrote:
> >> For kref, maybe it is still multiple operations done on one cpu vs them
> >> being visible on another, but seems a bit implicit, see the common kref
> >> usage below:
> >>
> >> CPU0 CPU1
> >> A:kref_init(&obj->ref)
> >
> > how does CPU0 get a ref to obj?
>
> Suppose open/close/read/.. context is run on CPU0, and driver .probe/.release
> context(hotplug context) is run on CPU1. There are a few examples on
> usb driver(eg. usb-skeleton.c, ...)

USB generally relies on an implied barrier just as:

/* we can register the device now, as it is ready */
retval = usb_register_dev(interface, &skel_class);

Generally reference counting cannot help you if kfree() is involved

Regards
Oliver


\
 
 \ /
  Last update: 2011-12-12 11:21    [W:0.082 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site