linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: cl@linux-foundation.org, kmo@daterainc.com
Cc: linux-kernel@vger.kernel.org, Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH 3/3] percpu-refcount: make percpu_ref based on longs instead of ints
Date: Sat, 20 Sep 2014 01:26:53 -0400	[thread overview]
Message-ID: <20140920052653.GB7926@mtj.dyndns.org> (raw)
In-Reply-To: <1410142342-8185-4-git-send-email-tj@kernel.org>

On Mon, Sep 08, 2014 at 11:12:22AM +0900, Tejun Heo wrote:
> percpu_ref is currently based on ints and the number of refs it can
> cover is (1 << 31).  This makes it impossible to use a percpu_ref to
> count memory objects or pages on 64bit machines as it may overflow.
> This forces those users to somehow aggregate the references before
> contributing to the percpu_ref which is often cumbersome and sometimes
> challenging to get the same level of performance as using the
> percpu_ref directly.
> 
> While using ints for the percpu counters makes them pack tighter on
> 64bit machines, the possible gain from using ints instead of longs is
> extremely small compared to the overall gain from per-cpu operation.
> This patch makes percpu_ref based on longs so that it can be used to
> directly count memory objects or pages.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Kent Overstreet <kmo@daterainc.com>
> Cc: Johannes Weiner <hannes@cmpxchg.org>

Applied 1 and 3 to percpu/for-3.18.

Thanks.

-- 
tejun

  reply	other threads:[~2014-09-20  5:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08  2:12 [PATCHSET percpu/for-3.18] percpu-refcount: several improvements Tejun Heo
2014-09-08  2:12 ` [PATCH 1/3] percpu-refcount: improve WARN messages Tejun Heo
2014-09-08  2:12 ` [PATCH 2/3] percpu-refcount: implement percpu_ref_set_killed() Tejun Heo
2014-09-20  5:26   ` Tejun Heo
2014-09-08  2:12 ` [PATCH 3/3] percpu-refcount: make percpu_ref based on longs instead of ints Tejun Heo
2014-09-20  5:26   ` Tejun Heo [this message]
2014-09-20  5:31   ` [PATCH v2 " Tejun Heo

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=20140920052653.GB7926@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=cl@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kmo@daterainc.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;
as well as URLs for NNTP newsgroup(s).