Message ID | 20241018075942.1150378-3-chenghaoyang@chromium.org |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Quoting Harvey Yang (2024-10-18 08:57:35) > Previously the worker might not receive the disconnect signal, and the > forked process might stay alive forever. > > This CL also helps DMA buf recycling, as the algo process might hold DMA > buf file descriptors. Should this just be part of the previous patch? Or is it somehow distinct? > > Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > --- > .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > index 1f990d3f9..68d68c4a5 100644 > --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > @@ -60,6 +60,10 @@ public: > > ~{{proxy_worker_name}}() {} > > + void disconnected() { > + exit_ = true; > + } > + > void readyRead() > { > IPCUnixSocket::Payload _message; > @@ -131,6 +135,7 @@ public: > return EXIT_FAILURE; > } > socket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead); > + socket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected); > > ipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface()); > if (!ipa_) { > -- > 2.47.0.rc1.288.g06298d1525-goog >
Hi Kieran, On Sun, Oct 20, 2024 at 6:45 AM Kieran Bingham <kieran.bingham@ideasonboard.com> wrote: > > Quoting Harvey Yang (2024-10-18 08:57:35) > > Previously the worker might not receive the disconnect signal, and the > > forked process might stay alive forever. > > > > This CL also helps DMA buf recycling, as the algo process might hold DMA > > buf file descriptors. > > Should this just be part of the previous patch? Or is it somehow > distinct? Yes, I'm also fine with merging them. Will do in the next version. BR, Harvey > > > > > Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > --- > > .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > index 1f990d3f9..68d68c4a5 100644 > > --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > @@ -60,6 +60,10 @@ public: > > > > ~{{proxy_worker_name}}() {} > > > > + void disconnected() { > > + exit_ = true; > > + } > > + > > void readyRead() > > { > > IPCUnixSocket::Payload _message; > > @@ -131,6 +135,7 @@ public: > > return EXIT_FAILURE; > > } > > socket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead); > > + socket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected); > > > > ipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface()); > > if (!ipa_) { > > -- > > 2.47.0.rc1.288.g06298d1525-goog > >
On Sun, Oct 20, 2024 at 12:35:57PM +0800, Cheng-Hao Yang wrote: > On Sun, Oct 20, 2024 at 6:45 AM Kieran Bingham wrote: > > Quoting Harvey Yang (2024-10-18 08:57:35) > > > Previously the worker might not receive the disconnect signal, and the > > > forked process might stay alive forever. > > > > > > This CL also helps DMA buf recycling, as the algo process might hold DMA > > > buf file descriptors. > > > > Should this just be part of the previous patch? Or is it somehow > > distinct? > > Yes, I'm also fine with merging them. Will do in the next version. Please detail in the commit message both the expected behaviour on the libcamera side and on the proxy worker side. > > > Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> > > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > > Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > > --- > > > .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > index 1f990d3f9..68d68c4a5 100644 > > > --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > @@ -60,6 +60,10 @@ public: > > > > > > ~{{proxy_worker_name}}() {} > > > > > > + void disconnected() { > > > + exit_ = true; > > > + } void disconnected() { exit_ = true; } > > > + > > > void readyRead() > > > { > > > IPCUnixSocket::Payload _message; > > > @@ -131,6 +135,7 @@ public: > > > return EXIT_FAILURE; > > > } > > > socket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead); > > > + socket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected); > > > > > > ipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface()); > > > if (!ipa_) {
Hi Laurent, On Mon, Oct 21, 2024 at 12:49 AM Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: > > On Sun, Oct 20, 2024 at 12:35:57PM +0800, Cheng-Hao Yang wrote: > > On Sun, Oct 20, 2024 at 6:45 AM Kieran Bingham wrote: > > > Quoting Harvey Yang (2024-10-18 08:57:35) > > > > Previously the worker might not receive the disconnect signal, and the > > > > forked process might stay alive forever. > > > > > > > > This CL also helps DMA buf recycling, as the algo process might hold DMA > > > > buf file descriptors. > > > > > > Should this just be part of the previous patch? Or is it somehow > > > distinct? > > > > Yes, I'm also fine with merging them. Will do in the next version. > > Please detail in the commit message both the expected behaviour on the > libcamera side and on the proxy worker side. Updated. > > > > > Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> > > > > Co-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > > > Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org> > > > > --- > > > > .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > > index 1f990d3f9..68d68c4a5 100644 > > > > --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > > +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl > > > > @@ -60,6 +60,10 @@ public: > > > > > > > > ~{{proxy_worker_name}}() {} > > > > > > > > + void disconnected() { > > > > + exit_ = true; > > > > + } > > void disconnected() > { > exit_ = true; > } > Thanks, will be updated in the next version. BR, Harvey > > > > + > > > > void readyRead() > > > > { > > > > IPCUnixSocket::Payload _message; > > > > @@ -131,6 +135,7 @@ public: > > > > return EXIT_FAILURE; > > > > } > > > > socket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead); > > > > + socket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected); > > > > > > > > ipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface()); > > > > if (!ipa_) { > > -- > Regards, > > Laurent Pinchart
diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl index 1f990d3f9..68d68c4a5 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl @@ -60,6 +60,10 @@ public: ~{{proxy_worker_name}}() {} + void disconnected() { + exit_ = true; + } + void readyRead() { IPCUnixSocket::Payload _message; @@ -131,6 +135,7 @@ public: return EXIT_FAILURE; } socket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead); + socket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected); ipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface()); if (!ipa_) {