Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3432270imm; Fri, 19 Oct 2018 10:26:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV62V0axhHBMBG4zjeC1sq8aR/EQr1pVGuh5pyMSLSKBDnRXO7Wu1UsBIUh8ZmU/Z5WdCxjKd X-Received: by 2002:a62:22c7:: with SMTP id p68-v6mr35626935pfj.53.1539970004801; Fri, 19 Oct 2018 10:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539970004; cv=none; d=google.com; s=arc-20160816; b=OlbtEXKeyTpA5LsiL0Jqh5iXaoB7peW1Yxlz1ezyawk6FfJsDRVz7inu+CZ0nsd3Xt 3JSzvRcb9yYm7+hB4U8lD+cGgPpZik0BBXyB0cLsnI5Bm+HHHUtl/O4G1Q8j0zK50c5x ReMWevtzDJ0vRhAEeqwLSkENvkiUGpl3k8xuYZos623jgwuqGbzTkstV+k8jEgvK4Glb SJh9UMANnWkXGm6QoB8zOGmJzhv9/BGU3oxZUcX1umns3RRKIQqjfwIp8SKeA5cgIkY3 aNQmZS0I7FlgHdJliEMm94o1wnED/QNGF6nWDenfXcTWHZ2nDChu/ZAPwL0q8jox/BB6 qaLQ== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=VTnFOBixui79GYZyd1d6AFYHBoWHP2ePrlCN4gUkHyk=; b=ayFSgjliXYCU/KgTsjjDbIs1NxIY68ai6LDVK0/G17gSerGaLR74WxBKrPif4Voc70 m1fq4ksTnPvRcOOYw3laaaL/8CHA6lwNgcoAxChBm0zi5vYXn4oKMLCr3lS/V9abeexl jzRGWGuXh0r1tNUGmIwjzKkmogMyIoFzF9vesLvi4TGotxKnstCrnLUfJvSo7Y4BztqY ss07s3yBIB1Qe/PqGFZSVObKj9xyqFMCo+xd3jGUiQAOJaSYyZ3flp8FZR9pO63CSWW0 G/0Jp8vaTBmQJtgUwGy+vN9ClWyd2cje/UZwH5OAO6hqVbpXi1WLRuwn1IhkjPP4TARa pv0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=biW9nDpq; 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 t14-v6si3047331pgi.518.2018.10.19.10.26.29; Fri, 19 Oct 2018 10:26:44 -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=@joelfernandes.org header.s=google header.b=biW9nDpq; 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 S1727836AbeJTBb3 (ORCPT + 99 others); Fri, 19 Oct 2018 21:31:29 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36805 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727741AbeJTBb3 (ORCPT ); Fri, 19 Oct 2018 21:31:29 -0400 Received: by mail-pl1-f194.google.com with SMTP id y11-v6so16139981plt.3 for ; Fri, 19 Oct 2018 10:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VTnFOBixui79GYZyd1d6AFYHBoWHP2ePrlCN4gUkHyk=; b=biW9nDpqzbHaUAY2aAwObqu/S5gb09yycRPQuFQPwS915bCRnOZGzwu7bk/GlIdeD7 +WHAVw+YuhIAJ6S/VL+zRA0W+dw51NrMlfyvt4QaAD6HalCdvDMgWCWsXuCHsYTo43+9 bX2hHJqOSOWcrk7wqb0NkWzZPUwDjcqas535E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VTnFOBixui79GYZyd1d6AFYHBoWHP2ePrlCN4gUkHyk=; b=YpIk5sG7E6oPn4F0r8DXE0kG8A46cRXbnnhsKaJwbVR0Ulg0hX5JLCDZvqntbQ8W9+ jXgOZendPdPflmK8tFDpr0Fk4CUFSJEzt8rz5UBl+Js36kTfLcU9Dq9LxNq4c4VmHjsJ 0J/yzx1IU+j0S33pH/D+ggs10/bXKRS3D+1RVh0tXeXK6Lc/86xUNN97oYKsm7lQvNsv pXtYcMxgmP4ek9sLMUzmBvhkxdEXXAL4re2CrkvDV62rLGFmJFNDpAc4/DkWarZY6Iug 5UYIwBTvYxTEME4SgbmQvBfz+qt5p3SIgaf4h7qc3DmanQPW2q4ACskkovbhos9Td2z4 8FvQ== X-Gm-Message-State: ABuFfoioHS+ctwH6phG9YHJ/ak0k+fTepiTNdHtQQNFJXsZgxwmKNSCK k0Aer/v/mxRVhDALXKker9SX7BeEZyI= X-Received: by 2002:a17:902:59d2:: with SMTP id d18-v6mr2932755plj.116.1539969867836; Fri, 19 Oct 2018 10:24:27 -0700 (PDT) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id i5-v6sm24315196pgs.10.2018.10.19.10.24.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 10:24:26 -0700 (PDT) Date: Fri, 19 Oct 2018 10:24:25 -0700 From: Joel Fernandes To: "Paul E. McKenney" 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 Message-ID: <20181019172425.GA197351@joelaf.mtv.corp.google.com> References: <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> <20181019120758.GV2674@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181019120758.GV2674@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 19, 2018 at 05:07:58AM -0700, Paul E. McKenney wrote: > 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. Yes, Acked-by: Joel Fernandes (Google) thanks! - Joel