From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78C77368D5A for ; Tue, 14 Jul 2026 11:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784028463; cv=none; b=o2Zzmw6WUSROgr/hqXDDDnbHm8YylDktoV9iOTcWdfkxJJOgKjoWQgo53+qiu3QEsJgbVrXeH+UWX+BeTw6M2AJJ7kLEJlq8V4V97iUQtNzi/w5hKvAWDZAWrDY5x0KZZFaus+1TmfZib1w1zP5N95HzTC7TDxHjAeIqQA5eQrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784028463; c=relaxed/simple; bh=GS/ISKoJgS5Pga0WL+C+EpljoHDwb5wSWOPEt8c1KdQ=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=KbLf3zsrbq9Qik/I9EeHPLDFrocYUFsDoQiOuIzDK3o8LgUbnyZTGNoDDjYD67V8F95zGN32EfLKe98FIEuNQcCZ/ywcx2pfv/i9ipHPURUrFZSQ19E9ihoJKN+EK5FFi0a3Db5gk/I6OjNJjssDk+9l9ZOsC1LzKnexP00+k0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EGPA7vR3; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=kDkvcL4g; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EGPA7vR3"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="kDkvcL4g" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784028459; 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:autocrypt:autocrypt; bh=mOCeEIDjrJmW55shxej4yEgZqWUxITngxGMI8YJa6sA=; b=EGPA7vR3ZSMado1GJL4MjRyWK9Mw8VMUCS8SeEYothpSMNk96c6D5Cv0TO3YOZXNNVL7iC 8h9kNu06fF7GHL7jky2tSsaZhFcdM8UR6cQ/rd44qWsSYLSpAlp/8ipzPL3Z3qoAnWzClW 86uDEW6OateFdyNKZB4vBW3C4Sj91Eg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-fFAZ62FJPeaQh3ud4paogw-1; Tue, 14 Jul 2026 07:27:38 -0400 X-MC-Unique: fFAZ62FJPeaQh3ud4paogw-1 X-Mimecast-MFC-AGG-ID: fFAZ62FJPeaQh3ud4paogw_1784028457 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-493ae2a6a72so10304275e9.0 for ; Tue, 14 Jul 2026 04:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784028457; x=1784633257; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :autocrypt:references:in-reply-to:date:cc:to:from:subject:message-id :from:to:cc:subject:date:message-id:reply-to:content-type; bh=mOCeEIDjrJmW55shxej4yEgZqWUxITngxGMI8YJa6sA=; b=kDkvcL4guAQ0jtCrWCFUPo00qvmui6zXqXGtX3o7asIhKx4aFE+0QEDGGL6wLOz87T mDwH2KOsTG6HBpsaW0EhAQdVBEE7wONJrScjHeSDmDlhuzLiWHLk9rb/BCxS1yUS9OhZ 7BUk9WIXiFfopR7TzojB+C877MCBnRatJqRS6/WjSALVgcnigxE83nytI3X8/3j28PAu NUR2A7oH4naH1Pq/zo/haLY2Gqj4lDHhaZwjdxbMhhsg+aHX58ylKTQMeQn/ekNI5CRp DTPTzrzRMubTj6Yk/BR190VsDpvpiJnK0dzGRkh6844cSx+bWZXma1mlYP5OfJiwFn/Q HVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784028457; x=1784633257; h=mime-version:user-agent:content-transfer-encoding:content-type :autocrypt:references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=mOCeEIDjrJmW55shxej4yEgZqWUxITngxGMI8YJa6sA=; b=rntRWqrP9jHr8oKzRXJ29IQ0fV+ntkIpGohV5t+/YHU3V7DXJZtmdSOCiUyhoftq6/ SyOttxappue56DsERmzU8c+0r3lEbTDcLDXBljopKC7zg08smH5kQZsEmMFuw3tLMfhI e3DZGRhFvL+v6oUBlIx4W0cYJMByzxXFdiagycrOAbWfpIFBLf5ff9dp25gCaHvxIPu9 PUPi0Z+weX5uOIYXaPp0NENSLh2NAoL2nMHxDKU2wAI+LYpm5iNMkQQ6VOFwT4gHhCey UVoxHVTHzhBXsMi3dsoWeJTf/QbyXoVV6d9jqN5sXd+F2Bw+f1Wk3geRfhH3RlZwBU0h m/rQ== X-Forwarded-Encrypted: i=1; AHgh+Rrd+tXEHEv/y3+JAazEBC3jltOiBjG1C+wFGeKNYYPBlw8F0FgoADmns/WwHM7yOyiemUo3SotpxVb94zA=@vger.kernel.org X-Gm-Message-State: AOJu0YxGr9YPyVcFMIdPAbOhEY//1xyLzdYqzqoENSYXNESMczzgFlo4 mrmOJKh8IiUbNtmilYuLFjuqnn2Q9lelPmbl0I4aaaS5i3EFFDeCG5CeyINBM7DYEfxZ49D1wWG kfe9d96mtos5t+UUDYBGbIe0Y+FfOt7Jwhc7va8ThmEdopOKCa4LlesFnyn5cibFgxg== X-Gm-Gg: AfdE7cnWv4qVjhyoXFC16FxuXWXAXkPvJfOvtgZrkuSM1/sCTSgs9T4ZlaIlbxu882S +Cn4QdPAu0FAd8fROFbmwO8aDVp9EUwxmqiA+QKVgYIP3wYpBi24Bi62Jgnhzfa/ztj2MBwb4Z7 3l9hvcAD4qoYptDtLEJ/rxj+mfXFt4euNv2z1jYimy3RYo5EvmDkWjZJCtnNhuXsqJCCycrHmEn DZNgnOhN/jslp8698UxnG1JKuO0h1Vxi6/uqF0ZpvstGsdZxzfbeiymCbP3iRuQ/wDGqxfm/VT8 UGaFqmLH555jE4pS2TU1iu8t8ZwOqGntqVv6eHEbgPCP0rxzTELe8+VMt3nyFmVwDCH4Od5Ibw+ EuR6mAldVTSKai2A6EKKiOplWMRskzgUgjiNIvQ== X-Received: by 2002:a05:600c:6610:b0:493:ee57:1207 with SMTP id 5b1f17b1804b1-493f87e489amr134511795e9.10.1784028457020; Tue, 14 Jul 2026 04:27:37 -0700 (PDT) X-Received: by 2002:a05:600c:6610:b0:493:ee57:1207 with SMTP id 5b1f17b1804b1-493f87e489amr134511455e9.10.1784028456562; Tue, 14 Jul 2026 04:27:36 -0700 (PDT) Received: from gmonaco-thinkpadt14gen3.rmtit.csb ([195.174.33.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950871cbd6sm80723875e9.3.2026.07.14.04.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 04:27:36 -0700 (PDT) Message-ID: <3ea6ffdd144ce4b38d4a198550afed9516777f85.camel@redhat.com> Subject: Re: [PATCH] rv: Simplify task monitor slot management From: Gabriele Monaco To: liqiang , linux-trace-kernel@vger.kernel.org Cc: rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org Date: Tue, 14 Jul 2026 13:27:34 +0200 In-Reply-To: <20260714083315.1371676-1-liqiang01@kylinos.cn> References: <20260714083315.1371676-1-liqiang01@kylinos.cn> Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0BrZXJuZWwub3JnPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmjKX2MCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfIQuAD+JulczTN6l7oJjyroySU55Fbjdvo52xiYYlMjPG7dCTsBAMFI7dSL5zg98I+8 cXY1J7kyNsY6/dcipqBM4RMaxXsOtCRHYWJyaWVsZSBNb25hY28gPGdtb25hY29AcmVkaGF0LmNvb T6InAQTFgoARAIbAwUJBaOagAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBMrKEfgLgd0WcK eo9u9KbElYeE3yBQJoymCyAhkBAAoJEO9KbElYeE3yjX4BAJ/ETNnlHn8OjZPT77xGmal9kbT1bC1 7DfrYVISWV2Y1AP9HdAMhWNAvtCtN2S1beYjNybuK6IzWYcFfeOV+OBWRDQ== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-1.fc44) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2026-07-14 at 16:33 +0800, liqiang wrote: > The slot array already tracks allocation and task_monitor_count > duplicates that state. On an invalid second release, the old code > warns but still decrements the counter, corrupting later allocations. >=20 > Use the slot array as the sole source of truth. Return after warning > about an unused slot, and return -EBUSY when no slot is free. >=20 > Signed-off-by: liqiang Thanks for the patch! It looks good to me: Reviewed-by: Gabriele Monaco However, your signoff should include a "known identity" [1]. For most peopl= e this is an official name and surname (Li Qiang ?). You could probably just reply with the new signoff, but it's probably bette= r you send a V2 with it updated. Feel free to also include my review tag. I suggest you configure git accordingly e.g.: git config set user.name "Name Surname" git commit --amend --reset-author --signoff # will open an editor from there remove the old signoff and add the revie= w tag Thanks, Gabriele [1] - https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign= -your-work-the-developer-s-certificate-of-origin > --- > =C2=A0kernel/trace/rv/rv.c | 18 +++++------------- > =C2=A01 file changed, 5 insertions(+), 13 deletions(-) >=20 > diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c > index ee4e68102f17..187d87d5991c 100644 > --- a/kernel/trace/rv/rv.c > +++ b/kernel/trace/rv/rv.c > @@ -164,7 +164,6 @@ struct dentry *get_monitors_root(void) > =C2=A0 */ > =C2=A0LIST_HEAD(rv_monitors_list); > =C2=A0 > -static int task_monitor_count; > =C2=A0static bool task_monitor_slots[CONFIG_RV_PER_TASK_MONITORS]; > =C2=A0 > =C2=A0int rv_get_task_monitor_slot(void) > @@ -173,21 +172,14 @@ int rv_get_task_monitor_slot(void) > =C2=A0 > =C2=A0 lockdep_assert_held(&rv_interface_lock); > =C2=A0 > - if (task_monitor_count =3D=3D CONFIG_RV_PER_TASK_MONITORS) > - return -EBUSY; > - > - task_monitor_count++; > - > =C2=A0 for (i =3D 0; i < CONFIG_RV_PER_TASK_MONITORS; i++) { > - if (task_monitor_slots[i] =3D=3D false) { > + if (!task_monitor_slots[i]) { > =C2=A0 task_monitor_slots[i] =3D true; > =C2=A0 return i; > =C2=A0 } > =C2=A0 } > =C2=A0 > - WARN_ONCE(1, "RV task_monitor_count and slots are out of sync\n"); > - > - return -EINVAL; > + return -EBUSY; > =C2=A0} > =C2=A0 > =C2=A0void rv_put_task_monitor_slot(int slot) > @@ -199,10 +191,10 @@ void rv_put_task_monitor_slot(int slot) > =C2=A0 return; > =C2=A0 } > =C2=A0 > - WARN_ONCE(!task_monitor_slots[slot], "RV releasing unused > task_monitor_slots: %d\n", > - =C2=A0 slot); > + if (WARN_ONCE(!task_monitor_slots[slot], > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "RV releasing unused task monitor slot:= %d\n", slot)) > + return; > =C2=A0 > - task_monitor_count--; > =C2=A0 task_monitor_slots[slot] =3D false; > =C2=A0} > =C2=A0