Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1776913imm; Tue, 22 May 2018 09:08:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqBEPaBHhNusr0INmWaCj1wkM/SlsVPmiUU3QtpScYmNuCgEvYSrVOJ05M8lpLqI11MPnVY X-Received: by 2002:a17:902:9a98:: with SMTP id w24-v6mr12621564plp.9.1527005339054; Tue, 22 May 2018 09:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527005339; cv=none; d=google.com; s=arc-20160816; b=sr+J97Y5zn/bdJSBdrwkRThhs/Jau7AWho0UgP0pnEKgoOFIqMcJX0FHcrimG2pTZP 16cRrk1Fdaq/nsDX15rISW27bQftWScCX2MTRz+z4lJthQseQqhii68QcWzg5vuKYxQ+ Fl2YqpUHfnIG1Wcrplh7HZsSoii4E6Mh/231I+tdOXMHw0DedKkkv60UKzQc1aonm7Jr 17eEQrjpaFBM9I654zcaOx+fdJiCTN+Fu78o1A2Aio3e1nQ4UB4YmZ9H4Q8vX/xqS6XB nx1By5nY0n4wX6MuH7VjdTyU1guboYZE+rhbbIIxYm+8i9DOA48g7wWqIiYuQXvy9XJf PahA== 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:arc-authentication-results; bh=ky37Xq0+M2cFZxSWhl34WkWSiHn21wJRYyjISHCiLPo=; b=Rs1wcdjY/SqRm8ma0GiHgryhtp28DItWHp6E9W3K9tyJVlfqEs/a1uqDywraLFkTll wzuyyZvggphJr33s5dLQSefFcLv2mh08GV6wcdK6JwFbsGzAMwhm+ofqTG7BEOFtgA4k kvqoZHKxVdq4HNyEhM1RNjhIcTiKyqUwZVYPplAe/J3P7nlBz4Or5TQOBBm/I7ihYSaR qj/lOiMfbE2DKg+o4f2PsLVmDjOp8LdO6iA3y8hOX0xnlrS6D6Cp377J2g7U8X+C3iyU vx51czUsgYs/cthgcoaJ29iVo3pItvnYyf1F86HxaH5nvqupHRB6mMHWkChhxSEpQu4A c9xw== 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 h7-v6si13073093pgc.14.2018.05.22.09.08.44; Tue, 22 May 2018 09:08:59 -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 S1752495AbeEVQI0 (ORCPT + 99 others); Tue, 22 May 2018 12:08:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50562 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751412AbeEVQIT (ORCPT ); Tue, 22 May 2018 12:08:19 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4MG4ocj132099 for ; Tue, 22 May 2018 12:08:19 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j4nwj1y6t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 May 2018 12:08:18 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2018 10:08:17 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 22 May 2018 10:08:14 -0600 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4MG8DoA6095248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 May 2018 09:08:13 -0700 Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5359AB209F; Tue, 22 May 2018 13:10:02 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F391B20CE; Tue, 22 May 2018 13:10:02 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 22 May 2018 13:10:02 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 5BE1F16C1293; Tue, 22 May 2018 09:09:49 -0700 (PDT) Date: Tue, 22 May 2018 09:09:49 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , byungchul.park@lge.com, mathieu.desnoyers@efficios.com, Josh Triplett , Lai Jiangshan , linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: Tasks RCU vs Preempt RCU Reply-To: paulmck@linux.vnet.ibm.com References: <20180518183623.GA163151@joelaf.mtv.corp.google.com> <20180519022918.GV3803@linux.vnet.ibm.com> <20180519225905.GB134184@joelaf.mtv.corp.google.com> <20180520004938.GZ3803@linux.vnet.ibm.com> <20180520112843.57079857@grimm.local.home> <20180520191846.GA248075@joelaf.mtv.corp.google.com> <20180521215951.2d6abfcb@gandalf.local.home> <20180522045414.GG40541@joelaf.mtv.corp.google.com> <20180522083832.45353d5f@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522083832.45353d5f@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18052216-0024-0000-0000-000018758532 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009066; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01036075; UDB=6.00529993; IPR=6.00815204; MB=3.00021242; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-22 16:08:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052216-0025-0000-0000-00005019F294 Message-Id: <20180522160949.GU3803@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-22_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805220178 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 08:38:32AM -0400, Steven Rostedt wrote: > On Mon, 21 May 2018 21:54:14 -0700 > Joel Fernandes wrote: > > > > Yes, lets brain storm this if you like. One way I was thinking if we can > > manually check every CPU and see what state its in (usermode, kernel, idle > > etc) using an IPI mechanism. Once all CPUs have been seen to be in usermode, > > or idle atleast once - then we are done. You have probably already thought > > Nope, it has nothing to do with CPUs, it really has to do with tasks. > > CPU0 > ---- > task 1: (pinned to CPU 0) > call func_tracer_trampoline > [on trampoline] > [timer tick, schedule ] > > task 2: (higher priority, also pinned to CPU 0) > goes to user space > [ Runs for along time ] > > We cannot free the trampoline until task 2 releases the CPU and lets > task 1 run again to get off the CPU. What Steven said! IPIs get to CPUs, but we need to handle the (unlikely, but very real) case where a bunch of tasks are preempted within trampolines. > > about this so feel free to say why its not a good idea, but to me there are 3 > > places that a tasks quiescent state is recorded: during the timer tick, > > during task sleep and during rcu_note_voluntary_context_switch in > > cond_resched_rcu_qs. Of these, I feel only the cond_resched_rcu_qs case isn't > > trackable with IPI mechanism which may make the detection a bit slower, but > > tasks-RCU in mainline is slow right now anyway (~ 1 second delay if any task > > was held). > > The way I was originally going to handle this was with a per task > counter, where it can be incremented at certain points via tracepoints. > > Thus my synchronize tasks, would have connected to a bunch of > tracepoints at known quiescent states that would increment the counter, > and then check each task until they all pass a certain point, or are in > a quiescent state (userspace or idle). But this would be doing much of > what RCU does today, and that is why we decided to hook with the RCU > infrastructure. Just for the record, if you guys realy want to take over Tasks RCU, I have no objections. For one thing, I don't anticipate any other use cases for it (famous last words!). But you break it, you buy it! ;-) Thanx, Paul > I have to ask, what's your motivation for getting rid of RCU tasks? > > -- Steve >