Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43C9BC61DA4 for ; Sat, 4 Feb 2023 08:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233008AbjBDIhX (ORCPT ); Sat, 4 Feb 2023 03:37:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230339AbjBDIhT (ORCPT ); Sat, 4 Feb 2023 03:37:19 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9F72A9B7; Sat, 4 Feb 2023 00:37:18 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 87BD438269; Sat, 4 Feb 2023 08:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675499837; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RcLMsHWahnKCSaF9S8/IpKCRhGBLv3jN3QszBd2oUrE=; b=OlK2dRKWt+azF90YkaeXIbGPBgQpN9AoCAuHLHSqchVc40cDyU4PaK/vO45OXl1ZPEWrAH eYGihhb8BCiKcPL5Zga796MKkBsRilYWlvXhPBd14exdJDYO9Vzflu0oLanOwSXM3sO++n Kaslvjsiq/Wz8P0HR/o9rSvjx1B5258= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675499837; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RcLMsHWahnKCSaF9S8/IpKCRhGBLv3jN3QszBd2oUrE=; b=IN+7TwKwomq87Iez9hcudSyREJdmtMuUtMwSgGaEddwOYtSrNqJ19Xav1pmhzadjCM2v/2 oVqarOK0C5CuNNDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 59334133F5; Sat, 4 Feb 2023 08:37:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XU+4FD0Z3mNqKwAAMHmgww (envelope-from ); Sat, 04 Feb 2023 08:37:17 +0000 Date: Sat, 04 Feb 2023 09:37:16 +0100 Message-ID: <877cwxn7wj.wl-tiwai@suse.de> From: Takashi Iwai To: Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , Shuah Khan , alsa-devel@alsa-project.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kselftest/alsa: Run PCM tests for multiple cards in parallel In-Reply-To: <20230203-alsa-pcm-test-card-thread-v1-1-59941640ebba@kernel.org> References: <20230203-alsa-pcm-test-card-thread-v1-1-59941640ebba@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 03 Feb 2023 20:52:47 +0100, Mark Brown wrote: > > With each test taking 4 seconds the runtime of pcm-test can add up. Since > generally each card in the system is physically independent and will be > unaffected by what's going on with other cards we can mitigate this by > testing each card in parallel. Make a list of cards as we enumerate the > system and then start a thread for each, then join the threads to ensure > they have all finished. The threads each run the same tests we currently > run for each PCM on the card before exiting. > > The list of PCMs is kept global since it helps with global operations > like working out our planned number of tests and identifying missing PCMs > and it seemed neater to check for PCMs on the right card in the card > thread than make every PCM loop iterate over cards as well. > > We don't run per-PCM tests in parallel since in embedded systems it can > be the case that resources are shared between the PCMs and operations on > one PCM on a card may constrain what can be done on another PCM on the same > card leading to potentially unstable results. > > We use a mutex to ensure that the reporting of results is serialised and we > don't have issues with anything like the current test number, we could do > this in the kselftest framework but it seems like this might cause problems > for other tests that are doing lower level testing and building in > constrained environments such as nolibc so this seems more sensible. > > Note that the ordering of the tests can't be guaranteed as things stand, > this does not seem like a major problem since the numbering of tests often > changes as test programs are changed so results parsers are expected to > rely on the test name rather than the test numbers. We also now prefix the > machine generated test name when printing the description of the test since > this is logged before streaming starts. > > On my two card desktop system this reduces the overall runtime by a > third. > > Signed-off-by: Mark Brown Thanks, applied now. Takashi