lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] generic dynamic per cpu refcounting
Hey, Kent.

On Mon, Jan 28, 2013 at 10:49:33AM -0800, Kent Overstreet wrote:
> Yeah. It'd be really nice if it was doable without synchronize_rcu(),
> but it'd definitely make get/put heavier.
>
> Though, re. close() - considering we only need a synchronize_rcu() if
> the ref was in percpu mode, I wonder if that would be a dealbreaker. I
> have no clue myself.

The problem is that the performance drop (or latency increase) in
patheological cases would be catastrophic. We're talking about
possibly quite a few millisecs of delay between each close(). When
done sequentially for large number of files, it gets ugly. It becomes
a dangerous optimization to make.

> Getting rid of synchronize_rcu would basically require turning get and
> put into cmpxchg() loops - even in the percpu fastpath. However, percpu
> mode would still be getting rid of the shared cacheline contention, we'd
> just be adding another branch that can be safely marked unlikely() - and
> my current version has one of those already, so two branches instead of
> one in the fast path.

Or offer an asynchrnous interface so that high-frequency users don't
end up inserting synchronize_sched() between each call. It makes the
interface more complex and further away from simple atomic_t
replacement tho.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-01-28 20:41    [W:0.068 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site