login
Header Space

 
 

Re: [RFC][PATCH] make module refcounts use percpu_counters

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Dave Hansen <haveblue@...>
Cc: <linux-kernel@...>
Date: Tuesday, October 2, 2007 - 12:20 am

On Mon, 2007-10-01 at 10:03 -0700, Dave Hansen wrote:

No, it handles hotplug because it does every possible CPU, not every
online CPU.  percpu_counters empties cpu's counter presumably to avoid
systematic error.

Renaming percpu_counters to approximate_counters here would be nice.


You missed removing struct module_ref, too.  That's a little more code.


Well, there is already a branch in the fast path.  BTW, comparing before
and after applying your patch for a try_module_get/module_put pair, I
get 5.9 ns vs 20.6 ns.  We perhaps win something back on NUMA-like
machines, but it's not clear.

My initial implementation of such a counter used atomic ops via a
pointer.  The pointer was aimed at a shared counter for slow-mode.  The
problem is that you need to disable preemption around the counter update
(so you can use rcu to ensure everyone has seen the changeover).


Indeed, that's why I called it "stop_machine".  The real-time coders
hate it too.

Cheers,
Rusty.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH] make module refcounts use percpu_counters, Dave Hansen, (Fri Sep 28, 7:00 pm)
Re: [RFC][PATCH] make module refcounts use percpu_counters, Rusty Russell, (Tue Oct 2, 12:20 am)
speck-geostationary