[{"id":14613,"web_url":"https://patchwork.libcamera.org/comment/14613/","msgid":"<20210119175535.esxqdqdjozvmqxhm@basti-TUXEDO-Book-XA1510>","date":"2021-01-19T17:55:35","subject":"Re: [libcamera-devel] [PATCH 0/2] cam: Fix races in event loop and\n\tlong request processing times","submitter":{"id":78,"url":"https://patchwork.libcamera.org/api/people/78/","name":"Sebastian Fricke","email":"sebastian.fricke@posteo.net"},"content":"Hey Niklas,\n\nThank you for the patch!\n\nJust a few typo corrections here.\n\nOn 19.01.2021 13:31, Niklas Söderlund wrote:\n>Hello,\n>\n>Using cam to writing requests to (slow) media sometimes lock cam in an\n\ns/cam to writing requests/cam to write requests/\ns/sometimes lock cam/sometimes locks cam/\n\n>unbreakable loop. At the heart of the problem is that when request\n>processing was moved from the camera to the main thread subtle races in\n>the cam event loop implementation where exposed.\n\ns/where/were/\n\n>\n>The races are easily trigged by having callbacks injected into the even\n\ns/The races/Those races/\n\n>loop that takes a long time to process. The only callbacks cam currently\n\ns/that takes/that take/\ns/The only callbacks cam/The only callbacks that cam/\n\n>injects to the event loop are processing of completed requests. So by\n\ns/are processing of/are processing/\n\n>increasing there processing time by writing them to disk the races where\n\ns/there processing time/the processing time/\n\n>trigged.\n>\n>This series fixes two different issues found when debugging this. Patch\n>1/2 solves a design issue in the event loop implementation where the\n>callback queue can be flooded which prevents termination of the loop.\n>While patch 2/2 solves a cam design issue where the --capture=N behavior\n>of only capturing N requests where broken but hidden by the problem in\n\ns/where broken/was broken/\n\n>patch 1/2.\n>\n>Niklas Söderlund (2):\n>  cam: event_loop: Stop queuing calls when the event loop are exiting\n>  cam: Fix capturing an precis number of requests\n>\n> src/cam/capture.cpp    | 12 ++++++------\n> src/cam/event_loop.cpp |  2 +-\n> 2 files changed, 7 insertions(+), 7 deletions(-)\n>\n>-- \n>2.30.0\n>\n>_______________________________________________\n>libcamera-devel mailing list\n>libcamera-devel@lists.libcamera.org\n>https://lists.libcamera.org/listinfo/libcamera-devel","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 84C6CC0F1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Jan 2021 17:55:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 049D568169;\n\tTue, 19 Jan 2021 18:55:40 +0100 (CET)","from mout01.posteo.de (mout01.posteo.de [185.67.36.65])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8BD2D6814E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Jan 2021 18:55:38 +0100 (CET)","from submission (posteo.de [89.146.220.130]) \n\tby mout01.posteo.de (Postfix) with ESMTPS id EBEA7160063\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Jan 2021 18:55:37 +0100 (CET)","from customer (localhost [127.0.0.1])\n\tby submission (posteo.de) with ESMTPSA id 4DKxCF2PQSz9rxf;\n\tTue, 19 Jan 2021 18:55:37 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=posteo.net header.i=@posteo.net\n\theader.b=\"rljgoOnx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;\n\tt=1611078938; bh=Bv/pXvxpdrIpS5Yy4yb1OvHWU3FsIxu+bV06kvcsSHA=;\n\th=Date:From:To:Cc:Subject:From;\n\tb=rljgoOnxsiIHw1sAZaWPffsFBaypvwM/DH6Fxlxnu8Ckhaq5WBKJxEkFjNMveVd05\n\tfmamTWc7nkVIbA5+93ENGihjGyuKh/9vTV3RgPEo52RKXStvoF9r52bVWaCu/+lV+N\n\tdaHnDZ0W2be02uiLx7po1CP4esU/deI1uRHTCNlouz9g4C5OZBOsSL4hCBl46V/VLj\n\tSMjZmETTdn78rRyIIzX3iWVyiqpmCBZ49jrXrKBaDleS1i5PmvSeZ/GLrCrQm/kjEp\n\tmPXe7tYeukQujNWlAF/dYmG0/pGYPJmoUAiM2wwEvPBBNME8hzmYkReQ+j27xcNyhX\n\t/qQVS3TYZ4aRg==","Date":"Tue, 19 Jan 2021 18:55:35 +0100","From":"Sebastian Fricke <sebastian.fricke@posteo.net>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20210119175535.esxqdqdjozvmqxhm@basti-TUXEDO-Book-XA1510>","References":"<20210119123110.2976971-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210119123110.2976971-1-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 0/2] cam: Fix races in event loop and\n\tlong request processing times","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]