From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AFF6CD37AB for ; Tue, 3 Sep 2024 18:25:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 323088D01C8; Tue, 3 Sep 2024 14:25:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D26A8D016E; Tue, 3 Sep 2024 14:25:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19A828D01C8; Tue, 3 Sep 2024 14:25:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EE3EF8D016E for ; Tue, 3 Sep 2024 14:25:49 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A7D9316082D for ; Tue, 3 Sep 2024 18:25:49 +0000 (UTC) X-FDA: 82524255618.06.9B9A23D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 33E2B140017 for ; Tue, 3 Sep 2024 18:25:46 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BAxHSOPw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725387877; a=rsa-sha256; cv=none; b=4AGyYPpFDUA7RpK78t076LDLYzM0XWVy+r8FUfAKm+HyrArIeFcdRTbJpsDVfrFb3Tk2oV vCfhpIw+7hVGT9D64PqSzOhhMU1igq4UoeEz1lqcoYSgnVWhJieIXeP3Si/BJd/Z+RsAbx MiLb5IokW0WplhCDIPp3ScmgdsUKj6k= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BAxHSOPw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725387877; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hJS6EaFB6prKGPaSLYwj+YKNJglp4aYVfW5lYICPAgk=; b=f9R2oUpOUsQyHfQvbvJnxo+uBtDNuUAH3JAOYHaWa7vRqteup1rHDcaTK8eILCTBQYP5rr kaG5cV4LRePMwv1vzgvDkYyUoj6xbc6aoNb8hVL4S+rsjmEcMCrht9m9tBYmOvzRLUQcaW lTggrS1oOGsp12qK5sJCH2FUHlHVDsk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725387945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hJS6EaFB6prKGPaSLYwj+YKNJglp4aYVfW5lYICPAgk=; b=BAxHSOPwQLPZXDVacXYR5jjaJ1ki37w3rLW/QLjKNxYCE20fk5zm+lVLvZRhBL2EOVmgQr KUDpefedxWa67Cp+1buc4mk00JC4Hmlzj7fJsQU27st2u0+yhNORqxayS4EapjLAPmUb88 mWyMk61vtejNQJ7AKi5yDYYQxLU1gDk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-OZYe8k1LP0ezeXn8VZ0taw-1; Tue, 03 Sep 2024 14:25:41 -0400 X-MC-Unique: OZYe8k1LP0ezeXn8VZ0taw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CAB919560B4; Tue, 3 Sep 2024 18:25:39 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.38]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 801FE19560AE; Tue, 3 Sep 2024 18:25:34 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 3 Sep 2024 20:25:29 +0200 (CEST) Date: Tue, 3 Sep 2024 20:25:23 +0200 From: Oleg Nesterov To: Andrii Nakryiko Cc: Jiri Olsa , Andrii Nakryiko , linux-trace-kernel@vger.kernel.org, peterz@infradead.org, rostedt@goodmis.org, mhiramat@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, willy@infradead.org, surenb@google.com, akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH v4 4/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection Message-ID: <20240903182523.GH17936@redhat.com> References: <20240829183741.3331213-5-andrii@kernel.org> <20240830143151.GC20163@redhat.com> <20240830202050.GA7440@redhat.com> <20240831161914.GA9683@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Queue-Id: 33E2B140017 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 4z31oi9m9wmwc45bcr66eaiiwoe3uyyg X-HE-Tag: 1725387946-854567 X-HE-Meta: U2FsdGVkX1/Q9zXMIwpmd40kEdTuAkwQkHhsH+oxBbsHDxcGuFn/RhPvBnYIU0z81R9CRXhxLiF1A1YIOsk0pNCiaVAhpcLC7dte4mJE9xEhzVDhAXieoc5BnAPAXfWxv+QrYXiAV1eIDrzY9GZIs5CFiN58UnxAHvPPTZ28tEwaZbBaeuXauVOEMPh42DAZGQiz/tGZuQ+tKGMRONd5GT/3bro7y7ZocmfYNguoU8FPGHQ8eD+nxfdQTx6YNm6QUGzctzgPU8H1n4czzynGugyS6f0VSABR7iOrhtRxbvsXeIxTTNSkDnV9h+/vTxpoAfadPiQXWz1MIaUn+9h5OGnW8B3XzMo6ecwxaASN+lYjLpayl4eUkcwJL4VUeEbDkq9Wu5mLmMaNjed4eqZyOxc2LcQoDyMQRo0lC78uVSggpNbB6HVBviruafvibtucgRoHKYnxGbmoBO1r6fZh7YXO2Dh6Ums+uzJtfS160eJsFBJOLD3k9blc+JBxnJ93Xi20cRzd5FuJTJJw8vkNOrF46CMJvH/bVomhRJyUlbJ+J7UwrCvT7q/rotEDUCg4lJlVx1qtrvRcGnK1N21sfBeVoShnw8Emh7TzdEFA5kdeK3pqAAc3PrXFWNK2jJ81S5KYpGvRKsYBuGxdBDxJ7wniPM8uebU+iMJk3fxprDzaOL8mUahbEJYD83wP+CIt9uNyYVstWvSlttlPMCzzDwEwyZ44SD47C+D2ORhHhAQBVHvCQXADtUQtZiMr8ACBmHoPC7wz8q61BT5mCNw9Lqun9N+fHr+CcWllDfu3bqnnW2deIWtbUvhNS/s0Z9QiJO1TBIFqCgrveL24LvfDfT7RdB4r3CLWva5gDMqcwyeInCQhZQQWx3UZm48H0UvqyOriBWo5WZTJhLsniv+BEBN4p041XEMBkCteTKKiF0JURem24CQ0MBW/WPf3fJFdh0XUqHfgIBaPLxDscWW VQY1hErU 3EjWOdenvFC5NHHnn6i8Fe03Y1bPAO0Bp4No1B/NmjvYNKGF6jD0R0OFo8yHnCrGJoOqKOp8ljGM812eZtJ8kNDxJVMSvb5OuE5HYbVVRecIiweh2xhHSNtXQqrdBOdidj42jodtc3wqsoSyPzqaU3BcnxZrKArorST5FtT5RX5XhIdSgyuuHR6MA0s7e4i0cI4tHx3knfZogSEinOXnYCNt+M/HTxUYb28HkqedZl1f5Njq3hVqpageRjvOnO8AA7hkVRY9IiTkIpuycRQzicBTPP7jxWRP4OJxft9e4AlS+VmlVm7QI+nBbE53k0xysfyAaizlN9kUiRwDxWrKC5ze8O6zBTPpL4XgxfRB89evCI6NhIDbRGXWuRNRaYaTNh7w3InbLIeGVR1Hn/0g23SqJ4kRE0WisVT3u9p52JAY91Pv1+dIrUi4Vbw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 09/03, Andrii Nakryiko wrote: > > On Sat, Aug 31, 2024 at 9:19 AM Oleg Nesterov wrote: > > > > I was thinking about another seq counter incremented in register(), so > > that handler_chain() can detect the race with uprobe_register() and skip > > unapply_uprobe() in this case. This is what Peter did in one of his series. > > Still changes the current behaviour, but not too much. > > We could do that, but then worst case, when we do detect registration > race, what do we do? Do nothing and skip unapply_uprobe(). > But as you said, this all can/should be addressed as a follow up > discussion. Yes, yes, > You mentioned some clean ups you wanted to do, let's > discuss all that as part of that? Yes, sure. And please note that in reply to myself I also mentioned that I am stupid and these cleanups can't help to change/improve this behaviour ;) > > The only in-kernel user of UPROBE_HANDLER_REMOVE is perf, and it is fine. > > > > Well, BPF program can accidentally trigger this as well, but that's a > bug, we should fix it ASAP in the bpf tree. not sure, but... > > And in general, this change makes the API less "flexible". > > it maybe makes a weird and too-flexible case a bit more work to > implement. Because if consumer want to be that flexible, they can > still define filter that will be coordinated between filter() and > handler() implementation. perhaps, but lets discuss this later, on top of your series. > > But once again, I agree that it would be better to apply your series first, > > then add the fixes in (unlikely) case it breaks something. > > Yep, agreed, thanks! Will send a new version ASAP, so we have a common > base to work on top of. Thanks. Hopefully Peter will queue your V5 soon. Oleg.