From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761270AbdEWFUP (ORCPT ); Tue, 23 May 2017 01:20:15 -0400 Received: from smtprelay0198.hostedemail.com ([216.40.44.198]:34190 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752052AbdEWFUN (ORCPT ); Tue, 23 May 2017 01:20:13 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1183:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1605:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2551:2553:2559:2562:2691:2693:3138:3139:3140:3141:3142:3622:3743:3865:3866:3867:3868:3870:3871:3872:3873:3874:4030:4250:4362:4385:5007:6261:7875:8957:9040:10004:10400:10848:10967:11026:11232:11658:11914:12050:12295:12296:12438:12663:12740:12760:12895:13071:13137:13150:13161:13229:13230:13231:13439:14039:14096:14097:14180:14181:14659:14721:21060:21080:21324:21433:21627:30012:30022:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: stage12_75d1252cefa3c X-Filterd-Recvd-Size: 4135 Date: Tue, 23 May 2017 01:19:58 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner Subject: Re: Use case for TASKS_RCU Message-ID: <20170523011958.12832849@vmware.local.home> In-Reply-To: <20170523000036.GA13506@linux.vnet.ibm.com> References: <20170515182354.GA25440@linux.vnet.ibm.com> <20170516062233.tyz7ze7ilmbkxtjc@gmail.com> <20170516122354.GB3956@linux.vnet.ibm.com> <20170519062331.52dhungzvcsdxdgo@gmail.com> <20170519133550.GD3956@linux.vnet.ibm.com> <20170519100421.27298063@gandalf.local.home> <20170519102331.0d5a8536@gandalf.local.home> <20170519190609.GE3956@linux.vnet.ibm.com> <20170523000036.GA13506@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 May 2017 17:00:36 -0700 "Paul E. McKenney" wrote: > On Fri, May 19, 2017 at 12:06:09PM -0700, Paul E. McKenney wrote: > > On Fri, May 19, 2017 at 10:23:31AM -0400, Steven Rostedt wrote: > > > On Fri, 19 May 2017 10:04:21 -0400 > > > Steven Rostedt wrote: > > > > > > > On Fri, 19 May 2017 06:35:50 -0700 > > > > "Paul E. McKenney" wrote: > > > > > > > > > Simpler would be better! > > > > > > > > > > However, is it really guaranteed that one SCHED_IDLE thread > > > > > cannot preempt another? If not, then the trampoline-freeing > > > > > SCHED_IDLE thread might preempt some other SCHED_IDLE thread > > > > > in the middle of a trampoline. I am not seeing anything that > > > > > prevents such preemption, but it is rather early local time, > > > > > so I could easily be missing something. > > > > > > > > > > However, if SCHED_IDLE threads cannot preempt other threads, > > > > > even other SCHED_IDLE threads, then your approach sounds > > > > > quite promising to me. > > > > > > > > > > Steve, Peter, thoughts? > > > > > > > > SCHED_IDLE is the swapper task. There's one on each CPU, and > > > > they don't migrate. And they only get called when there's no > > > > other task running. > > > > > > Peter just "schooled" me on IRC. I stand corrected (and he may > > > respond to this email too). I guess any task can become > > > SCHED_IDLE. > > > > > > But that just makes this an even less likely option for > > > synchronize_rcu_tasks(). > > > > Hmmm... The goal is to make sure that any task that was preempted > > or running at a given point in time passes through a voluntary > > context switch (or userspace execution, or, ...). > > > > What is the simplest way to get this job done? To Ingo's point, I > > bet that there is a simpler way than the current TASKS_RCU > > implementation. > > > > Ingo, if I make it fit into 100 lines of code, would you be OK with > > it? I probably need a one-line hook at task-creation time and > > another at task-exit time, if that makes a difference. > > And please see below for such a patch, which does add (just barely) > fewer than 100 lines net. > > Unfortunately, it does not work, as I should have known ahead of time > from the dyntick-idle experience. Not all context switches go through > context_switch(). :-/ > > I believe this is fixable, more or less like dyntick-idle's > half-interrupts were fixable, but it will likely be a few days. Not > clear whether the result will be simpler than current TASKS_RCU, but > there is only one way to find out. ;-) > Hi Paul, I'm currently traveling and don't have the energy to look at code at the moment. Hopefully, I can look at this more on Thursday or Friday. Thanks! -- Steve