Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031705Ab3HJBlr (ORCPT ); Fri, 9 Aug 2013 21:41:47 -0400 Received: from mail-wg0-f54.google.com ([74.125.82.54]:43008 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030763Ab3HJBlq (ORCPT ); Fri, 9 Aug 2013 21:41:46 -0400 MIME-Version: 1.0 In-Reply-To: References: <1376037909-17797-1-git-send-email-namhyung@kernel.org> <1376037909-17797-11-git-send-email-namhyung@kernel.org> <5204BCE6.2070102@hitachi.com> <20130809162002.GA7144@redhat.com> Date: Sat, 10 Aug 2013 09:41:44 +0800 Message-ID: Subject: Re: [PATCH 10/13] tracing/uprobes: Fetch args before reserving a ring buffer From: "zhangwei(Jovi)" To: Oleg Nesterov Cc: Masami Hiramatsu , Steven Rostedt , Namhyung Kim , Namhyung Kim , Hyeoncheol Lee , LKML , Srikar Dronamraju , "zhangwei(Jovi)" , Arnaldo Carvalho de Melo Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1907 Lines: 53 On Sat, Aug 10, 2013 at 9:26 AM, zhangwei(Jovi) wrote: > On Sat, Aug 10, 2013 at 12:20 AM, Oleg Nesterov wrote: >> >> Sorry, I didn't read this series yet. Not that I think this needs my >> help, but I'll try to do this a later... >> >> On 08/09, Masami Hiramatsu wrote: >> > >> > I just concern using kmalloc() in the event handler. >> >> GFP_KERNEL should be fine for uprobe handler. >> >> However, iirc this conflicts with the patches from Jovi, >> "Support ftrace_event_file base multibuffer" adds rcu_read_lock() >> around uprobe_trace_print(). > > (Sorry about html text rejected by kernel.org, send again with plain text.) > > Then we might need to call kmalloc before rcu_read_lock, also call kfree > after rcu_read_unlock. > > And it's not needed to call kmalloc for each instances in multi-buffer > case, just > kmalloc once is enough. > > I also have same concern about use kmalloc in uprobe handler, use kmalloc > in uprobe handler seems have a little overhead, why not pre-allocate one page > static memory for temp buffer(perhaps trace_uprobe based)? one page size > would be enough for all uprobe args storage, then we don't need to call > kmalloc in that "fast path". > forgotten to say, that pre-allocated buffer would need to be per-cpu, to prevent buffer corruption. It's a memory space vs. performance trade-off problem. :) > > Thanks. >> >> >> Steven, Jovi, what should we do with that patch? It seems that it >> was forgotten. >> >> I can take these patches into my ubprobes branch and then ask Ingo >> to pull. But this will complicate the routing of the new changes >> like this. >> >> Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/