Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6692431imm; Sun, 20 May 2018 08:36:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqSMrotknJO3M3rTDJzc75pOd4FCZe629KzhY1HL9j1BbZK0U9XyQoCO6Mp647EOzhjE01O X-Received: by 2002:a63:93:: with SMTP id 141-v6mr13475908pga.322.1526830566743; Sun, 20 May 2018 08:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526830566; cv=none; d=google.com; s=arc-20160816; b=eRdfAkwczspl52g5DuX4o5+8i+n0a/yOA9JJ7UgvRZN6A1845mqqnKfftTPOTwazgC SkRuTH9beNLfdQW3pGq7MCO71TTC5qbNBUQlpRd6DrBbFrtoBksgUadYB3B0H1lTp1+9 TYhrDe+NqkeCRC/ZwiZRX/kJ57wSJB0AvBj2mZ4V3FU9wnoSRxmIoKWWuZefFrE0Epdg JjHhmQ5Jldj7Rbefj0MyXZyDUeSMwzRrVb7CIesNRiOlD28K6o+caI+rhCA4fH+H0mfm rOEJ2nfz1Fyt9RHV3GL2Gz3Ho8NIRzLhs5g2JoNeVDh2SDQC67fdKUFCOWuBJaWBZYnM +v2Q== 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 :arc-authentication-results; bh=S5EYalsMAWzMSDTVCNOEbOKfzvNh7FgEA5okmgGL1PI=; b=nhK1XO/EaahAAP+DEmeJw3phh8iPrgv8YjYtd3QhmNZXsrEDa4CtIgdaCOsvU/ybjW DCwGm13F8uJcK/h92BOSO1rtajtMP5Ug9cA/C+QE3saEHacf8Dfn5Qb6rbzAvuyUhYS7 kXxJO/V3c1XAKn13huX7tLWfmEXXS8jOJBoyPOB20KweYKU49bfu/PxdGpdK0NUdcRTc 08nImoxzw2e4iwnUgBBMiSk7EzRf6sEaMIpSW1eI2L5i262LquSlt1dKCkd/aSzOsHWO tfem6Wqb2zaEBAF3iE+hYrU8eNqGhOt1tP25HLiYecQedNdtf1GLNVyHZtVNmon8KTdO GCaQ== 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 z3-v6si9545105pgp.132.2018.05.20.08.35.39; Sun, 20 May 2018 08:36:06 -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 S1751639AbeETPf2 (ORCPT + 99 others); Sun, 20 May 2018 11:35:28 -0400 Received: from smtprelay0120.hostedemail.com ([216.40.44.120]:34138 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751348AbeETPf1 (ORCPT ); Sun, 20 May 2018 11:35:27 -0400 X-Greylist: delayed 389 seconds by postgrey-1.27 at vger.kernel.org; Sun, 20 May 2018 11:35:27 EDT Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave06.hostedemail.com (Postfix) with ESMTP id C3224800B211 for ; Sun, 20 May 2018 15:28:58 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 0EE806103; Sun, 20 May 2018 15:28:58 +0000 (UTC) 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:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3871:3872:3874:4385:5007:6261:7875:7901:7903:8660:8957:9040:10004:10394:10400:10848:10967:11026:11232:11658:11914:12296:12740:12760:12895:13069:13148:13161:13190:13229:13230:13311:13357:13439:13972:14181:14659:14721:21080:21324:21433:21627:30012:30054:30090:30091,0,RBL:172.56.27.111:@goodmis.org:.lbl8.mailshell.net-62.14.0.190 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none X-HE-Tag: angle90_13df00abf0661 X-Filterd-Recvd-Size: 2710 Received: from grimm.local.home (unknown [172.56.27.111]) (Authenticated sender: rostedt@goodmis.org) by omf03.hostedemail.com (Postfix) with ESMTPA; Sun, 20 May 2018 15:28:56 +0000 (UTC) Date: Sun, 20 May 2018 11:28:43 -0400 From: Steven Rostedt To: "Paul E. McKenney" 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 Message-ID: <20180520112843.57079857@grimm.local.home> In-Reply-To: <20180520004938.GZ3803@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> X-Mailer: Claws Mail 3.14.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 [ Steve interrupts his time off ] On Sat, 19 May 2018 17:49:38 -0700 "Paul E. McKenney" wrote: > I suggested to Steven that the rcu_read_lock() and rcu_read_unlock() might > be outside of the trampoline, but this turned out to be infeasible. Not > that I remember why! ;-) Because the trampoline itself is what needs to be freed. The trampoline is what mcount/fentry or an optimized kprobe jumps to. : nop [ enable function tracing ] : call func_tramp --> set up stack call function_tracer() pop stack ret ^^^^^ This is the trampoline There's no way to know when a task will be on the trampoline or not. The trampoline is allocated, and we need RCU_tasks to know when we can free it. The only way to make a "wrapper" is to modify more of the code text to do whatever before calling the trampoline, which is impractical. The allocated trampolines were added as an optimization, where two registered callback functions from ftrace that are attached to two different functions don't call the same trampoline which would have to do a loop and a hash lookup to know what callback to call per function. If a callback is the only one attached to a specific function, then a trampoline is allocated and will call that callback directly, keeping the overhead down. There is no feasible way to know when a task is on a trampoline without adding overhead that negates the speed up we receive by making individual trampolines to begin with. -- Steve [ Steve resumes his time off ]