Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp23571imu; Thu, 6 Dec 2018 18:21:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/U7JMAi5ryS7PWI6nJnf7mnpwFsDpJs3BQU8RfbESRGl+rwFnykizS7yqE/FHvPigHUgzWW X-Received: by 2002:a63:7a5b:: with SMTP id j27mr394204pgn.112.1544149283158; Thu, 06 Dec 2018 18:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544149283; cv=none; d=google.com; s=arc-20160816; b=F9P4Z7rdyG3PSd7PHZLAE+5ZeLoqvdEt4srpQhNj7pEdm6yB/Hh6LhDYvvKdleUAaJ +P4r8ux/1sPunZAd2SEgE52RqsgP8lQkstSamt/pHFJlBdRCV5A1UMgljvfB5z7ti/N6 RWlT0pffzDgXAid0WE0JkLFXWuR+S5TnMokhG/0a2YiHutgCzT0Navizl8bGcYVoN8bI 5BiQlvVc3uQz/YJrJ5R1jdrMDWMSRsSK8eLGIIz07jWcYOAEkZ88BADU2WXV9NhWe0iO qxS8Q534zgDYb7uxrjHbea1snnViP+dQumN7TghbpoFzsH4ZMBek6NikU9xDChDXIeBJ CjYQ== 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 :dkim-signature; bh=HpfaR8GaOnr69/Vb7Bnlp3HKm3GxSN1mVGvDjpiq9x0=; b=jwoyXZIIfwvEnoDBgj3XNEh98jicXtuY2teOpWBcCW5hn0reL8c0mTF8he8d1VyqPw FYzOJ1SjIMzxn5R2UaZn9pcY5cR32r+Gc6YxnLUvEl1XwSW0BuQL2n+cd9lcTv7a0KqC Pe/PgGkyW0rNCMTVpCDk0cDDy48nVo9Dkc3QicxcI0neTuk/jrPBTl0hG1TvdXnLLbjM VLPBuLeXvrmhKc1VGKQ8mRTwh4TByjAAdcXrCD+baQxDnN4iGiurbXrKBE6lZBxg2zIM ls7y43UXP2G7lNSUNMDK7BweVzq72ZRkWATrWbUqwHqCPi18Bfb7BQOXqxm7JnQYeTgr SZKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VUBg8pL3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si1765446pla.20.2018.12.06.18.21.04; Thu, 06 Dec 2018 18:21:23 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=VUBg8pL3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725987AbeLGCUA (ORCPT + 99 others); Thu, 6 Dec 2018 21:20:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:57512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeLGCUA (ORCPT ); Thu, 6 Dec 2018 21:20:00 -0500 Received: from devnote (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2290020659; Fri, 7 Dec 2018 02:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544149200; bh=fvuvgh6qsiQiaM3aPqZPIsSGap6K6+PEn2229Ovp0rE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VUBg8pL3uNp2rocbCocVUa/OyRgoZZ9uEMTZoEi7N4pOKqoDkqkhoTxZWbSoccQ8r XT6KqRF70k1isdfLoNvBettdENR8GduxEXPGhEozXku6WbAEW6ha7pLXLCXL2KnAvV CuL/0BfkhK/8N0dTEb+IOUekMdH63IO16xbsN788= Date: Fri, 7 Dec 2018 11:19:57 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Tom Zanussi , Ravi Bangoria Subject: Re: [PATCH v2 01/12] tracing/uprobes: Add busy check when cleanup all uprobes Message-Id: <20181207111957.b3889ecdca0e0b296c18787d@kernel.org> In-Reply-To: <20181204124333.00f4c5ee@vmware.local.home> References: <154140838606.17322.15294184388075458777.stgit@devbox> <154140841557.17322.12653952888762532401.stgit@devbox> <20181204124333.00f4c5ee@vmware.local.home> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; 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 On Tue, 4 Dec 2018 12:43:33 -0500 Steven Rostedt wrote: > On Mon, 5 Nov 2018 18:00:15 +0900 > Masami Hiramatsu wrote: > > > Add a busy check loop in cleanup_all_probes() before > > trying to remove all events in uprobe_events as same as > > kprobe_events does. > > > > Without this change, writing null to uprobe_events will > > try to remove events but if one of them is enabled, it > > stopped there but some of events are already cleared. > > > > With this change, writing null to uprobe_events make > > sure all events are not enabled before removing events. > > So, it clears all events, or return an error (-EBUSY) > > with keeping all events. > > > > Hmm, should this patch be marked as stable? Hmm, OK, let this go to stable. Since anyway, this will cause a wired result on uprobe_events from user point of view. Thank you! > > -- Steve > > > Signed-off-by: Masami Hiramatsu > > --- > > kernel/trace/trace_uprobe.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c > > index 31ea48eceda1..b708e4ff7ea7 100644 > > --- a/kernel/trace/trace_uprobe.c > > +++ b/kernel/trace/trace_uprobe.c > > @@ -587,12 +587,19 @@ static int cleanup_all_probes(void) > > int ret = 0; > > > > mutex_lock(&uprobe_lock); > > + /* Ensure no probe is in use. */ > > + list_for_each_entry(tu, &uprobe_list, list) > > + if (trace_probe_is_enabled(&tu->tp)) { > > + ret = -EBUSY; > > + goto end; > > + } > > while (!list_empty(&uprobe_list)) { > > tu = list_entry(uprobe_list.next, struct trace_uprobe, list); > > ret = unregister_trace_uprobe(tu); > > if (ret) > > break; > > } > > +end: > > mutex_unlock(&uprobe_lock); > > return ret; > > } > -- Masami Hiramatsu