Received: by 10.213.65.68 with SMTP id h4csp2622089imn; Mon, 9 Apr 2018 06:33:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+g1WYpQI2IiUjESVLqeR8841g6Y+K6iIaxCsZT7Gnk6Wa4C7edLigNNEh0bO9j+p2N/1/i X-Received: by 2002:a17:902:2805:: with SMTP id e5-v6mr39526474plb.89.1523280796961; Mon, 09 Apr 2018 06:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523280796; cv=none; d=google.com; s=arc-20160816; b=xduoSVYUCyiGFLzu1FA2tdcbC/TU8mWya1BUJXj646VoIl06EZCwxo9Ywg9XJPCSh5 leo65lgZ/MtTAcdeE96mqAoFwDQfMvlTi5vQE3M1FB9ruFnhqZ1zXbGVX/vxNAzg+7g5 rDJ30u2nWYxEdiYZnpJtE7pXSS+v7+Ce42tbukNfC1puBuxdC3ImM8dilOcyyJ3ygrAB /MY0o/8Cfv1MDn8j5fXmV/996j5ToO5iLGtR4B+lwIvYAIUX2bUWht0dPE4cm5qzOG6I 75AiTVIACV9eJChYyE++wgeQSt8fiGUlMrvir2b/NJU3/h28YXXSTmgBdzc/GJr3DoIQ nzxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0IbRz7XhdPOpY7DtJtoFykZf0dXqFms1OrGj/gv/+Aw=; b=omhtL3P1yT925OZNcZCsmuQVy+A6jAyd2W4t/KRqEQDdsqiTERaxdpZowOI5W7ipQb WfMN/7fOVnLj3cOwL24fWIgfu9LWPytqChnvSrJV5PaVu/Llo+U1i+Q70BPZs9IOUjmj aG50aT+9WpR2rbMGJberVG/L97p3wwBxb/AJDA0y2WiCgjeLUUqzWNfdKxHpmG9opAPK iuiDDJTS0oFIcnvxPt341iS+hFWjIT2Dhyw0Bw5EcxIiKskgGDNV/+TQzSkYdDaaHsx+ +1UtLYatk1E8yi7NFchpnSI7hV5MAan6P6IZRBBFefXO6+JqjJSYjnGtb6zTWzyrZkIt cUXg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p86si268427pfi.223.2018.04.09.06.32.39; Mon, 09 Apr 2018 06:33:16 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbeDIN3h (ORCPT + 99 others); Mon, 9 Apr 2018 09:29:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37412 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752127AbeDIN3e (ORCPT ); Mon, 9 Apr 2018 09:29:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03C4340201A1; Mon, 9 Apr 2018 13:29:33 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 4126C111DCF6; Mon, 9 Apr 2018 13:29:29 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 9 Apr 2018 15:29:32 +0200 (CEST) Date: Mon, 9 Apr 2018 15:29:28 +0200 From: Oleg Nesterov To: Ravi Bangoria Cc: mhiramat@kernel.org, peterz@infradead.org, srikar@linux.vnet.ibm.com, rostedt@goodmis.org, acme@kernel.org, ananth@linux.vnet.ibm.com, akpm@linux-foundation.org, alexander.shishkin@linux.intel.com, alexis.berlemont@gmail.com, corbet@lwn.net, dan.j.williams@intel.com, jolsa@redhat.com, kan.liang@intel.com, kjlx@templeofstupid.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, milian.wolff@kdab.com, mingo@redhat.com, namhyung@kernel.org, naveen.n.rao@linux.vnet.ibm.com, pc@us.ibm.com, tglx@linutronix.de, yao.jin@linux.intel.com, fengguang.wu@intel.com, jglisse@redhat.com Subject: Re: [PATCH v2 7/9] trace_uprobe/sdt: Fix multiple update of same reference counter Message-ID: <20180409132928.GA25722@redhat.com> References: <20180404083110.18647-1-ravi.bangoria@linux.vnet.ibm.com> <20180404083110.18647-8-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404083110.18647-8-ravi.bangoria@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 09 Apr 2018 13:29:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 09 Apr 2018 13:29:33 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'oleg@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04, Ravi Bangoria wrote: > > +static void sdt_add_mm_list(struct trace_uprobe *tu, struct mm_struct *mm) > +{ > + struct mmu_notifier *mn; > + struct sdt_mm_list *sml = kzalloc(sizeof(*sml), GFP_KERNEL); > + > + if (!sml) > + return; > + sml->mm = mm; > + list_add(&(sml->list), &(tu->sml.list)); > + > + /* Register mmu_notifier for this mm. */ > + mn = kzalloc(sizeof(*mn), GFP_KERNEL); > + if (!mn) > + return; > + > + mn->ops = &sdt_mmu_notifier_ops; > + __mmu_notifier_register(mn, mm); > +} and what if __mmu_notifier_register() fails simply because signal_pending() == T? see mm_take_all_locks(). at first glance this all look suspicious and sub-optimal, but let me repeat that I didn't read this version yet. Oleg.