From patchwork Mon Nov 19 18:55:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10689311 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 2156C13AD for ; Mon, 19 Nov 2018 18:57:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FC272A470 for ; Mon, 19 Nov 2018 18:57:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 036472A478; Mon, 19 Nov 2018 18:57:04 +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 A07AD2A470 for ; Mon, 19 Nov 2018 18:57:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 860D16B1B92; Mon, 19 Nov 2018 13:57:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7E88F6B1BE8; Mon, 19 Nov 2018 13:57:00 -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 6D87F6B1BE9; Mon, 19 Nov 2018 13:57:00 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id 43D436B1B92 for ; Mon, 19 Nov 2018 13:57:00 -0500 (EST) Received: by mail-qk1-f200.google.com with SMTP id k66so71416494qkf.1 for ; Mon, 19 Nov 2018 10:57:00 -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=H8VIsA4Ij3jks30GbEQG8DPgsV0wrakGHHdAzEZAbwQ=; b=QlLbgfia4VInB5V0hs/eQVB66XdNCYRPktaJwYb+h61S86DMtu0x2Em0gvQHqqxKGp ME64rcfCidEtPrRyOg6thVFXIL9WI9dTTLn70R3gQcWBeaIpfihj/uxDQV2O00Q0Btsu x1wABZUdMIHIpjsuF8HVsu6mOamDMkqvkx6oif/shGp5CNnDj8QsRStyNAI4pUwmKfyv gbF4/a6Av2zZ3lne2SlPxbXnZmDXzF0DLExOEnqwK32WYHViLuxzKDStraB7fRhz1koa JRZSeqiXyumefLxLO+prwWKkON+vrsXCCxPV8d4YYhZekEWxiSsy8/OuNlHlIoqG6mXt lvnQ== 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: AGRZ1gIeR2HVKQk2CTH66fQaqr/1ZGy0VG1BVkl05xtki+c0jQk8NKMo Ll4XRxyz2MX6lndLiFZirJwo/fHqfLFlvegWKj1TtB3nbjFwO7bIspT1NUXC1t1HRxjz/1IltMP moxIUo4mI54GjrQXSK3/czkHWd+598n0tIey6J2LdaJBksYfS1CVmCRCJn3+64Ybhfg== X-Received: by 2002:a37:2704:: with SMTP id n4mr21419713qkn.349.1542653820021; Mon, 19 Nov 2018 10:57:00 -0800 (PST) X-Google-Smtp-Source: AJdET5cSphZ21geqcl40Oh+IE3IzoGi85AiGNse2wmtpB6xiqtM+au5l/dpEnYM5kG0eTF5hDB/2 X-Received: by 2002:a37:2704:: with SMTP id n4mr21419688qkn.349.1542653819452; Mon, 19 Nov 2018 10:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542653819; cv=none; d=google.com; s=arc-20160816; b=K+3zgAdZiPXoa6JfYteYungukbQfCxQF/+VY0Sw2K1J4G+pDyj9Gpt6+dELeQdEN+e ejLvTVY68twbUppj70iuA60gy30sWCklgTjK9MwUHzFC2XBHwb3QmcoQEGyzl5EHYhIq kAgDSSz/DFW3Vbpn2KEf9mMUCkoToe1NeN1Ucx8q6yas19eA+f8PFK/80qSkJU84nvuL gknEpt7fVWfDtYtlUeuVyIwaQn+UwuWMPBGIc8BBukNGep/0GdAp8Al58wtd2p8myNv1 B+7P9mIYAE05ET0oJ6sW0SlpPEuwkSwImLt+K9TQRhCtMRhAKPPZORl6M/AgS+dqMGjc fMAQ== 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=H8VIsA4Ij3jks30GbEQG8DPgsV0wrakGHHdAzEZAbwQ=; b=UXD1/UPP70Gw+qjSbvDaGRQ9ubBNH2tPD6xBJNpw5AjWM7iwSHmdSj5mzBTUsQRGL7 onPXRHEg+Xg+GSwacpdQaLiUD/2Sgpchh/zsA/qiFYtFgnOTTNjr4rBFxhp3oXEA7uMw +8RmQqF4XUax1oJObLL8P9dW37ByTh/N1YQ9aKOOy0ftXaQHURcj3JcjuhYA4hPjPZbi 8GjXxMC161dNjSc71pVJoUd/5DKnDB1HCbT2QZa/DYcsvlYXtdOKyupN92fNsMyZwb37 oWlUvUlDoNTshOeAW3pgms40NSpqABDkxg7hPTFxt68ciKBtqwLADGI5b1t28L8CaXT5 cNug== 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 t22si474853qtq.46.2018.11.19.10.56.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 10:56:59 -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 2368B4E937; Mon, 19 Nov 2018 18:56:58 +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 9D00C6090B; Mon, 19 Nov 2018 18:56:56 +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 05/17] printk: Mark logbuf_lock & console_owner_lock as terminal locks Date: Mon, 19 Nov 2018 13:55:14 -0500 Message-Id: <1542653726-5655-6-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.38]); Mon, 19 Nov 2018 18:56:58 +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 marking logbuf_lock and console_owner_lock as terminal locks, it reduces the performance overhead when those locks are used with lockdep enabled. Signed-off-by: Waiman Long --- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 1b2a029..bdbbe31 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -367,7 +367,7 @@ __packed __aligned(4) * within the scheduler's rq lock. It must be released before calling * console_unlock() or anything else that might wake up a process. */ -DEFINE_RAW_SPINLOCK(logbuf_lock); +DEFINE_RAW_TERMINAL_SPINLOCK(logbuf_lock); /* * Helper macros to lock/unlock logbuf_lock and switch between @@ -1568,7 +1568,7 @@ int do_syslog(int type, char __user *buf, int len, int source) }; #endif -static DEFINE_RAW_SPINLOCK(console_owner_lock); +static DEFINE_RAW_TERMINAL_SPINLOCK(console_owner_lock); static struct task_struct *console_owner; static bool console_waiter;