Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1175023ybl; Fri, 16 Aug 2019 10:06:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqmg/38mBeYr0Tj14DUJ1VN3P9MFvlGBlnrUwNRtgEJtl3nrHLKb5mgxSCai3L312q8tPK X-Received: by 2002:a17:90a:feb:: with SMTP id 98mr7780825pjz.55.1565975171184; Fri, 16 Aug 2019 10:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565975171; cv=none; d=google.com; s=arc-20160816; b=yee9NxyrhH02PmUuZpzBLpfPZjZFNwmBMxEJrhomp8q+V4VkYHaT+Fd8FTnlCcN26q SvIg0X3jlqVgF0YtnJaKsSLObNVCheHF8xTMN716QRNbUcYjyih0udzmZEgrqmTtXzDX vN3w/besGi5dhuOvANR8euJ9IvJzXsCgu2moDjyVbbbqje0NsCrEK91CUZt6Ii4fhZ1s 2dGKuHYoZ7iTu49MNjF6XkdT5GxZNveRRPc/t95RsQ2mgHvAQKAG750XnOSsXpsEIJnj pz4Pzbpx+Tq9lOiBNBX1U7yGxPtxJZI+IDx3QzPd3P7l7Cb2bMUCsRdxxAZJliQjQ1mV yPWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=KwqNgJuVyDQhawVwdhGdC5R0/yjxNM63+8ez75Am2Zc=; b=efEpxq5CV0TIVeVBemjLjy6GlqxgNoppSSeAX1TZ+udfhFx2G6MV17L80yh/YeFAHQ /C4NyOrCChiTdcRyPSeXgtw8dVVzkLvCJxI2ddBxueFWgrWg34SDNAi4TuF/ytJxCjal svstuI9Zvq2vHkR7onNhcxRCFiX1ryAg/I6RwltFZY+ekJ4jbIGMO3ffJQOQaCpHX/zu c5Oaw9ECWbH+rI1Bwi7LPnDMpzNnjg4h+Diq2OKVhMlMoy089WKC2brNNQXxxkoDbG++ Wjk+Q6yvnd8DhsR6pIXeZRmVm9LBOxv3SX/r0qZLY8S5Iyc5uG3/0DtKXbEX27s1sTY2 ivvA== 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 c13si4169812pgk.418.2019.08.16.10.05.54; Fri, 16 Aug 2019 10:06:11 -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 S1727357AbfHPRFE (ORCPT + 99 others); Fri, 16 Aug 2019 13:05:04 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:24010 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726447AbfHPRFE (ORCPT ); Fri, 16 Aug 2019 13:05:04 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7GGw09V103371; Fri, 16 Aug 2019 13:05:00 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2udx196k1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Aug 2019 13:05:00 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x7GGsaHV030759; Fri, 16 Aug 2019 17:04:59 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma01dal.us.ibm.com with ESMTP id 2ucr3qd816-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Aug 2019 17:04:59 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7GH4wv753739792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Aug 2019 17:04:58 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29AB0B2065; Fri, 16 Aug 2019 17:04:58 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0CBA6B2066; Fri, 16 Aug 2019 17:04:58 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.154]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 16 Aug 2019 17:04:57 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id D927116C236B; Fri, 16 Aug 2019 10:04:57 -0700 (PDT) Date: Fri, 16 Aug 2019 10:04:57 -0700 From: "Paul E. McKenney" To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, frederic@kernel.org Subject: Re: [PATCH v2 -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI Message-ID: <20190816170457.GT28441@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <20190816025311.241257-1-joel@joelfernandes.org> <20190816025914.GB242309@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816025914.GB242309@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-16_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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908160176 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 15, 2019 at 10:59:14PM -0400, Joel Fernandes (Google) wrote: > Sometimes I see rcu_urgent_qs is not set. This could be when the last > IPI was a long time ago, however, the grace period just started. Set > rcu_urgent_qs so the tick can indeed not be stopped. > > Signed-off-by: Joel Fernandes (Google) Great catch, queued, thank you! I updated the commit log as shown below, so could you please check to see if I messed anything up? Thanx, Paul ------------------------------------------------------------------------ commit 1f80df1e49b29ccd605882056a0565778e100e9e Author: Joel Fernandes (Google) Date: Thu Aug 15 22:59:14 2019 -0400 rcu/tree: Ensure that ->rcu_urgent_qs is set before resched IPI The RCU-specific resched_cpu() function sends a resched IPI to the specified CPU, which can be used to force the tick on for a given nohz_full CPU. This is needed when this nohz_full CPU is looping in the kernel while blocking the current grace period. However, for the tick to actually be forced on in all cases, that CPU's rcu_data structure's ->rcu_urgent_qs flag must be set beforehand. This commit therefore causes rcu_implicit_dynticks_qs() to set this flag prior to invoking resched_cpu() on a holdout nohz_full CPU. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 0512de9ead20..dd0a77bffa7d 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1091,6 +1091,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) if (tick_nohz_full_cpu(rdp->cpu) && time_after(jiffies, READ_ONCE(rdp->last_fqs_resched) + jtsq * 3)) { + WRITE_ONCE(*ruqp, true); resched_cpu(rdp->cpu); WRITE_ONCE(rdp->last_fqs_resched, jiffies); }