From patchwork Sat Oct 12 12:47:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 21603 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 3F9B4C326B for ; Sat, 12 Oct 2024 12:49:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0200A6537A; Sat, 12 Oct 2024 14:49:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NnJftfLl"; dkim-atps=neutral Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CC33B618C3 for ; Sat, 12 Oct 2024 14:49:32 +0200 (CEST) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-71df04d3cd1so2494508b3a.2 for ; Sat, 12 Oct 2024 05:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1728737371; x=1729342171; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mDnxKM/oDewovNgW2+5sBeZz2XNG4TEnj8CXyYtXYdw=; b=NnJftfLlZPQ+dzWYtjxUUzmlC3dsZog07mYSlGX+ERn7vpcZAjlvZ/Gasog23qcU24 hmYhW2PxFXltQgB/gtTHHLkFnF1iPDwG0q6rYV1bwHkvaYmtBaQi/lwA2vY0j6TlTchl zwClQMYxUaEkGNwclMpO3iezGU+5JCCUNBkx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728737371; x=1729342171; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mDnxKM/oDewovNgW2+5sBeZz2XNG4TEnj8CXyYtXYdw=; b=YNI675mZwMn16JUJsaQw/hvGPLnvCrB8XMxwpEL5g0de3oDbs1bG60dSL+wyChya1N jalO8S4Fwt9khQaMoPzOO9IkXiERId/LO3gWW3obeDR3yzDZPC+jeyrPCduJ/K+6dkgZ zjTfGMh4kXnpN6JizsmFgQ3D1KnXi7IKHhQBZC5itwFyZOxAwIZjpaizhQfaAcKaGWkB X6kf2S5tQheXJYZWLCmog3SpweFspQ75JGpZLoncnkiD0DwyB15VjQltcHXD2XDNS2kz hAzergJXyanHwVmHZ1z9Hasiy7lDhMpv71J6xwsnRAOzql0yAPk7RArKa4Vwe+PEmgvl oSEw== X-Gm-Message-State: AOJu0YxVnnzkChfkXrc8yxRFMoExYtIHCWqdCcB17vu1jD+TG6Ypg1aQ ynXPvVIrFJn4vuO9AQquy24ntQl/rqkk8NdPF47ePirUiUcfTDcODR2ejuW2h7v/z57AC7dX/P4 = X-Google-Smtp-Source: AGHT+IHrB/uUhgxWRghNDHCJtjMXOecIt+WIlbtrxdUCREVYO0l00uui/S0IZcTzkDOpWjFwRs7aVQ== X-Received: by 2002:a05:6a00:1250:b0:71e:fb4:6c98 with SMTP id d2e1a72fcca58-71e4c1cfc05mr4921704b3a.23.1728737370964; Sat, 12 Oct 2024 05:49:30 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (27.247.221.35.bc.googleusercontent.com. [35.221.247.27]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2aa937cesm4074222b3a.132.2024.10.12.05.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 05:49:30 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v2 0/1] Add thread affinity Date: Sat, 12 Oct 2024 12:47:56 +0000 Message-ID: <20241012124926.1049458-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog 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" Hi folks, This patch adds a method to set thread affinity, which is needed to ensure performance in mtkisp7 pipeline handler and IPA. This passes gitlab pipeline: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1288675 v2: - Check cpu indices within [0, `std::thread::hardware_concurrency()`). - Limit max size of cpus to be CPU_SETSIZE. BR, Harvey Han-Lin Chen (1): libcamera: add method to set thread affinity include/libcamera/base/thread.h | 6 +++++ src/libcamera/base/thread.cpp | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+)