From: Tejun Heo <tj@kernel.org>
To: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Anatol Pomozov <anatol.pomozov@gmail.com>,
Benjamin LaHaise <bcrl@kvack.org>,
linux-aio@kvack.org, Kent Overstreet <kmo@daterainc.com>,
Gu Zheng <guz.fnst@cn.fujitsu.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] percpu-refcount: fix usage of this_cpu_ops (was Re: hanging aio process)
Date: Wed, 4 Jun 2014 12:11:23 -0400 [thread overview]
Message-ID: <20140604161123.GG5004@htj.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.2.11.1406041540520.21183@denkbrett>
On Wed, Jun 04, 2014 at 03:58:24PM +0200, Sebastian Ott wrote:
> From 82295633cad58c7d6b9af4e470e3168ed43a6779 Mon Sep 17 00:00:00 2001
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> Date: Wed, 4 Jun 2014 12:53:19 +0200
> Subject: [PATCH] percpu-refcount: fix usage of this_cpu_ops
>
> The percpu-refcount infrastructure uses the underscore variants of
> this_cpu_ops in order to modify percpu reference counters.
> (e.g. __this_cpu_inc()).
>
> However the underscore variants do not atomically update the percpu
> variable, instead they may be implemented using read-modify-write
> semantics (more than one instruction). Therefore it is only safe to
> use the underscore variant if the context is always the same (process,
> softirq, or hardirq). Otherwise it is possible to lose updates.
>
> This problem is something that Sebastian has seen within the aio
> subsystem which uses percpu refcounters both in process and softirq
> context leading to reference counts that never dropped to zeroes; even
> though the number of "get" and "put" calls matched.
>
> Fix this by using the non-underscore this_cpu_ops variant which
> provides correct per cpu atomic semantics and fixes the corrupted
> reference counts.
>
> Cc: Kent Overstreet <kmo@daterainc.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: <stable@vger.kernel.org> # v3.11+
> Reported-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Bah... should have caught it way back. Sorry about that. Appying to
percpu/for-3.15-fixes with stable cc'd.
Thanks.
--
tejun
next prev parent reply other threads:[~2014-06-04 16:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 17:38 hanging aio process Sebastian Ott
2014-05-19 18:08 ` Benjamin LaHaise
2014-05-20 8:08 ` Sebastian Ott
2014-05-20 13:16 ` Sebastian Ott
2014-05-20 14:26 ` Benjamin LaHaise
2014-05-20 16:12 ` Anatol Pomozov
2014-05-20 18:09 ` Sebastian Ott
2014-05-20 18:39 ` Anatol Pomozov
2014-05-21 8:07 ` Sebastian Ott
2014-05-21 8:48 ` Sebastian Ott
2014-05-21 13:20 ` Benjamin LaHaise
2014-05-21 14:12 ` Sebastian Ott
2014-05-21 14:18 ` Anatol Pomozov
2014-05-21 14:57 ` Sebastian Ott
2014-06-04 5:24 ` Gu Zheng
2014-06-11 8:47 ` Ming Lei
2014-06-04 13:58 ` [PATCH] percpu-refcount: fix usage of this_cpu_ops (was Re: hanging aio process) Sebastian Ott
2014-06-04 16:11 ` Tejun Heo [this message]
2014-06-04 16:56 ` Sebastian Ott
2014-06-04 17:02 ` Tejun Heo
2014-06-04 16:41 ` Tejun Heo
2014-06-04 17:17 ` Christoph Lameter
2014-05-19 18:31 ` hanging aio process Anatol Pomozov
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=20140604161123.GG5004@htj.dyndns.org \
--to=tj@kernel.org \
--cc=anatol.pomozov@gmail.com \
--cc=bcrl@kvack.org \
--cc=guz.fnst@cn.fujitsu.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kmo@daterainc.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebott@linux.vnet.ibm.com \
/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
all inboxes | Powered by JetHome®