Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10120888ybi; Wed, 24 Jul 2019 16:28:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdvmAK4kJw3F2UruwNk30GEMjw6R5J1fnazuwi2iOGxalcJ9XKPZUQjM/ogqoHLD2ud3D7 X-Received: by 2002:a17:902:aa09:: with SMTP id be9mr4109539plb.52.1564010919042; Wed, 24 Jul 2019 16:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564010919; cv=none; d=google.com; s=arc-20160816; b=VRqb/RB5fWV/PDBPuD3UijoMWBiIWTbi59PliPKTDt15uNxUmDqc7n0nL8Po8L/XxW YujIF86M/585zTkrfrrytNuH1OItQsGgzzHfKSi1IkQCzqpdIAOKlBeitOWOZgzkG7mE b8fFcPF0i8yjkD70d88XmVBWIQUFMTCVjNpQ6YIUkFh0knPRDXCnk7O4WsFT6AIbO7x7 TMY/Gu5jd2tFK+Q1sO5smCp/5zNqGF0lzsxGhhIDskDqhBsLKxc17BX7ZaKXkJ9RQrdn QWaHC3xMUktO2grg/7n1rYJ7bBuBJddoL8jRz3O/LTCIT1RI5tSE8MFSTlcsizZNXZud DYvg== 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=bWM9gLHQ9C1YIQCd+1D+T0sSoY1PGFMC+hQz0Vg+8BQ=; b=KcCuslNt3aCiGz9W5MHyKqXmJgu1efA1vY5PeQq+tz+9rXtZYz1xnLcNqOJLjDGC4e sd5fM2Dr0Mpw+D5b+1TWRGGN/ILpvE7s41xA6+OWlnxPrzy+DJhHRwD8zDRL8tD4qQeC Hw2rJDPKgBqprMsTOyComPhXdkEKmBVrE59jdUtzla859CRpl277HvqsPoqUCOZ9Werw 5aS1FYRLwFA0PpwWC0sMyXg5JfkliKMs/U+jUdVM+r9QD5SbxsENoAGgwHfsnDsSAJPF on4mnr95izte1j0NeKAaKg83cO+YXyvLj02sHc+2Kc9IDTv1YxJ8pCgXWDlsIk4J6Hmv 3YWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eh3ZR14c; 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 o23si18177571pfp.131.2019.07.24.16.28.24; Wed, 24 Jul 2019 16:28:39 -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=eh3ZR14c; 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 S1726431AbfGXT1Z (ORCPT + 99 others); Wed, 24 Jul 2019 15:27:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387669AbfGXT1Y (ORCPT ); Wed, 24 Jul 2019 15:27:24 -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 4E278218EA; Wed, 24 Jul 2019 19:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996443; bh=6gqoSKVRBOlG/2nj8pdniFeBf4g78OxMQX5BzuQQ0pA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eh3ZR14cCs5DDy7+DodJDaXHGmlYuWvUOOAfltvWTCX+m8EOAPssWtGplpbhJHBLN AaGUJMy5cwt81lHDO4KJSYD6tP5e0Vox1iWjornO07ErTO8BuyRwjnT4uzwMfFj7Du RijV4bQg4cQUQ2fsHLJOAyoKokzDL2o/XSp0+000= 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 5.2 098/413] rcu: Force inlining of rcu_read_lock() Date: Wed, 24 Jul 2019 21:16:29 +0200 Message-Id: <20190724191742.121503213@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 b25d20822e75..3508f4508a11 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -586,7 +586,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