Received: by 10.213.65.68 with SMTP id h4csp730255imn; Sun, 25 Mar 2018 11:44:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELuH/qXj3aKeK4MdSqsYKEgPvnQ6sF8ENUCqg7xWrI3BqsP+Tc41hiV11uG6uTwOSHUXXfdG X-Received: by 10.99.110.133 with SMTP id j127mr26713181pgc.79.1522003443131; Sun, 25 Mar 2018 11:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522003443; cv=none; d=google.com; s=arc-20160816; b=FpPu/IJMvkWnRPc9OSBf7GuWznWg1S4sUanbxRiaHkOYASKJ0Lb/jpxF1anHSenlBQ Jbv5YzqWw7DDazHO+jQxp1RIE0r5L8OagMbxrFRnZXLneIpJOceLuChRMaz8vwCBR6nC 1UWUNExVItIe3Ajdmq9CFPvrskgYCFKZqnBSG0pH0w8BU3e0R+H+RYNv1khy2dlrh0bx OgD3OQEmlK55/auqhTbv02dEzXdyXF8k0JyZYpilfx4kBPwPVuDWJBiji9RXzjAEiv9h z/Zsa/+xiSQmrLsW5j/qXCq4GFZiqGwai66Yo5DxWitssQc8vLyIycXcSf1cypsRr6OG 1ePA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=8PZdHM9JOZ8hMUnXr/A9nwjND/U2fpIdDTsQMw+f0r8=; b=TnVcWbmUMRSM9iV1VJhcQlsaUDo2PycopRLzciOYC+Y4NLVudw/BL/s+HoSqll6Dz9 lhdNkjQ8VQfE2ccYmirmPxcptxg8XI7HAbd4Qa0DUq76LLT7yvWcA/I/1v8fjQ/PKjFM 2MrHGbu6P6diBYURyKRLtY1toBpETTMKo+OdH8cLTo1w3NiKEQN/Dc7oTMZGgNGoabnL 5ZtBHWDHzN1zMxLk/QyAXdRQ1LpNgsa/etSEGImwayFR0c2qmjbD9aTCwzFybBHAbZea 1WcG5FvvJ37soOz+TrupdgPaRwMKngmqP6ozk43ZbE8rCXBylwDCS70TDh3xJ/Hz70Lj yh3w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4si2712539pfd.257.2018.03.25.11.43.48; Sun, 25 Mar 2018 11:44:03 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753984AbeCYSmZ (ORCPT + 99 others); Sun, 25 Mar 2018 14:42:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44978 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753832AbeCYSmW (ORCPT ); Sun, 25 Mar 2018 14:42:22 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2PIdMoI006685 for ; Sun, 25 Mar 2018 14:42:21 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gx6fcejry-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 25 Mar 2018 14:42:21 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 25 Mar 2018 14:42:19 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 25 Mar 2018 14:42:17 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2PIgGwj55181416; Sun, 25 Mar 2018 18:42:16 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 23B7AB2046; Sun, 25 Mar 2018 15:44:27 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.80.206.195]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id F3D18B2052; Sun, 25 Mar 2018 15:44:26 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E2BDB16C152A; Sun, 25 Mar 2018 11:43:07 -0700 (PDT) Date: Sun, 25 Mar 2018 11:43:07 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , Thomas Gleixner , LKML , Peter Zijlstra , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan Subject: Re: rcu: Add might_sleep() check to synchronize_rcu() Reply-To: paulmck@linux.vnet.ibm.com References: <20180323172843.763579a9@gandalf.local.home> <20180323174023.60579f45@gandalf.local.home> <20180323212105.40766d1c@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323212105.40766d1c@vmware.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18032518-2213-0000-0000-000002849E10 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008742; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01008302; UDB=6.00513544; IPR=6.00787591; MB=3.00020235; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-25 18:42:19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032518-2214-0000-0000-000059875EAD Message-Id: <20180325184307.GE3675@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-25_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803250227 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 09:21:05PM -0400, Steven Rostedt wrote: > On Fri, 23 Mar 2018 15:57:04 -0700 > Joel Fernandes wrote: > > > > diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c > > > index 194a7483bb93..857b494bee29 100644 > > > --- a/net/l2tp/l2tp_core.c > > > +++ b/net/l2tp/l2tp_core.c > > > @@ -1677,6 +1677,8 @@ void __l2tp_session_unhash(struct l2tp_session *session) > > > { > > > struct l2tp_tunnel *tunnel = session->tunnel; > > > > > > + might_sleep(); > > > + > > > /* Remove the session from core hashes */ > > > if (tunnel) { > > > /* Remove from the per-tunnel hash */ > > > > Thanks Thomas and Steven, also shouldn't this code be calling > > synchronize_rcu_bh instead of synchronize_rcu, to complement the > > rcu_read_lock_bh? In which situations would you call one versus the > > other? > > Probably, as the comment above rcu_read_lock_bh is: > > * rcu_read_lock_bh() - mark the beginning of an RCU-bh critical section > * > * This is equivalent of rcu_read_lock(), but to be used when updates > * are being done using call_rcu_bh() or synchronize_rcu_bh(). Since > * both call_rcu_bh() and synchronize_rcu_bh() consider completion of a > * softirq handler to be a quiescent state, a process in RCU read-side > * critical section must be protected by disabling softirqs. > > It appears that the reason to use rcu_read_lock_bh() is if you are > calling synchronize_rcu_bh(). Otherwise, one could just be using > straight rcu_read_lock(). Agreed, these do have to match. (I am still working on collapsing RCU-preempt, RCU-bh, and RCU-sched into one thing per Linus's request, but still at the pen-and-paper stage. Not all that difficult, just a lot of cases to cover.) Thanx, Paul