From patchwork Mon Nov 19 18:55:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10689319 Return-Path: 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 DC2B713AD for ; Mon, 19 Nov 2018 18:57:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6D82A46F for ; Mon, 19 Nov 2018 18:57:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1FC32A470; Mon, 19 Nov 2018 18:57:40 +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 694D52A479 for ; Mon, 19 Nov 2018 18:57:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5CA66B1BEF; Mon, 19 Nov 2018 13:57:37 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A0A576B1BF0; Mon, 19 Nov 2018 13:57:37 -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 8F8FF6B1BF1; Mon, 19 Nov 2018 13:57:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 6592A6B1BF0 for ; Mon, 19 Nov 2018 13:57:37 -0500 (EST) Received: by mail-qk1-f199.google.com with SMTP id j125so4417281qke.12 for ; Mon, 19 Nov 2018 10:57:37 -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=Mibn5q7auVAfC91nUxucCjCODDH5pGKjJzAGifA4cIs=; b=SLXVuXlfvsDiKS5K5hEEqTSkIORqAWULC4ZGG+8inJMulPOY3ylL28Ejj0LQGw9rer Fi/wnjzlQSO66Prz98d+BoojR3vm5m2mpP0rha2bRitDYANnb4tkkbDci+NDMMNrkmjM RoAvoamis4TQCrnB4JbeRkl+bh5GORSQdDf4h+AHbtsg2zegiBLfL5ed+MIwpx7Qh1yO /3cupu9nIFcimnkqOVJxB5sDFy/EWEN3hBXTMjbKxt/63wf4CvhWvC7F8scYMgX6WEG4 T3GqETU+ohVyNDb7bZztvyhhWRUly/gS+sPCXX7k6yUJCa2VVA+MGJzXq2KS6j9T83dS yAuQ== 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: AGRZ1gK/v7eVkp2s3YY9TDhXZI7fyy00mMMpFug+AviDznnp+n8WeXK7 CpJjMtnipqfbNen3+Fy8Pg3m12NTpaBSC0SrsvK6fqxayaTeVscE3Sdhhv6CNnTysFgJgpP7DrF IhriEysFw+KWNxGd4BTUxpI6xfsUSA8gd8pg+QMQWCpruG0+DE7QLjiHQ2oe5NBOO/w== X-Received: by 2002:a37:cf02:: with SMTP id e2mr21580497qkj.38.1542653857188; Mon, 19 Nov 2018 10:57:37 -0800 (PST) X-Google-Smtp-Source: AJdET5fJH6j4gdE3J6EN8OtKOJJEOZF07XV9bT7rOOfqe6ryNTd+IGcCoI46O679cJhQ/HBgZPJQ X-Received: by 2002:a37:cf02:: with SMTP id e2mr21580479qkj.38.1542653856472; Mon, 19 Nov 2018 10:57:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542653856; cv=none; d=google.com; s=arc-20160816; b=KeyzJ0xh7WGw6sDjzlQgJHzDUdKX+MN6qaq0UNhEzzzDES5oxC1w8n4isl7od9/Ehb 2032hLFKfjkDPI7zsffEsCwK55NdKduOWQRsWPkLwVeRGcgbruOqvHaAXEtxXeKVnXrr CyE3nQMY4WUw4WFJ8BEQ9xjUqzEmoIqp3mG6AffjdFyv8dCChYfRpQltgkQzJSd836T1 Rtp67i41DeItxIuiLIYQMxv+0SB6RX3UNBys/9fGEFSLQSv7h/Ewx8yQBXOe2caxitjb rLz73tu9SmtuRbxwAMqeth5f4yOoJhQtsK5pXRhg5HEywr5k2/Wgys23Jtr/qsijVd/2 YtBg== 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=Mibn5q7auVAfC91nUxucCjCODDH5pGKjJzAGifA4cIs=; b=tR5M/8+tUV4cJ7tv2pb7hFkNFj2eaZCwe3YUhufJD3d9l7td9tg43IgoJNhQmJMPqi xiXPsPME49qAH5T63tk1Sz0Aftm2Kqf9b3812PiHwUMf39ReWkqrVos8swmxE7w+yjDI ohk4qNsvpIgsXkb+QG+10xnTAyHjJ4F0adWESIPZRvGMEdlrx6W9gXwmxXaYQ/7MSN+s PVkTvBvbqtcSuJgFgbfTcpuDM5ceaGtcsRV5DuqaOmHEl5tgPiJR2nvYmHun2gqYf7Pu NpMzSi/Qax2ixAiqMF7jeu+i7vnq0ccTurYyems5mVL4bhFVIzdvnP+H40y3k27QmO9A lSPA== 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 y36si130100qtd.218.2018.11.19.10.57.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 10:57:36 -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 830AF3084033; Mon, 19 Nov 2018 18:57:35 +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 DD3666090B; Mon, 19 Nov 2018 18:57:33 +0000 (UTC) From: Waiman Long To: Peter Zijlstra , Ingo Molnar , Will Deacon , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Petr Mladek , Sergey Senozhatsky , Andrey Ryabinin , Tejun Heo , Andrew Morton , Waiman Long Subject: [PATCH v2 09/17] debugobjects: Make object hash locks nestable terminal locks Date: Mon, 19 Nov 2018 13:55:18 -0500 Message-Id: <1542653726-5655-10-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.40]); Mon, 19 Nov 2018 18:57:35 +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: X-Virus-Scanned: ClamAV using ClamSMTP By making the object hash locks nestable terminal locks, we can avoid a bunch of unnecessary lockdep validations as well as saving space in the lockdep tables. Signed-off-by: Waiman Long --- lib/debugobjects.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 4216d3d..c6f3967 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -1129,8 +1129,13 @@ void __init debug_objects_early_init(void) { int i; - for (i = 0; i < ODEBUG_HASH_SIZE; i++) + /* + * Make the obj_hash locks nestable terminal locks. + */ + for (i = 0; i < ODEBUG_HASH_SIZE; i++) { raw_spin_lock_init(&obj_hash[i].lock); + lockdep_set_terminal_nestable_class(&obj_hash[i].lock); + } for (i = 0; i < ODEBUG_POOL_SIZE; i++) hlist_add_head(&obj_static_pool[i].node, &obj_pool);