Message ID | 1542653726-5655-13-git-send-email-longman@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF30A5A4 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 19 Nov 2018 18:57:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E19E92A2F2 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 19 Nov 2018 18:57:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBB272A470; Mon, 19 Nov 2018 18:57:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AA352A442 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 19 Nov 2018 18:57:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 922906B1BF2; Mon, 19 Nov 2018 13:57:42 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8D5CE6B1BF3; Mon, 19 Nov 2018 13:57:42 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7994A6B1BF4; Mon, 19 Nov 2018 13:57:42 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id 55B656B1BF2 for <linux-mm@kvack.org>; Mon, 19 Nov 2018 13:57:42 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id z68so46724780qkb.14 for <linux-mm@kvack.org>; Mon, 19 Nov 2018 10:57:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=E+Ucu4Ad9hHS3vGoIXwWZmms3i3F/iQLn9fd6FpayKc=; b=nkhCp3anifYnR8X5a8K2zrOVyqpD7llQdcxqmkrio3aI+88pnaRSIrGLw8UlhZCOoE XFgV9vt7KZCbAncCYNVOAq7dLCHPjzBau0PV/c/Yw98yOqPbmfnJaTP55l5553OmucaC poinHnLn+bpH5/L0XOEcmDMc4h4kWNQnOH0wgqOmVD4AWHeUmC2/V271WKfL9ri2tV/g qZpwUgR3EtvD9JV2NaH+64SsBbj2FuC/rZsihZoY9MqlLauMho00EWN6ma5OFXPe0Cww JffreXzvmDwEgHUperczVrcA5aJDo9TwA210syTRar++wM/R5Zfmkf/2ZW96s3z8pJr8 aTuA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AGRZ1gI+9Mxilf8JWHVmOjxBViHoXqUJMXOAepRt5Ax0Q+sE8cYGp68F xv3/dcKEi8SBNGS0x/Zx4EO9ykLYN/8q0nU8Va7HPhscZ5Qg//BOrw7Bwwo+EdUulh01MxRKup0 YxSrzMnxbhdtwZxytunbWwgbyIRcpXUC8RdTlP9gc1wjXEvH2XcxxC8WsqXNzIcxRvQ== X-Received: by 2002:ac8:31ed:: with SMTP id i42mr21763524qte.323.1542653862110; Mon, 19 Nov 2018 10:57:42 -0800 (PST) X-Google-Smtp-Source: AJdET5dJCq6xh7s3x+OON7Bk/66fxNpINo88wNDMybKRqC+ic0xmUGrmNPUvhgSKeaxy1Pt4b/Ue X-Received: by 2002:ac8:31ed:: with SMTP id i42mr21763488qte.323.1542653861073; Mon, 19 Nov 2018 10:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542653861; cv=none; d=google.com; s=arc-20160816; b=0vPGcu8WAjcVMi+N1sCMCk4oo6R8jcr8MEg+Lcq4R6UqqLmmv2kyKU8l1Ae+FNnsee iAQZpdzDi7CGlEw82sU82ryXxvGatii5Gz/AdPp9covnhLy81Zwp77sf27aosxDz0qQx zakwZXlB1/tmH354T0BqMYxc1uFocosXP3DpQxZX7Umdp1Nq532ZVQERI3VWKniDQw4P QFl0QGSyt/XKm7F5nwm9wrAnJ4dihhjvyK/L3hKcVleqJwOTHr23p5LpNGfq0/jm0Bd4 KFgAve8G8Xp3m0+vdYjix3d3UMSc51AEcjAso2sEeg2cIuzFOVLVSE/Ic5uPuwFyRq6K q4pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=E+Ucu4Ad9hHS3vGoIXwWZmms3i3F/iQLn9fd6FpayKc=; b=0s+DqevTI28oHfT6a25hBqDi0JH5Y+GdFl5RUpL6zbEK76KER66CUnQUn5QkYk8E7K rdGXGqmrMWj9OjiI2eOrvDKxiOASOCJBif3t3GNAN/f1aSMlWxw454dGEk7vbKABpLOx UbTJ5/fHrIkyasuoUN+pyFzHk7uuYlrQfsyypj1/PINN04tT8TA277CKnN1Z3LwLEuW/ MJSklCNr9t38aeCYScNVopbupg+kA0uJFDSRGmmCuJLxDDGhJEScz5mJ+7hR0sY16b0y lpg/UHLLahsFD/sJKB5ceRTjiiQ/11av4xGo9imgOgmuR5I5+2X4B0Sho8ntIxpciuZy ayVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id i18si4050079qtq.201.2018.11.19.10.57.40 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 10:57:41 -0800 (PST) Received-SPF: pass (google.com: domain of longman@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B2DF30026D5; Mon, 19 Nov 2018 18:57:40 +0000 (UTC) Received: from llong.com (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B90B660922; Mon, 19 Nov 2018 18:57:38 +0000 (UTC) From: Waiman Long <longman@redhat.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>, Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Petr Mladek <pmladek@suse.com>, Sergey Senozhatsky <sergey.senozhatsky@gmail.com>, Andrey Ryabinin <aryabinin@virtuozzo.com>, Tejun Heo <tj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Waiman Long <longman@redhat.com> Subject: [PATCH v2 12/17] cgroup: Mark the rstat percpu lock as terminal Date: Mon, 19 Nov 2018 13:55:21 -0500 Message-Id: <1542653726-5655-13-git-send-email-longman@redhat.com> In-Reply-To: <1542653726-5655-1-git-send-email-longman@redhat.com> References: <1542653726-5655-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 19 Nov 2018 18:57:40 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
locking/lockdep: Add a new class of terminal locks
|
expand
|
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index d503d1a..47f7ffb 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -291,8 +291,13 @@ void __init cgroup_rstat_boot(void) { int cpu; - for_each_possible_cpu(cpu) - raw_spin_lock_init(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu)); + for_each_possible_cpu(cpu) { + raw_spinlock_t *cgroup_rstat_percpu_lock = + per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu); + + raw_spin_lock_init(cgroup_rstat_percpu_lock); + lockdep_set_terminal_class(cgroup_rstat_percpu_lock); + } BUG_ON(cgroup_rstat_init(&cgrp_dfl_root.cgrp)); }
By classifying the cgroup rstat percpu locks as terminal locks, it reduces the lockdep overhead when these locks are being used. Signed-off-by: Waiman Long <longman@redhat.com> --- kernel/cgroup/rstat.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)