Received: by 10.213.65.68 with SMTP id h4csp3749492imn; Tue, 10 Apr 2018 04:13:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48CVsEm/u2pgzWwBC0/0RVb7nt5psWgsPIiyR6AzKBqlP+CnED7EOYj0p35CjoP+yjMcVey X-Received: by 2002:a17:902:566:: with SMTP id 93-v6mr41690926plf.327.1523358785272; Tue, 10 Apr 2018 04:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523358785; cv=none; d=google.com; s=arc-20160816; b=D+qHVITRaSBBs4IJtzA3PU+LbGUCte7bJzfwj+PAgGjckjS76X5BO8mMTiC9G98FJL tJakCdlMp2gCs9VU/NBu5iUh586HRB8EmdlAdFXuPUCXRBnFeGNNcN0MBSWQf0LrfKtY Qyp2nVn7oejoEGreJGFP1dAabOf6nR6x6k84UawbUloNm5h/ckT1vQkUAULwmx/kz4KO IUBussBcBe69H16VQD73PEL5GH4V53KoHiaQTzaIrbj/Q8zuZVTke9DIYPfQFm/Ukhto iJ/oPHzCoGcTpSUL560Xe79XfAnA1lfV+2KkGrWe55SAzaaFqOwHbUeozee1OO9Ryk2D AVAw== 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=c+oyJnDvUGCmBYlhkv4IbMdcih4h+gNrAGEoKvPRLbg=; b=TZdVcrX80BZSIZ55a6/e4DCMxrg0VGznMHAajZWqTdz6kDrTYG9egqwunBoxo4JSHW nIKuhM56yw+gmj6hJ2pejg6pEjgryWYUpjLuX3b1+jLku7NHBGjdqnFv4i1zpQ+PqZzo YuBsPG2t9CGYtQ9PyK5Mu4sP4nq4BHMsEX+mSLQ5k+UQsvGOunXUj1K42N60sLtbcIsX NSgdQ/p4cGrD/PeWexs6gNGQ929zN0zIjTtPGr71Hp5qb7tLdDZ46M+89FKBxuHxRcLU gFH4c1Ys4MaD4Oeu5c2+elVDle8udHSpvpcA8KLKZ5alL20zktlFLTZO252JHgmK5qEf ImJg== 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 q12-v6si2465597plk.559.2018.04.10.04.12.28; Tue, 10 Apr 2018 04:13:05 -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 S1752781AbeDJLGm (ORCPT + 99 others); Tue, 10 Apr 2018 07:06:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751940AbeDJLGj (ORCPT ); Tue, 10 Apr 2018 07:06:39 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 927E8402242D; Tue, 10 Apr 2018 11:06:38 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id D9E066F9E8; Tue, 10 Apr 2018 11:06:33 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 10 Apr 2018 13:06:38 +0200 (CEST) Date: Tue, 10 Apr 2018 13:06:33 +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: <20180410110633.GA29063@redhat.com> References: <20180404083110.18647-1-ravi.bangoria@linux.vnet.ibm.com> <20180404083110.18647-8-ravi.bangoria@linux.vnet.ibm.com> <20180409132928.GA25722@redhat.com> <84c1e60f-8aad-a0ce-59af-4fcb3f77df94@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84c1e60f-8aad-a0ce-59af-4fcb3f77df94@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 11:06:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 11:06:38 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 Hi Ravi, On 04/10, Ravi Bangoria wrote: > > > 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, > > Yes. I should have added checks for failure cases. > Will fix them in v3. And what can you do if it fails? Nothing except report the problem. But signal_pending() is not the unlikely or error condition, it should not cause the tracing errors. Plus mm_take_all_locks() is very heavy... BTW, uprobe_mmap_callback() is called unconditionally. Whatever it does, can we at least move it after the no_uprobe_events() check? Can't we also check MMF_HAS_UPROBES? Either way, I do not feel that mmu_notifier is the right tool... Did you consider the uprobe_clear_state() hook we already have? Oleg.