Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2663317imm; Thu, 18 Oct 2018 19:54:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV60iTFiPhDfvmwOuEw6Urf5hJh7JDpXTWvZnk2pV6uFuZpbmYSaJeh2KVx+YTcP3WfAcYPuo X-Received: by 2002:a63:5224:: with SMTP id g36-v6mr31266669pgb.253.1539917678336; Thu, 18 Oct 2018 19:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539917678; cv=none; d=google.com; s=arc-20160816; b=veahBA/9OTFnhBEiIaQk/OwQvuFjtvg5DY2oyyEYWRHErpxvW90D23jS3OsvhD7Lqu nTHXjv6qSv/7sYxcQWT7vYeC5MYkVBi7xFkIZf4IJMO75UmD7dOmk8W7am9SnaiP197O f+Eg24R6igkBmKmYvrrWopLpC+hZrQ+7RjpLVZ1YzpK21YzUZLz9UlOYgCYShCiA6AHw dNa9jMQtMMyK6DXAVyU67XCH8E6G2b6krTxD1+w/+t7yu2sN1VRXuE0dBrZACq7/o/J4 P+ULnee8KGGoFK1UTZey2aoNQMduFqMOUkeiRjxm5KA2lxrm0CTduVDRBnHmaFE3Sp+a rTZQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=RTchG+Cfs8/Oz8IgETu1op/j056suqibq0v8r+7aGOI=; b=I6xbM0s1CAUPGLyjOcrWoVKtR4ouL6ks0yOLdoVazCa6Ppt3gJS/077qofv6gE6O0t 6rPSOsGJ0cgT+ufk+iAWPnskwNnaQX5/gxy4FFXXvZSLmDRGKmgAu05UzcY5neJPDz/C 7x3WhuIsXGj0XHbTTx9YqMbspa1Z3nK8CjbzONygoR2pIrsP+QYDLrShm3MkhatyoirP /pzKJoMYwG6yDollxuZijyzD55Fa9Hb39Ji0XqtjTFsNg2VINW4ffTGGCcbIckmziy3j JHVlCKZnHsg/D4KFORfROE5N0cdVsDeFRgsvzJ1H6IeKSf9wCgXDH9Na7EbJLzeC3ZyB C1yQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19-v6si21565584plp.304.2018.10.18.19.54.22; Thu, 18 Oct 2018 19:54:38 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbeJSK42 (ORCPT + 99 others); Fri, 19 Oct 2018 06:56:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbeJSK42 (ORCPT ); Fri, 19 Oct 2018 06:56:28 -0400 Received: from vmware.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 7CBE120C0E; Fri, 19 Oct 2018 02:52:25 +0000 (UTC) Date: Thu, 18 Oct 2018 22:52:23 -0400 From: Steven Rostedt To: Joel Fernandes Cc: "Paul E. McKenney" , 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: <20181018225223.42641c73@vmware.local.home> In-Reply-To: <20181019022529.GA155753@joelaf.mtv.corp.google.com> References: <20181016204122.GA8176@joelaf.mtv.corp.google.com> <20181017161100.GP2674@linux.ibm.com> <20181017181505.GC107185@joelaf.mtv.corp.google.com> <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> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Steve