From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbbCXXTe (ORCPT ); Tue, 24 Mar 2015 19:19:34 -0400 Received: from smtprelay0005.hostedemail.com ([216.40.44.5]:45135 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751899AbbCXXTb (ORCPT ); Tue, 24 Mar 2015 19:19:31 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2198:2199:2200:2393:2553:2559:2562:2693:2731:2739:2740:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:5007:6261:7875:7904:8660:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12220:12438:12517:12519:12740:13069:13148:13161:13229:13230:13311:13357:14096:14097:21063:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: sofa98_18ba58a0bef01 X-Filterd-Recvd-Size: 2434 Date: Tue, 24 Mar 2015 19:19:28 -0400 From: Steven Rostedt To: "Suresh E. Warrier" Cc: linux-kernel@vger.kernel.org, Frederic Weisbecker , Ingo Molnar , Paul Mackerras Subject: Re: [PATCH] ring-buffer: More precise time stamps for nested writes Message-ID: <20150324191928.18b9f9f2@gandalf.local.home> In-Reply-To: <5511EECD.90902@linux.vnet.ibm.com> References: <1426827724-22200-1-git-send-email-warrier@linux.vnet.ibm.com> <5511EECD.90902@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; 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 Tue, 24 Mar 2015 18:10:05 -0500 > Although the ring buffer design is coded to avoid disabling > interrupts, in this case there does not appear to be a practical way > to solve this problem without disabling interrupts for a short time. > To accommodate those architectures where disabling interrupts is > expensive, we introduce a new kernel configuration option called > CONFIG_RING_BUFFER_NESTED_WRITE_TIMESTAMP_UPDATE. On architectures > where local_irq_save/restore is cheap, this should be set to Y, > in order to get accurate timestamps. Other architectures can set it > to N to avoid the overhead of local_irq_save/restore at the cost of > getting inaccurate timestamps for nested writes. There is no architecture where disabling interrupts is cheap. Actually, enabling them is the killer. Doing function tracing shows the impact of this rather well, as it would disable and enable interrupts for every function call, which can get rather expensive in the sum of things, and it does skew the timings and can make it more difficult to debug heissenbugs. That said, I feel your pain. I've had some ideas about doing this without disabling interrupts. But for now, what can be done is to have a flag that is set that will implement this or not. Using static_branch() to implement it such that when its off it has no effect. In the mean time, I can go and revisit trying to have better timings with nested writes. -- Steve