Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1235568
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Tejun Heo <tj@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCHSET percpu/for-4.4] percpu_ref: make mode switching operations synchronize themselves |
| Date | Tue, 29 Sep 2015 23:50:02 +0200 |
| Message-ID | <qeaWC-1Uq-3@gated-at.bofh.it> (permalink) |
| X-Original-To | axboe@kernel.dk, akinobu.mita@gmail.com, tom.leiming@gmail.com |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=iz3xqAWMshy6buh0GYCmZKjn2GDCOBFu9y2dKpbSMw8=; b=CCNhLkQxKpz/WrPzngUGtrFGm6MPGRrMdlhbXN0Om/MVNbri48p4q2CEacNCVSD1EO KubqvE5zO8bdJb7r8dVg7hNQxibIJd25TTL/5rGPj1W5D4kx7/joRKa0PumRKekWqdXs izvy0ML4w8Ym65wP/ws+u2ugumwhf68lm5/SykmLb/h7DRUQ0F6o6ALe8GurILaXE9up qBM45uyUnGW4hDQwZH0gW76k8d+z6/1N4UVwgMJIM8M2LIpK/dIWBmkENswZ/ifEap9U 2rxH36SEVozkrXzwGwN7zTYBpD3K/d8XH3uTDlmPqVzr64B4hsOaNh3VD4O9YvGJLJIN UHow== |
| X-Received | by 10.13.244.68 with SMTP id d65mr209485ywf.27.1443563243283; Tue, 29 Sep 2015 14:47:23 -0700 (PDT) |
| X-Mailer | git-send-email 2.4.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 46 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | kent.overstreet@gmail.com, cl@linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@fb.com |
| X-Original-Date | Tue, 29 Sep 2015 17:47:15 -0400 |
| X-Original-Message-ID | <1443563240-29306-1-git-send-email-tj@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1235568 |
Show key headers only | View raw
Hello, Mostly for historical reasons, percpu_ref atomic/percpu mode switching operations require the users to synchronize different operations although there are valid usage scenarios where different types of operations racing against each other makes sense. This unusual requirement led to a subtle race condition in blk-mq which was spotted by Akinobu Mita[1]. Akinobu proposed a blk-mq specific fix where it adds an enclosing mutex around the percpu_ref operations; however, this is a percpu_ref deficiency and fixing it at the source is the better long term approach. Unfortunately, this ended up being a somewhat invasive set of changes and the right thing to do likely is applying Akinobu's fix for 4.3 / -stable, applying this patchset for 4.4 window and reverting Akinobu's patch after the 4.4 merge window. Akinobu, can you please verify that this patchset makes the race condition go away? This patchset contains the following five patches. 0001-percpu_ref-remove-unnecessary-RCU-grace-period-for-s.patch 0002-percpu_ref-reorganize-__percpu_ref_switch_to_atomic-.patch 0003-percpu_ref-unify-staggered-atomic-switching-wait-beh.patch 0004-percpu_ref-restructure-operation-mode-switching.patch 0005-percpu_ref-allow-operation-mode-switching-operations.patch 0001-0004 are prep patches. 0001 and 0003 involve minor behavior changes which shouldn't affect users. 0005 implements interal synchronization among percpu mode switching operations. diffstat follows. Thanks. lib/percpu-refcount.c | 166 +++++++++++++++++++++++++++----------------------- 1 file changed, 92 insertions(+), 74 deletions(-) [1] http://lkml.kernel.org/g/1443287365-4244-7-git-send-email-akinobu.mita@gmail.com -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCHSET percpu/for-4.4] percpu_ref: make mode switching operations synchronize themselves Tejun Heo <tj@kernel.org> - 2015-09-29 23:50 +0200 [PATCH 5/5] percpu_ref: allow operation mode switching operations to be called concurrently Tejun Heo <tj@kernel.org> - 2015-09-29 23:50 +0200 [PATCH 3/5] percpu_ref: unify staggered atomic switching wait behavior Tejun Heo <tj@kernel.org> - 2015-09-29 23:50 +0200
csiph-web