[{"id":33487,"web_url":"https://patchwork.libcamera.org/comment/33487/","msgid":"<20250226004002.GM18866@pendragon.ideasonboard.com>","date":"2025-02-26T00:40:02","subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn Tue, Feb 25, 2025 at 04:06:12PM +0100, Milan Zamazal wrote:\n> When stopping the proxy thread, all messages of InvokeMessage type\n> posted to the pipeline handler thread are dispatched, to ensure that all\n> signals emitted from the proxy thread and queued for delivery to the\n> proxy are delivered synchronously. This unnecessarily delivers queued\n> signals for other objects in the pipeline handler thread, possibly\n> delaying processing of higher priority events.\n> \n> Improve the implementation by limiting synchronous delivery to messages\n> posted for the proxy.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  .../ipc/generators/libcamera_templates/proxy_functions.tmpl     | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index b5797b14..25476990 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -34,7 +34,7 @@\n>  \tthread_.exit();\n>  \tthread_.wait();\n>  \n> -\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage, this);\n>  \n>  \tstate_ = ProxyStopped;\n>  {%- endmacro -%}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 80A1CBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Feb 2025 00:40:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 92FBC6873D;\n\tWed, 26 Feb 2025 01:40:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 94F0B61852\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Feb 2025 01:40:21 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D2B62502;\n\tWed, 26 Feb 2025 01:38:53 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SQoJBcRU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740530334;\n\tbh=iSwlg/hkFXEOpWvL1pg6P5fSLplGUEUV7uUpRS0CLoQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SQoJBcRUyqnHQfZlSD+T6mBcRMuiz+Y3BvwDkbo5QNeWyeKORluaFkFwBKgK1xmNc\n\tSkOsbCc9ifl1Pm+eBqZN3BElwzDRE2svlvuQxynri35tokD+KcB0kCwshnR2BGqltQ\n\tazwG8sDNsfSxPTiUBWKQLRqMFEoLJLOKSrnl7DlE=","Date":"Wed, 26 Feb 2025 02:40:02 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","Message-ID":"<20250226004002.GM18866@pendragon.ideasonboard.com>","References":"<20250225150614.20195-1-mzamazal@redhat.com>\n\t<20250225150614.20195-7-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250225150614.20195-7-mzamazal@redhat.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33491,"web_url":"https://patchwork.libcamera.org/comment/33491/","msgid":"<Z77IC6qDmznniEd9@pyrite.rasen.tech>","date":"2025-02-26T07:51:39","subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Tue, Feb 25, 2025 at 04:06:12PM +0100, Milan Zamazal wrote:\n> When stopping the proxy thread, all messages of InvokeMessage type\n> posted to the pipeline handler thread are dispatched, to ensure that all\n> signals emitted from the proxy thread and queued for delivery to the\n> proxy are delivered synchronously. This unnecessarily delivers queued\n> signals for other objects in the pipeline handler thread, possibly\n> delaying processing of higher priority events.\n> \n> Improve the implementation by limiting synchronous delivery to messages\n> posted for the proxy.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  .../ipc/generators/libcamera_templates/proxy_functions.tmpl     | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index b5797b14..25476990 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -34,7 +34,7 @@\n>  \tthread_.exit();\n>  \tthread_.wait();\n>  \n> -\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage, this);\n>  \n>  \tstate_ = ProxyStopped;\n>  {%- endmacro -%}\n> -- \n> 2.48.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DE380C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Feb 2025 07:51:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EF8CD68741;\n\tWed, 26 Feb 2025 08:51:49 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E67661852\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Feb 2025 08:51:48 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:c539:d123:6770:2110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4700E497;\n\tWed, 26 Feb 2025 08:50:18 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"J9qG2Dek\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740556220;\n\tbh=7rXP1/jaqt7a692Kl3y4qDr2qbh0/nx1Su4fvfCpo7Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=J9qG2DekhLq7r3Ivi6NxJsjSjmzsGI5UN0WmyzAZ1KLHvUNZuF5g29K+0Zsm1+QLW\n\tnkFWuFY3exoD3iIufHzmRNKazuyap3jF1KdutWP9KMIFoftzfHVeLyauhGGQXqDz3I\n\tSX0F4Yrr7J1XXpkxYA8RiK9Nq0eK/SfUjbcHCGWI=","Date":"Wed, 26 Feb 2025 16:51:39 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","Message-ID":"<Z77IC6qDmznniEd9@pyrite.rasen.tech>","References":"<20250225150614.20195-1-mzamazal@redhat.com>\n\t<20250225150614.20195-7-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20250225150614.20195-7-mzamazal@redhat.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":33517,"web_url":"https://patchwork.libcamera.org/comment/33517/","msgid":"<174086989286.3864332.8420991124007163873@ping.linuxembedded.co.uk>","date":"2025-03-01T22:58:12","subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2025-02-25 15:06:12)\n> When stopping the proxy thread, all messages of InvokeMessage type\n> posted to the pipeline handler thread are dispatched, to ensure that all\n> signals emitted from the proxy thread and queued for delivery to the\n> proxy are delivered synchronously. This unnecessarily delivers queued\n> signals for other objects in the pipeline handler thread, possibly\n> delaying processing of higher priority events.\n> \n> Improve the implementation by limiting synchronous delivery to messages\n> posted for the proxy.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  .../ipc/generators/libcamera_templates/proxy_functions.tmpl     | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index b5797b14..25476990 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -34,7 +34,7 @@\n>         thread_.exit();\n>         thread_.wait();\n>  \n> -       Thread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> +       Thread::current()->dispatchMessages(Message::Type::InvokeMessage, this);\n>  \n>         state_ = ProxyStopped;\n>  {%- endmacro -%}\n> -- \n> 2.48.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F2259C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Mar 2025 22:58:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A569068754;\n\tSat,  1 Mar 2025 23:58:17 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA265614EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Mar 2025 23:58:15 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9778F520;\n\tSat,  1 Mar 2025 23:56:45 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BlfM/gDJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1740869805;\n\tbh=ywOnMv30MimB+OKcYjXfT2mpWEDOHYJLIsQkM23oM3I=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=BlfM/gDJY33yiWyQuvP4TmKsbz1RyI+K57bxEzbsm4aHy2VZ2/pz2VuDUuE4Il0mz\n\tmND9m2i7w93/RwcoRJfUAlW2DQM9kFfgscqECImisA6wMAycEN5YsdPJvSLoB0tr1S\n\tuXbw++xmMZ7ja8eq02PB/FKi8XApeM3zQBlcV8hM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250225150614.20195-7-mzamazal@redhat.com>","References":"<20250225150614.20195-1-mzamazal@redhat.com>\n\t<20250225150614.20195-7-mzamazal@redhat.com>","Subject":"Re: [PATCH v3 6/6] utils: ipc: Only dispatch messages for proxy when\n\tstopping thread","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Sat, 01 Mar 2025 22:58:12 +0000","Message-ID":"<174086989286.3864332.8420991124007163873@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]