From patchwork Tue Mar 25 18:08:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23013 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9D3D5C0DA4 for ; Tue, 25 Mar 2025 18:08:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76D3E68955; Tue, 25 Mar 2025 19:08:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eRbDRwKM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 71451600EB for ; Tue, 25 Mar 2025 19:08:42 +0100 (CET) Received: from pb-laptop.local (185.221.143.221.nat.pool.zt.hu [185.221.143.221]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BB571353 for ; Tue, 25 Mar 2025 19:06:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1742926015; bh=X27O+WutmeChIIGp9Pko5lndhtxUQnFRgna62PUaS20=; h=From:To:Subject:Date:From; b=eRbDRwKMMAR//3cIcW53tSdfmema5y2ssH+jUf/oFl0UEPXS9F7jH9et4+cZykBVh zR5CWEplpzM9jMWrPiopc8swk7yDztK6SaTnd33r7M354fjxU+UtYyDFDycO3bra4K DlVA3S/X16INoqtqUwuemwHj7CacJ0//Y3K+u4JM= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v3 0/9] libcamera: process: Remove `ProcessManager` singleton Date: Tue, 25 Mar 2025 19:08:12 +0100 Message-ID: <20250325180821.1456154-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The main goal is to remove the need for the ProcessManager singleton. That is achieved by using pidfd + clone3(), which raises the minimum kernel version to 5.4. There are also additional misc. changes. v2: https://patchwork.libcamera.org/patch/22609/ v1: https://patchwork.libcamera.org/patch/22522/ Barnabás Pőcze (9): libcamera: process: Disable copy/move libcamera: process: Misc. cleanup around `execv()` libcamera: process: Use `pid_` member to decide if running libcamera: process: Return error if already running libcamera: process: Ensure that file descriptors are nonnegative libcamera: process: Use span instead of vector libcamera: process: Move `closeAllFdsExcept()` libcamera: process: Use `close_range()` when available libcamera: process: Remove `ProcessManager` singleton include/libcamera/internal/camera_manager.h | 1 - include/libcamera/internal/process.h | 42 +-- meson.build | 6 +- src/libcamera/ipc_pipe_unixsocket.cpp | 9 +- src/libcamera/process.cpp | 303 ++++++-------------- test/ipc/unixsocket_ipc.cpp | 2 - test/log/log_process.cpp | 2 - test/process/process_test.cpp | 7 +- 8 files changed, 112 insertions(+), 260 deletions(-) Reviewed-by: Kieran Bingham Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- 2.49.0