Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3784225ybi; Mon, 29 Jul 2019 12:33:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqykaZ9Hp+M19Z9iI6LLne8GKoK9RtY8xcMa49kYFsCPqLaDfIURVz/J15shHImfbtvY5Y9Q X-Received: by 2002:a65:4304:: with SMTP id j4mr108142612pgq.419.1564428813545; Mon, 29 Jul 2019 12:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428813; cv=none; d=google.com; s=arc-20160816; b=yHzNjLkQOJFkq0UkN/eHhz2ldislq4xyl+GQ9opMDau/SSofOS3+i8wYvA7X8oreQQ fZQbI7PooGGwZ9aCxqhvvGcARCaxC0RTcUbCbpZC6CoYI3Gww/MUYlie9tKvou3n6Aq6 ALb55OCYUxClkyLBX+TU+PC71W9LssE/2CD93aeUXaHDwcLzuOkCNAZ2ofxgUeWK0Ptj j5etPVROLxxNOp1L64Y/l6XwLWa9+IFtdT6291EAoqHmwh3bIZXXY4oCiMW8sEyxOb2q w6C93vnfBD/wol1XQMaVC1DowdPesTSJcuTErEFaEbM1wHHzAcGeysh3DC83b4hUIHr6 d/wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fhb080Rd21oHOIQnElfCc1lIxrr6dZcIH73T2YNNvbY=; b=zihuulb2IfZsuyjzplBK8kQPkdqcwwF23XeeGArvVI3z0dkktro4cyTPI/+6hw9RD6 A82IOdMbHtlV3GRWU0ZxNmygkeTZUnHLxx5dHoOCGYrlK7FiQD/3fCw1Re8ScBLyri5G 34kc3t8MeYWvdhzhoy7Y3jujGCjpE4Rh9WxIvtbDrYBlsRB2rN/J/k3v7uqAZPvEW0AP +HhX6H+KLpMLWDTzFSj/hA5fY/PcsyhLP519KnUGgH+m8VdwU/daDJ1YxxXgZeXW4AVo 5xxGNscqhnoBH9rPB6iHjhU0gxf7lhDLaBF3hNjGP30u/303g0xf4pV1XvML+UCE5XXl NNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hKXnhj4o; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si14780698pfn.144.2019.07.29.12.33.18; Mon, 29 Jul 2019 12:33:33 -0700 (PDT) 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=@kernel.org header.s=default header.b=hKXnhj4o; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388319AbfG2T0A (ORCPT + 99 others); Mon, 29 Jul 2019 15:26:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:38366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388304AbfG2TZ7 (ORCPT ); Mon, 29 Jul 2019 15:25:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2520521655; Mon, 29 Jul 2019 19:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428358; bh=gAAXZVb4sqR+WEAU9rVh6bY0RZbiYUM1aZ4gQ/M1Fgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKXnhj4ohATaAtXGqhq0KcB3nIHOmYDskINnAbQ/zD0DWhzPwNxTxEQSqGLMlJ2KR 6bEZ/shrvvHd7MHUZ3yr1N2bbaaugtSw+J8zbfhCaoxRH25phWLW8WQLVx2wnk6Cvd dOzTVeF/GxM/mmZSRzLQWKuRIMS/CsGby9mhULbo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Waiman Long , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 4.14 049/293] rcu: Force inlining of rcu_read_lock() Date: Mon, 29 Jul 2019 21:19:00 +0200 Message-Id: <20190729190827.141825109@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6da9f775175e516fc7229ceaa9b54f8f56aa7924 ] When debugging options are turned on, the rcu_read_lock() function might not be inlined. This results in lockdep's print_lock() function printing "rcu_read_lock+0x0/0x70" instead of rcu_read_lock()'s caller. For example: [ 10.579995] ============================= [ 10.584033] WARNING: suspicious RCU usage [ 10.588074] 4.18.0.memcg_v2+ #1 Not tainted [ 10.593162] ----------------------------- [ 10.597203] include/linux/rcupdate.h:281 Illegal context switch in RCU read-side critical section! [ 10.606220] [ 10.606220] other info that might help us debug this: [ 10.606220] [ 10.614280] [ 10.614280] rcu_scheduler_active = 2, debug_locks = 1 [ 10.620853] 3 locks held by systemd/1: [ 10.624632] #0: (____ptrval____) (&type->i_mutex_dir_key#5){.+.+}, at: lookup_slow+0x42/0x70 [ 10.633232] #1: (____ptrval____) (rcu_read_lock){....}, at: rcu_read_lock+0x0/0x70 [ 10.640954] #2: (____ptrval____) (rcu_read_lock){....}, at: rcu_read_lock+0x0/0x70 These "rcu_read_lock+0x0/0x70" strings are not providing any useful information. This commit therefore forces inlining of the rcu_read_lock() function so that rcu_read_lock()'s caller is instead shown. Signed-off-by: Waiman Long Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- include/linux/rcupdate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index f960c85cd9ec..8d570190e9b4 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -622,7 +622,7 @@ static inline void rcu_preempt_sleep_check(void) { } * read-side critical sections may be preempted and they may also block, but * only when acquiring spinlocks that are subject to priority inheritance. */ -static inline void rcu_read_lock(void) +static __always_inline void rcu_read_lock(void) { __rcu_read_lock(); __acquire(RCU); -- 2.20.1