Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp545450lqr; Wed, 5 Jun 2024 13:32:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmDJW2ImvBFA1y7rCaAYJxgmVuxq1ul/GaQ8VbOuhQFJJkg/u/qevGkPJiI7IpHPdDsVoWmEceune0AhL1Rz5TH8H7e76dMqBinlAxfA== X-Google-Smtp-Source: AGHT+IF5OFlBPg/g5cNwc2O+e6c+w2yxjQ3LSzjT+tTlu8RtnWRmszGQjwUM/vgiIM4aO2wOc/1i X-Received: by 2002:a05:6e02:1787:b0:371:5bb3:7ed5 with SMTP id e9e14a558f8ab-374b1ee21e4mr39058845ab.2.1717619521944; Wed, 05 Jun 2024 13:32:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717619521; cv=pass; d=google.com; s=arc-20160816; b=hE5VLYn2waauwc/4WVpV5u8OZ60+NyDadIpUmLPaDupmwZBl7tVP/ccVM/QIpxN5/D tGoXD52g+RxBjanoakUemw6Mm1wGLG9lK3a2DrPSbVCHNkQcg0HKL6+u6OoMSCYXOrf9 XD++YUHhhUbcF/hgYoc0d/J6e4HxWW+Y4rsFmKpoJ2p9EmnEufOwzT8IKOvK9mvMhJti x2gQNpicjSd00ckp98V6lvJKsOe4sc9uYxPiQNpbOv0Lx5G6Fp13KyazfLGT6ZjJGr1z t4UGkVYPtCCbf5ghX9tVdrtQ8tT7tg53Q8TnEYObwuxM2bfjO+GqzdmRScDyuF20doqg dozA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=J5vnkugAixkdDcw84NSgFaMOrIfdvI8Mx6/AdL+ET3k=; fh=g9/PPza/oGv/ZzV7Cwbxu/p/PEjbF9r73HzazksmFPY=; b=BWnPtBE/3kinsS4T7WJ3VPsuXoOmtWEatwJdn9r2LBd2Nv8zgtKg4NH0nq4F6b7lLW Jnxe4T8hl4cO69yOek0mZaXSeKmsKPOkXQDBQitaQy/XvgLCPrVMI0wCgGkaRlacKpSH ikAkspYddLYrjCCThG6OnbL88d/r5dcWtTJHqyRSsr9fkuEXxG1PLTeuybmIgb8RHnN2 dmZfjuykHK92HAilLL7weFHhol6WYQPol5Z61+5IFHxV0iTNjJr9kHFNS64FYCJ1DGUs knC/I3xtIiBxiANm2A0PvKryYw1Xo0jxBKctJ9HEleoA7lF/vEeQmbkLFFoSemKn7h1p 2yYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WkvWpj7R; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203167-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6d49f2b1f96si2890600a12.720.2024.06.05.13.32.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:32:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WkvWpj7R; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203167-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 266F4B22203 for ; Wed, 5 Jun 2024 20:19:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 728D615ECCB; Wed, 5 Jun 2024 20:19:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WkvWpj7R" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B2C038FA6; Wed, 5 Jun 2024 20:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717618741; cv=none; b=qXonMELMIRP6Sh8hU41wViTOw5T52k25T2OXTqmOi1pEYWdYQt5e8EWd+0xBsWMBB3kmBdd3XMuSQ8tnDR3zQyxsaCW9sisfsCjzYGfeWxAydOeb0Qf1j1gbTPqHbEHPn1nM2+R5pQ6sKre+fonVzOYpul2pupX7R9SdPKway5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717618741; c=relaxed/simple; bh=qPNQ2QYoVmcsBrFb8aOxCU0KjrsWi5CgCOSprGNsTUo=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=picvH3cDVdu5I+xPn2MnK0XyqoNyO9vfH+WtbYksddTOuzkXB7RWXjbvO/MkEbC33F0HqxfVhnITfRv/9HfNLFncWwZ0xFBuqGkHvz3k7p2XE+/CIxiWz2pPkfEUcdTk+J5bqxPAlGUdGT5S9OKHGZr8w9DaHo/h8nnxFsAyOHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WkvWpj7R; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a68c8b90c85so30923066b.2; Wed, 05 Jun 2024 13:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717618738; x=1718223538; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=J5vnkugAixkdDcw84NSgFaMOrIfdvI8Mx6/AdL+ET3k=; b=WkvWpj7RfotAwYaX4tPY59Iz/2Tyq4lsiF46em0LbjFVjyQNkstKwxu+58dVwjHkwl b/wakWRo6ziWcWAJr0K1tdOd8fOlCOV2MMKvy9WLVwDLTCyYDXOAfzh01t2Wd2RtdvIq tTHbz3bZ0U4jNEfGxnFWE8UuuZUM3tKSzoFSHEjb5cqhGgbGNE5mJLpPPJUkLmGWh810 BE04nmRewdW7qExkntiQblCtWxcDQYgzDeFonu9RMc7bmj5NXY/APQdYMqgn3spPtcbr CSqKdIlO7CgyNiC1KAguIh81c8Il16fOHQ1HTIKX/sMrlsHFsOXFV50HU1CG+ja1zQLP k5bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717618738; x=1718223538; h=in-reply-to: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=J5vnkugAixkdDcw84NSgFaMOrIfdvI8Mx6/AdL+ET3k=; b=CsC9UxLvrFw/01j1ZJMSPEt0JbjU9I5CRS6JciU70nNKSQYHEDY2mLK7VVoH+hdHkd raLKSA/xp8DKq2D7tZRIgOYJ+il+46nSexWtssR0Aog3jXoI30P29cr9n9y6oNcEzBpl k0sYec810JgoQWhGR1iUl2Vj6s5P50WUBKfPeGljiQLcBy7D9/AVHsNiqKnFgEJo6yLF 50bOK+k190q8QScmUKKOWWHfcRPUxMYPowrI1piyUqGFKApZRrJ6wX+xR2iPBQTwyKYC tGaiZUZYAAwMZtGojjVU8+jPc5bmiZBGmA5BM4PDiJt10Hx/qbFIj4w09aXw2wSHyEkd YqzQ== X-Forwarded-Encrypted: i=1; AJvYcCXTUVG1rbDE+/7TSbFhaHwOYrFpFNR4j3MFZBLMyFCOFwSTt5SVgFWnD/sT68sfqNCdIQK0d3BNOkdvs+BXvuoPhuf8Q9laAUjeMSt/Q91/u2f1ABZLLYwNoxxNcJU4sIFrqeT3gNotdA2pjq/FJuNn62oZ41uuyoApmk7vt5R/IGmGasjg X-Gm-Message-State: AOJu0YxPpo7zFcTbGnDlyyJYnMqn4G6zrXKTbJVuHVzpXPRGefU3XBcL rmxJp7F7Gs3E+anxi3Aphwr2LCZQH5FC1SkCeC4XV3VyQ5hXgsoF X-Received: by 2002:a17:906:591a:b0:a69:2bce:e41e with SMTP id a640c23a62f3a-a699f363807mr262253866b.9.1717618737955; Wed, 05 Jun 2024 13:18:57 -0700 (PDT) Received: from krava ([83.240.63.158]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6900d7f6a3sm534291066b.90.2024.06.05.13.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:18:57 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 5 Jun 2024 22:18:55 +0200 To: Oleg Nesterov Cc: Peter Zijlstra , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer Message-ID: References: <20240604200221.377848-1-jolsa@kernel.org> <20240604200221.377848-2-jolsa@kernel.org> <20240605152457.GD25006@redhat.com> <20240605160117.GE25006@redhat.com> <20240605163624.GG25006@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240605163624.GG25006@redhat.com> On Wed, Jun 05, 2024 at 06:36:25PM +0200, Oleg Nesterov wrote: > On 06/05, Oleg Nesterov wrote: > > > > On 06/05, Oleg Nesterov wrote: > > > > > > > +/* > > > > + * Make sure all the uprobe consumers have only one type of entry > > > > + * callback registered (either handler or handler_session) due to > > > > + * different return value actions. > > > > + */ > > > > +static int consumer_check(struct uprobe_consumer *curr, struct uprobe_consumer *uc) > > > > +{ > > > > + if (!curr) > > > > + return 0; > > > > + if (curr->handler_session || uc->handler_session) > > > > + return -EBUSY; > > > > + return 0; > > > > +} > > > > > > Hmm, I don't understand this code, it doesn't match the comment... > > > > > > The comment says "all the uprobe consumers have only one type" but > > > consumer_check() will always fail if the the 1st or 2nd consumer has > > > ->handler_session != NULL ? > > > > > > Perhaps you meant > > > > > > if (!!curr->handler != !!uc->handler) > > > return -EBUSY; > > > > > > ? > > > > OK, the changelog says > > > > Which means that there can be only single user of a uprobe (inode + > > offset) when session consumer is registered to it. > > > > so the code is correct. But I still think the comment is misleading. > > Cough... perhaps it is correct but I am still confused even we forget about > the comment ;) > > OK, uprobe can have a single consumer with ->handler_session != NULL. I guess > this is because return_instance->data is "global". > > So uprobe can have multiple handler_session == NULL consumers before > handler_session != NULL, but not after ? ah yea it should have done what's in the comment, so it's missing the check for handler.. session handlers are meant to be exclusive thanks, jirka