From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755797Ab1HWTUy (ORCPT ); Tue, 23 Aug 2011 15:20:54 -0400 Received: from smtp-out.google.com ([216.239.44.51]:9029 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755379Ab1HWTUr (ORCPT ); Tue, 23 Aug 2011 15:20:47 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:in-reply-to:references:from:date: message-id:subject:to:cc:content-type:x-system-of-record; b=XNoj+2TDwZ3wW0bEI2skau7gsyKVAyA80M2O33H3cyNt2jYPBxzDWh8bP9x8KhKzb kUICkHCYbUyYOMmxd54Cg== MIME-Version: 1.0 In-Reply-To: References: <1313531179-9323-5-git-send-email-vnagarnaik@google.com> <1314125758-5069-1-git-send-email-vnagarnaik@google.com> From: Vaibhav Nagarnaik Date: Tue, 23 Aug 2011 12:20:14 -0700 Message-ID: Subject: Re: [PATCH v3 4/5] trace: Make removal of ring buffer pages atomic To: David Sharp Cc: Steven Rostedt , Ingo Molnar , Frederic Weisbecker , Michael Rubin , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2011 at 12:16 PM, David Sharp wrote: > On Tue, Aug 23, 2011 at 11:55 AM, Vaibhav Nagarnaik > wrote: >> This patch adds the capability to remove pages from a ring buffer >> without destroying any existing data in it. >> >> This is done by removing the pages after the tail page. This makes sure >> that first all the empty pages in the ring buffer are removed. If the >> head page is one in the list of pages to be removed, then the page after >> the removed ones is made the head page. This removes the oldest data >> from the ring buffer and keeps the latest data around to be read. >> >> To do this in a non-racey manner, tracing is stopped for a very short >> time while the pages to be removed are identified and unlinked from the >> ring buffer. The pages are freed after the tracing is restarted to >> minimize the time needed to stop tracing. >> >> The context in which the pages from the per-cpu ring buffer are removed >> runs on the respective CPU. This minimizes the events not traced to only >> NMI trace contexts. > > "interrupt contexts". We're not disabling interrupts. > Since the reader_lock is held using spin_lock_irq(), there won't be IRQs coming in, only the NMIs. Vaibhav Nagarnaik