Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1117842pxb; Thu, 4 Feb 2021 05:40:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwhUltL6jAumMWD63NYleV/JEsiyLN6agWY3Wn0K0Lxecpbn7Bo3U5nW17f/ZRzA/ckja3 X-Received: by 2002:aa7:da92:: with SMTP id q18mr5705940eds.91.1612446032304; Thu, 04 Feb 2021 05:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612446032; cv=none; d=google.com; s=arc-20160816; b=sYr6QuWw00DOxsGnm9lBTRgw8ZqUfR0UDm7o0Z8/ROuKlvKBnB1nl2kKpxgNGKIett xsLXm1dbx4R9/AgfekG7Z3J0MngOEF6L1z90Eqh3zfocgkH7avNJmTHk8t8GT0GPR70w 8+N2Mhni9daBFHS1zEr7LOJAzxnGyt/8u7vL2Niki2Kv7t6fQKUFUidmD2aTMOax97j9 0Hj0ls9N2cfkJb/IMLqVBqqs7uxqUTDXHLeht8GuolFCHc6ujgFNPq/tSGnJmQTvZe7Z AQpGaIOjyim5oUrNMaeE6YJTBkehu8io1DzUhOaNwb+0oiw8NU32j3ZGLE6QqCWJeUF3 ZsJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uKZ8jOVXaGHt37s8mgAlb0QZlKKHVkfqK1l6zjxD0zE=; b=MEGvINQgIiSKkOJ79Hk6swxTAz+iA1vsH6WPARRj0FZk2pP0iELSmy//ZozwvpWY6/ mp6qWFSEv8D1fJUO6DZR2ZwT8g8H/EDnb/wJ9JiPa4Z1XJ840ZehC9dd1S+2Q55ffhqP vOu+AHC78CZD1T3kefLoMi1NSKtaW3PJoczvtw3rWSlBnlat3LwqabH8/YPMD3n8NCsu /326nvz++JaJxbEdlyViILXbLLJztbQPZNbaKitDHlp5h/EHuzIZPxz8mH5QuLJbrX11 3cjAK2KeKU2UeIs+QJ/vKywPpSPFguyf0EUmUmdDvmm2hLMCxFCgVcFeAIx5M2QNP8X/ oFsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Tp7+xVOk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp21si3082321ejc.108.2021.02.04.05.40.06; Thu, 04 Feb 2021 05:40:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Tp7+xVOk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236359AbhBDNgk (ORCPT + 99 others); Thu, 4 Feb 2021 08:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236260AbhBDNga (ORCPT ); Thu, 4 Feb 2021 08:36:30 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8A8EC0613D6 for ; Thu, 4 Feb 2021 05:35:48 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id e15so2307825qte.9 for ; Thu, 04 Feb 2021 05:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uKZ8jOVXaGHt37s8mgAlb0QZlKKHVkfqK1l6zjxD0zE=; b=Tp7+xVOkN7692sIbinqdK5pKIdTxjFRvN5TBKktfYa/OcV8vZXujRgWJpUprEotTvk Ywh0AWOTjD4pyPJ+9ioiH1ghUScrk9zY3P8/XLs0m3mxDcsm8ke9jnfR/4FBPGv55mB0 lVnq5uOmwKA3KK0SHnu8sJ8Fgyda0ZF51Q24uo2sVgvVu85hjJUgTS2RzscFC9UPjFcU NlPq+b70HxshgqfyALReSbkIuf6mUSFjMjzrxDPnmNo6vhyoEUvOxTz71tfud4eKGHRz dPkA2tmAlG9geJOMKPMyoVO+2bXMfu9Vt+9zIQ+irREt+FOlcIwCAoInuO35O1NrKsrr B6RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uKZ8jOVXaGHt37s8mgAlb0QZlKKHVkfqK1l6zjxD0zE=; b=bnRwDN4Lggm+ru6M3VvWt9J0kjTIwfTCzmyUG/QZqLMY0XWmOjwcoVW2pWH4rzd+Ap Jl2MiTJo84raawRokgzA0y+DrvWiY9tBk8yDkZq/5CQL7Lzli71i1Hy/qT/LOMqWHpdN 56Jvk4rJ4u4CC7aKRkF1TYJIUpDRb6u5XA8zjP1nni7M5D3r80ypF+oeT/5r46h9p+1I sHhoHqGyhYB6B7YvkyVwRyB2UWFQHsKBSUlwcU0XAFDa58fiXSDAP80x/16nRFQD3vMl xMzi0qb6G6PuXK0tIC/fM3IPnhEuJXTyueMgcSa6fTIWHqMf0Vj52gqOFj/WubIzyary pq0w== X-Gm-Message-State: AOAM530QG/kg2zKno89HMT1XI11BjXeFtbjxnnn4dv3+fEudvhHcAerU GffcStE6xriOJL2NnPUpDwfX2JCqHjtupIeyDuy89Q== X-Received: by 2002:a05:622a:c9:: with SMTP id p9mr6885875qtw.337.1612445747619; Thu, 04 Feb 2021 05:35:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dmitry Vyukov Date: Thu, 4 Feb 2021 14:35:36 +0100 Message-ID: Subject: Re: Process-wide watchpoints To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , LKML , Matt Morehouse Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 4, 2021 at 2:10 PM Peter Zijlstra wrote: > > On Thu, Feb 04, 2021 at 01:53:59PM +0100, Dmitry Vyukov wrote: > > Humm... I was thinking of perf_event_open(pid == 0). > > It does not make sense to send SIGTRAP in a remote process, because it > > does not necessarily cooperate with us. > > > > But is there any problem with clone w/o CLONE_THREAD? Assuming the > > current process has setup the signal handler, the child will have the > > same handler and the same code/address space. So delivery of SIGTRAP > > should work the same way in the child. > > Nothing should be doing CLONE_VM without CLONE_THREAD. Yes, it's > possible, but if you do so, you get to keep the pieces IMO. > > Current libc either does a full clone (fork) or pthread_create, > pthread_create does CLONE_THREAD. I meant a different thing. I meant that we could restrict synchronous SIGTRAP for (1) perf_event_open(pid != 0) and (2) disable it after exec. What is the issue here for clone without CLONE_THREAD?