From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412Ab3KAPJw (ORCPT ); Fri, 1 Nov 2013 11:09:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13955 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732Ab3KAPJv (ORCPT ); Fri, 1 Nov 2013 11:09:51 -0400 Date: Fri, 1 Nov 2013 16:09:10 +0100 From: Oleg Nesterov To: Namhyung Kim Cc: Steven Rostedt , Namhyung Kim , Masami Hiramatsu , Hyeoncheol Lee , Hemant Kumar , LKML , Srikar Dronamraju , "zhangwei(Jovi)" , Arnaldo Carvalho de Melo Subject: Re: [PATCH 10/13] tracing/uprobes: Fetch args before reserving a ring buffer Message-ID: <20131101150910.GA18278@redhat.com> References: <1383029621-7384-1-git-send-email-namhyung@kernel.org> <1383029621-7384-11-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1383029621-7384-11-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Namhyung, Sorry if this was already discussed. But I can't really understand the idea of this per-cpu buffer... On 10/29, Namhyung Kim wrote: > > Fetching from user space should be done in a non-atomic context. So > use a per-cpu buffer and copy its content to the ring buffer > atomically. Note that we can migrate during accessing user memory > thus use a per-cpu mutex to protect concurrent accesses. And if the task migrates or just sleeps in page fault, another task which hits another uprobe on the same CPU should wait. Why we can't simply add trace_uprobe->buffer instead? Only to save some memory? But every uprobe is very expensive in this sense anyway. Oleg.