lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] kref: Remove the memory barriers
From
On Mon, Dec 12, 2011 at 4:56 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, 2011-12-12 at 11:48 +0800, Ming Lei wrote:
>> >  LOCK
>> >  obj = lookup(); /* lets assume obj != NULL */
>> >  kref_get(&obj->ref);
>> >  UNLOCK
>> >
>> >  value = obj->member;
>> >
>> >  kref_put(&obj->ref);
>> >
>> > Now, under our memory model, the read from obj->member can both happen,
>> > or be observed to happen before the increment from kref_get() is
>> > processed.
>>
>> It should be the problem if another CPU observed that write/read obj
>> is done before kref_get.
>
> WHY?!?!?!

I did't say the reason because it is same with the example I explained in
the same reply. So if you can make me enlightened on this example,
all will be OK, :-)

thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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