Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3094842imm; Fri, 19 Oct 2018 05:08:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV60L9WEAvBuACEN9XIFW5ni2o3oHibm5hcpSlmBfbwJWVUNT2xYLaoDVf/HRsII1aghOSAai X-Received: by 2002:a17:902:aa87:: with SMTP id d7-v6mr34315303plr.25.1539950938733; Fri, 19 Oct 2018 05:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539950938; cv=none; d=google.com; s=arc-20160816; b=Nhsixu3EKX5QIdSJnwYohgWFUBcPXE7cfNheqN9p89OCXj2dC2JAmCVFSOpIaFlQyh SmJzC5lPMh+DqXs87kGl6yfGwPQIFO3kd49P4IfzKxwyilElKRmCA0vt1aIgUfGqOBmj zPeZyDqfTE+HbdmSD3948oQ/3qafUkeNrT8CskSKTM63Ift9yyiMtpOQBZSsOlyX86gD 1Q7WkN4ldVnfESGx4kZiIsfFW5OKwH6fTfb7zLJ5NZWd0dK4LFqcd4RO+TFrRTwcoy48 6rlF8nCHCQL46oDgPLmSHZsYn+E9L4py4Qja8e8CzSq6nezHaCHu4QVj5UV33mZscPd7 Ysgw== 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; bh=S2TfRm7F928QqZJYCK2yFdNkiEukPp5B954FyjpLqt8=; b=otWefP0PlyOpHzqsgcQ7+Mxeom4qOe5Wkd5nNcKVkpPfm45fGrY4Y6GRkuaPlfUuZA odLmaga/XLV4XuqAxn6d7xfIjKhWrg5ocgaAm43hqFUHq0YG7goBzd2B8TjOIEEqOCoe rkayJjlgm9GwAcU4tNnjn8tdj7+l9Ff1qJT5h2vcHGYRoXNX7/htMN7+4J3aHrBzxJZU qdmrj4FaDWNU8czA+MKAjx19+WaQe04hbckJXJK0ZpFguwQ0jf5iXI/hQXhQiOeGBER2 1hq2daGlWxG+ReavsFBIhFLGZa2JCjtKKz2ZM3lb/WQfL8Y+dTojkUPeMBK+ajMuypM0 kKpw== 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 23-v6si24186328pgs.356.2018.10.19.05.08.43; Fri, 19 Oct 2018 05:08:58 -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 S1727550AbeJSUNx (ORCPT + 99 others); Fri, 19 Oct 2018 16:13:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38938 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727170AbeJSUNx (ORCPT ); Fri, 19 Oct 2018 16:13:53 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9JC4SAm095712 for ; Fri, 19 Oct 2018 08:08:04 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2n7dbvw4sa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Oct 2018 08:08:03 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Oct 2018 08:08:02 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 19 Oct 2018 08:07:59 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9JC7w5F44302520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Oct 2018 12:07:58 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6DA2B2065; Fri, 19 Oct 2018 12:07:58 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76B51B2066; Fri, 19 Oct 2018 12:07:58 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.109]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 19 Oct 2018 12:07:58 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 26E7216C39BB; Fri, 19 Oct 2018 05:07:58 -0700 (PDT) Date: Fri, 19 Oct 2018 05:07:58 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , Nikolay Borisov , linux-kernel@vger.kernel.org, Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers Subject: Re: [PATCH RFC] doc: rcu: remove obsolete (non-)requirement about disabling preemption Reply-To: paulmck@linux.ibm.com References: <20181017203324.GS2674@linux.ibm.com> <20181018020751.GB99677@joelaf.mtv.corp.google.com> <20181018144637.GD2674@linux.ibm.com> <20181019000350.GB89903@joelaf.mtv.corp.google.com> <20181019001932.GR2674@linux.ibm.com> <20181019012645.GC89903@joelaf.mtv.corp.google.com> <20181018215035.5e8ff553@vmware.local.home> <20181019022529.GA155753@joelaf.mtv.corp.google.com> <20181018225223.42641c73@vmware.local.home> <20181019035844.GA141835@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181019035844.GA141835@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18101912-0060-0000-0000-000002C36E1F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009899; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01104916; UDB=6.00572041; IPR=6.00884966; MB=3.00023821; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-19 12:08:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18101912-0061-0000-0000-000046E6ABAF Message-Id: <20181019120758.GV2674@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-18_11:,, 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-1807170000 definitions=main-1810190109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 08:58:44PM -0700, Joel Fernandes wrote: > On Thu, Oct 18, 2018 at 10:52:23PM -0400, Steven Rostedt wrote: > > On Thu, 18 Oct 2018 19:25:29 -0700 > > Joel Fernandes wrote: > > > > > On Thu, Oct 18, 2018 at 09:50:35PM -0400, Steven Rostedt wrote: > > > > On Thu, 18 Oct 2018 18:26:45 -0700 > > > > Joel Fernandes wrote: > > > > > > > > > Yes, local_irq_restore is light weight, and does not check for reschedules. > > > > > > > > > > I was thinking of case where ksoftirqd is woken up, but does not run unless > > > > > we set the NEED_RESCHED flag. But that should get set anyway since probably > > > > > ksoftirqd is of high enough priority than the currently running task.. > > > > > > > > > > Roughly speaking the scenario could be something like: > > > > > > > > > > rcu_read_lock(); > > > > > <-- IPI comes in for the expedited GP, sets exp_hint > > > > > local_irq_disable(); > > > > > // do a bunch of stuff > > > > > rcu_read_unlock(); <-- This calls the rcu_read_unlock_special which raises > > > > > the soft irq, and wakesup softirqd. > > > > > > > > If softirqd is of higher priority than the current running task, then > > > > the try_to_wake_up() will set NEED_RESCHED of the current task here. > > > > > > > > > > Yes, only *if*. On my system, ksoftirqd is CFS nice 0. I thought expedited > > > grace periods are quite important and they should complete quickly which is > > > the whole reason for interrupting rcu read sections with an IPI and stuff. > > > IMO there should be no harm in setting NEED_RESCHED unconditionally anyway > > > for possible benefit of systems where the ksoftirqd is not of higher priority > > > than the currently running task, and we need to run it soon on the CPU. But > > > I'm Ok with whatever Paul and you want to do here. > > > > > > Setting NEED_RESCHED unconditionally wont help. Because even if we call > > schedule() ksoftirqd will not be scheduled! If it's CFS nice 0, and the > > current task still has quota to run, if you call schedule, you'll just > > waste time calculating that the current task should still be running. > > It's equivalent to calling yield() (which is why we removed all yield() > > users in the kernel, because *all* of them were buggy!). This is *why* > > it only calls schedule *if* softirqd is of higher priority. > > Yes, ok. you are right the TTWU path should handle setting the NEED_RESCHED > flag or not and unconditionally setting it does not get us anything. I had to > go through the code a bit since it has been a while since I explored it. > > So Paul, I'm Ok with your latest patch for the issue we discussed and don't > think much more can be done barring raising of ksofitrqd priorities :-) So I > guess the synchronize_rcu_expedited will just cope with the deal between > local_irq_enable and the next scheduling point.. :-) Thank you both! Indeed, real-time systems need to be configured carefully, especially if you are crazy enough to run them under high load. I interpreted "Ok with your latest patch" as an Acked-by, but please let me know if that is a misinterpretation. Thanx, Paul