Received: by 10.223.164.202 with SMTP id h10csp3963941wrb; Mon, 20 Nov 2017 07:48:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMZfkFkv0KanhM4puZuiSAH7YbmK+BT18nVFuYmI4IzxWQAHGBkVSo8yu/h+iz1x1I9GXX1u X-Received: by 10.98.223.217 with SMTP id d86mr11917034pfl.190.1511192890630; Mon, 20 Nov 2017 07:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511192890; cv=none; d=google.com; s=arc-20160816; b=q0hftkO1DsPqNN1oDLuGkI4i34jspGg/82ARGupqx9KZh0TGs/sxn9Ar+dOvM1qj+6 tXPbw8139p5FzPYvvmxK09wlhR+p8pVVHbyqhSN2QOP9g7557qrgTf3T16hBdF5yMjni uQetjrS2x/RcoaZ9vjNytt926gx951K9PK9T9oYGvgax886LSAOdOFe/uJ3hKLWmjnGM I5GGyg6aT2WQbM8/oI25lqP6unWB3LATV9VH0IIVwk7im0k08VcD2ZKZP3U0sJgM2ZQe SbatIR2UAaXYR7U2wgXfXX8nPsFpf/uaxPsQn+U9mMNRYRviD/GqzhSbxJlumFqLPQ7q 8Spg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=ubJbrjv3FzjgeLHMhKY0nSvEld6Dd9Yj3VZhVv/GHFU=; b=hHYkw08kvSmSDr/wwz3bf2HDxt4095HqEm2xXT34jo49lV+LoOrDK99qpG871lLOev FpuFnmRr1VocvNd3yS+BdLcNPPted4LoiqexeugozD+RRd4wTaZHv3Gqkm/D7THYX/8o x6FzWWfF5U3z6RCBAr4RDzzQrV+SYMrEl6PZRBxCUtpRTQEiGVFaLDHZMkSLSFnUC/g6 dQkOf0veZFsiqH/sbC5B2Pr2W07seBKAvyzOapS4p2fPJ+gDX0rAd+byjciQs+DZ9NRo i7eVkosTGGgyhRBUOJk2EaEcwhZt1fpF75VaypGbWVVkOq6xaoaF3SoxsWoBda32EuKJ f2Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@meituan.com header.s=20130113 header.b=uIlUhZwz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=meituan.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si8735207plr.60.2017.11.20.07.48.00; Mon, 20 Nov 2017 07:48:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@meituan.com header.s=20130113 header.b=uIlUhZwz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=meituan.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbdKTPrO (ORCPT + 66 others); Mon, 20 Nov 2017 10:47:14 -0500 Received: from mx-fe5-210.meituan.com ([103.37.138.210]:51111 "EHLO mx02.meituan.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbdKTPrI (ORCPT ); Mon, 20 Nov 2017 10:47:08 -0500 Received: from dx-it-mx02.dx.sankuai.com (localhost [127.0.0.1]) by dx-it-mx02.dx.sankuai.com (Postfix) with ESMTP id A774D297F320; Mon, 20 Nov 2017 23:46:51 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by dx-it-mx02.dx.sankuai.com (Postfix) with ESMTP id 25564297F31E; Mon, 20 Nov 2017 23:46:50 +0800 (CST) Received: from mx02.meituan.com ([127.0.0.1]) by localhost (dx-it-mx02.dx.sankuai.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id MLLpzbUWSIGB; Mon, 20 Nov 2017 23:46:49 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by dx-it-mx02.dx.sankuai.com (Postfix) with ESMTP id 16873297F31D; Mon, 20 Nov 2017 23:46:49 +0800 (CST) DKIM-Filter: OpenDKIM Filter v2.9.2 dx-it-mx02.dx.sankuai.com 16873297F31D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meituan.com; s=20130113; t=1511192809; bh=ubJbrjv3FzjgeLHMhKY0nSvEld6Dd9Yj3VZhVv/GHFU=; h=From:To:Subject:Date:Message-Id; b=uIlUhZwzt/Ci/Em/9Jrnu7X2zpOXGFifa14aI0OSqdGJNrKW0iXlh2ebTrAnECAc3 NJ/M5rmCtel9O59bOt32a0m63degUG+whLKv5rxAzNJImmVEt/7ICrSmLAso7lNgbD KtV9eD3KNfzAFzzmijjCv5V7D3G8GCuDKCnwud0g= X-Virus-Scanned: amavisd-new at dx-it-mx02.dx.sankuai.com Received: from mx02.meituan.com ([127.0.0.1]) by localhost (dx-it-mx02.dx.sankuai.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C-xOvg5j7HCE; Mon, 20 Nov 2017 23:46:49 +0800 (CST) Received: from localhost.lan (unknown [111.193.209.60]) by dx-it-mx02.dx.sankuai.com (Postfix) with ESMTPA id EC61A297F316; Mon, 20 Nov 2017 23:46:41 +0800 (CST) From: Wang Long To: tj@kernel.org Cc: longman@redhat.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] debug cgroup: use task_css_set instead of rcu_dereference Date: Sun, 19 Nov 2017 16:08:37 -0500 Message-Id: <1511125717-12126-1-git-send-email-wanglong19@meituan.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This macro `task_css_set` verifies that the caller is inside proper critical section if the kernel set CONFIG_PROVE_RCU=y. Signed-off-by: Wang Long --- kernel/cgroup/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c index 5f780d8..9caeda6 100644 --- a/kernel/cgroup/debug.c +++ b/kernel/cgroup/debug.c @@ -50,7 +50,7 @@ static int current_css_set_read(struct seq_file *seq, void *v) spin_lock_irq(&css_set_lock); rcu_read_lock(); - cset = rcu_dereference(current->cgroups); + cset = task_css_set(current); refcnt = refcount_read(&cset->refcount); seq_printf(seq, "css_set %pK %d", cset, refcnt); if (refcnt > cset->nr_tasks) @@ -96,7 +96,7 @@ static int current_css_set_cg_links_read(struct seq_file *seq, void *v) spin_lock_irq(&css_set_lock); rcu_read_lock(); - cset = rcu_dereference(current->cgroups); + cset = task_css_set(current); list_for_each_entry(link, &cset->cgrp_links, cgrp_link) { struct cgroup *c = link->cgrp; -- 1.8.3.1 From 1585347469353815760@xxx Tue Nov 28 21:39:24 +0000 2017 X-GM-THRID: 1585347469353815760 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread