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 8D089CA0ED3 for ; Mon, 2 Sep 2024 09:14:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24A7F8D00AF; Mon, 2 Sep 2024 05:14:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F9BA8D0098; Mon, 2 Sep 2024 05:14:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09B2E8D00AF; Mon, 2 Sep 2024 05:14:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DEDC78D0098 for ; Mon, 2 Sep 2024 05:14:47 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 55BE8C1A3E for ; Mon, 2 Sep 2024 09:14:47 +0000 (UTC) X-FDA: 82519238214.08.ACC7D64 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf21.hostedemail.com (Postfix) with ESMTP id 5E7221C001D for ; Mon, 2 Sep 2024 09:14:45 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="VJ/fffYO"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of olsajiri@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=olsajiri@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725268416; a=rsa-sha256; cv=none; b=F+4iPbeyS/Dv6Tn+u+FstVh6rRc2zbQOalFdYQ7hXMsHFo3Y3y2HQbyqUi/+GW/w04R/26 rpYy1Lh3pJeTlkXI2x322mOA5NPWG7urQHnnDt6m8WHnqHq6Zs7SbYKQxLnLSuRFaejG+n UJh0JtxTWtGt6bEAuuGxCOy9AUd3Jgc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="VJ/fffYO"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of olsajiri@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=olsajiri@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725268416; 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=UodyzbJSkk+eMFXI+6sMbq8FsUp3GNOPoUxWd/Q/ST0=; b=4GLhw2ZSkG7JIeuei5zJGeKpXZgJaFEeLyWD2Aaz/YWI6qIZ4QgSp0KY2/3q+CvT79BkXA EjoeCejaXKZqVyiEk3m3dQXpDQqe/O+IeQoVHLHDCyzI0fliQHhUOot9w2SFVmKQGeEmLE mctZOwLPdHl8hi4o711uwE2Iuxost1A= Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-534366c1aa2so4123765e87.1 for ; Mon, 02 Sep 2024 02:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725268484; x=1725873284; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=UodyzbJSkk+eMFXI+6sMbq8FsUp3GNOPoUxWd/Q/ST0=; b=VJ/fffYO5oaUBkDIJvc0k2HBrrmMebWm/zB6HtPuQIDDwp0uVZ1eIYcnS676dAgwCf qog2mn62PrBnSFvKkK43rXZyE2NC6awGlKtYW4E4tVATdBC/duL9xkoLgIXhlzhX4+Om p1uat7WPD93rV3xMRhT3n2SRTeJrwLDK8li3w5b9yJIPLeoSYjv0yHf2DBA8TRJkxKi1 0g/in5KCtyjeu12sKTQpR/DhiTc+HO7+bdYLn1lsuW7cOMHkr2cyQhVn69rSsWSgdtft yloy389RwJdCbLJSBNe4UeYRoIwzsSwh2gS4QfYG2eHaFeuq0ZoY+7ouDsTgxGXByo1M hqtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725268484; x=1725873284; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UodyzbJSkk+eMFXI+6sMbq8FsUp3GNOPoUxWd/Q/ST0=; b=SbPWGSPwDg3+od68hxyBS0un6DcG0M0T3S6jvNaPr2P6sWVlIn0SQK2VRLB8S6Y+UR SjETOPo9MVvtySgjhoPi94CyIKsIcZUUB/8MKNhR6XhY8kkCpL5z3Wbc3PkxTIZOgrgR EZy5O5TZQOiHy+oYra0kyCydAo21Vds9tJdyDKdz0okGyX0GNT33FHUv9KRt0SgJyKcj xIqPwza57pd3TIkyBBTxR+Ka2cPF7ibY6yT2uUXc89zVCoBE1Re5PR9pX1zWFwx/C0eZ iHoxP3SbgYsXBZPuzCCnnE3CkljLI2Anos/bZhJ0uy9kIE7dWE6bJVDA8WQuPvkzI8cq UyfA== X-Forwarded-Encrypted: i=1; AJvYcCUAJHti1J2R/87IjamF5JqPMzGcYtX5FHpSqLAYXgBwr8SpQG8J07JqPsBjXc8Z4hdqTEZBVUL7UA==@kvack.org X-Gm-Message-State: AOJu0YxMWnVUDzENDCXh3uMUD5YGrOYcY++a4HnNOqpFpDXldvMVqITm D6vC638WL81ms+ZggDIFwKfCbR/6w/rUP3onkKUrGSSikHH988tI X-Google-Smtp-Source: AGHT+IHHzCk0o+jT01bGivLrYPPEh1XQtuTW35W/Wg/8G3+LkmILao43mPxxrvxmkMCVfvz99UQ4pA== X-Received: by 2002:a05:6512:b20:b0:52e:9d60:7b4c with SMTP id 2adb3069b0e04-53546bbea37mr5568298e87.61.1725268483169; Mon, 02 Sep 2024 02:14:43 -0700 (PDT) Received: from krava ([87.202.122.118]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e33e2asm131076895e9.45.2024.09.02.02.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 02:14:42 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Mon, 2 Sep 2024 12:14:40 +0300 To: Oleg Nesterov Cc: Andrii Nakryiko , 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: References: <20240829183741.3331213-1-andrii@kernel.org> <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: <20240831161914.GA9683@redhat.com> X-Rspamd-Queue-Id: 5E7221C001D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: dekgdp8ygpzoanj4id8ebgmeaxcs6t45 X-HE-Tag: 1725268485-620298 X-HE-Meta: U2FsdGVkX1/c0lFeAI2ee0UWrr04Z7iwN+gC7m9lo4DBrDmcqMYLLS4WOq7d01DNwenKFuYEIKow7l0DZmBi4aqomL0XZuiZd+Iu7LARac9hq9r+/S2HBZgwOjUyorOEJMkGQvVNcjaWQS4+FerFWy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58S1yKJXEQGeoHglYVjNZWdJHIyJ0Pg77u19pz5o3jApt/ItPGtloaf5stWhbSUipkE7chiKU1+zQVajzuUDkO4LzfLKjOvHFDUiBlAsIgbTCJZpu7Ughkl4pUkSSMjlkoZ7C/Z8NdF9rCugRHr0hEGL3FGHnf+Wtx6iDa64tM9lzV8+r/NDIMyKChfrtGbFqCgB/vssiwbLKCnWUGQwlNBjSm1O5zU0dtqN9IcO0GHiskjKQfgfjXWpl+kY6YYDxHmJChpX3JEjlp+yXyfUtQg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 Sat, Aug 31, 2024 at 06:19:15PM +0200, Oleg Nesterov wrote: > On 08/30, Andrii Nakryiko wrote: > > > > On Fri, Aug 30, 2024 at 1:21 PM Oleg Nesterov wrote: > > > > > > I'll probably write another email (too late for me today), but I agree > > > that "avoid register_rwsem in handler_chain" is obviously a good goal, > > > lets discuss the possible cleanups or even fixlets later, when this > > > series is already applied. > > > > > > > Sounds good. It seems like I'll need another revision due to missing > > include, so if there is any reasonably straightforward clean up we > > should do, I can just incorporate that into my series. > > 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. > > But see below, > > > I still think it's fine, tbh. > > and perhaps you are right, > > > Which uprobe user violates this contract > > in the kernel? > > The only in-kernel user of UPROBE_HANDLER_REMOVE is perf, and it is fine. > > But there are out-of-tree users, say systemtap, I have no idea if this > change can affect them. > > And in general, this change makes the API less "flexible". > > 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. FWIW I (strongly) agree with merging this change and fixing the rest as follow up thanks, jirka > > But. Since you are going to send another version, may I ask you to add a > note into the changelog to explain that this patch assumes (and enforces) > the rule about handler/filter consistency? > > Oleg. >