public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] make module refcounts use percpu_counters
Date: Mon, 01 Oct 2007 19:43:53 +1000	[thread overview]
Message-ID: <1191231833.26950.66.camel@localhost.localdomain> (raw)
In-Reply-To: <20070928230057.2712A579@kernel>

On Fri, 2007-09-28 at 16:00 -0700, Dave Hansen wrote:
> Module refcounts currently use a percpu counter stored
> in the 'struct module'.  However, we also have a more
> generic implementation that does stuff like handle
> hotplug cpus.
> 
> I'm not actually all that convinced that this refcount
> actually does a lot of good, with cpus racing bumping
> the counters at the same time that they're being
> summed up.  But, it certainly isn't any worse than
> what was there before.

That's why we look at the counters inside stop_machine_run().

Note that (1) the module implementation handles hotplug CPUs, and (2)
percpu_counter_sum() doesn't have to either (that's just for
percpu_counter_read()).

But it might be a useful cleanup (although a slight de-optimization).
If you want I'll queue for 2.6.24 (there are several other module
patches pending too).

In an ideal world, (1) we would have percpu pointers using the same
percpu mechanism as percpu variables, (2) we would have a modal variant
of percpu counters which would collapse to a single counter when we
cared about the precise value (probably using stop_machine for the
transition).  This would be useful for many other cases.

Cheers,
Rusty.


  reply	other threads:[~2007-10-01  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 23:00 [RFC][PATCH] make module refcounts use percpu_counters Dave Hansen
2007-10-01  9:43 ` Rusty Russell [this message]
2007-10-01 17:03   ` Dave Hansen
2007-10-02  4:20     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191231833.26950.66.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox