Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp272448pxb; Wed, 6 Oct 2021 04:50:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/79EZCY21lGoUOk0ACoZS841Jpz8qF2nMJ0iLWhmcFxmjscDoSmR04ND/9KtSgny63Ate X-Received: by 2002:a17:906:6acf:: with SMTP id q15mr26445728ejs.174.1633521012280; Wed, 06 Oct 2021 04:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633521012; cv=none; d=google.com; s=arc-20160816; b=Dobsiz3O/EBLvmJ2LevtrbjZsCFhvg9nhfTbSNxyQesbolS4yV9vsL8VnYh2sUFh9D 254jFtoRTwa5LHuYAWkHxAV1VieEQjanfX6JD09Zi0BPRMdoChWjWF+lB23T45wQtGW9 xCriRZwIJu4/8ekdk+eKwlJ+oT4rdbs/1E7Igoz+QWlARAwgLKcmJmAQKJwpLOLSOXXq LORyTGmOJfOFFXCHZFinEWCWzXiIJ1OozsZtHAWPU6ja3mjZKnFbCIQrJgGjQGNhTh+j SS1KfMaUULKPBhTm/mbsx5BuSWti8WBhhBS7jQGJ+jyEnRdIhj4QhN6FubHhisMkLqR1 YepQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nhBac9ySmVQ5ir83z9Tad+wE2IbxDFGBb95nCedyfbc=; b=CqBg5uDGpV4DDtxh/RTKy+VGup32B6FK7D1OttDQmbICw6UP1Q1dvNtVRh2f0KkfDO R3KDyQ2/MnPOeLidcHxK/jaYG4RoRIX1LD6+RYG6qiMegOrTKNZPqbpnv4J5/Oh1H93b dc8+PW/0q8Hjx6P+t80sqE9rtylwmqz8cxAarUTFzWZCv4cp/KJ/iwUf65h6fv1eTK6y qTJu8fWP6+TclbhIS+s7dHDK10QJww0IwO/DvsVhxs8/XpfY0GozD/3J6FMbHcP0rTQ8 Vr1uKwZkKIpxjI2kcBz+l9UdVBFY1+wQVMDfFQBhwnQw6VQrH6mvkzaqScjDMmDLX6T7 kmTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ai3V7nk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si20208388edz.212.2021.10.06.04.49.47; Wed, 06 Oct 2021 04:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ai3V7nk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238546AbhJFLt7 (ORCPT + 99 others); Wed, 6 Oct 2021 07:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238117AbhJFLtw (ORCPT ); Wed, 6 Oct 2021 07:49:52 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6562C061749; Wed, 6 Oct 2021 04:47:59 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id x7so8735714edd.6; Wed, 06 Oct 2021 04:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nhBac9ySmVQ5ir83z9Tad+wE2IbxDFGBb95nCedyfbc=; b=ai3V7nk4kDPh3m42WXc2Bnc0Ujz1eqivV3xMn88FKHju/se7c8psloCp9JI6CCnuwd IeKJ5NYdWcniRjfiiDEl9plJ07z95XJ5bB2MUyYZQS1S6MEwBYv8NGb1yGVYTCoOkkUs uzdX8wh+bzoiMxyG+ZQW28AtacxFWNqVUgZbtO9djd6HWbAkBLEazhIVSjmLzBVj+gTd Dwi6WbHwHH71IaebTPFet+eoT1RHCrxPQDNMSYvRgVn4PN0rRFwy8HkAtqmMAheoeDSy IqpeSumzDobbpqf9gegyvOu3RULolTNCSsESODMMd93eBIx+m3zeKdh7bZPuy2w/L2Ty zhEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nhBac9ySmVQ5ir83z9Tad+wE2IbxDFGBb95nCedyfbc=; b=iU+3j4IMzmgX7swokpHryiwTHUe/pwFhcWFaQKyccGNXsuCzWOw0Jj04yjeiyJtcc7 HLoJeKg5khB6Wem75foNdUI0TnrYkSMLqKJJsHODn+v1//q2QgmqaGdyIeJWQKfFnchS yvAbCIXzo/qat5zRCkUpoXSIwwlGPm67GWcqo3TAfYhQul5CT/jHpzxWPAdN3+eYkZnB NEUkGIS5oIJfqCAUKD7LiR6nBW0v4wzlctIpX3ajVTMJrvst1AsPLHLBFUYzDoDXxvro alpiwAOS3cVhcsGuN067ycEILAi15gki73EDZ6LO+BGmRxjkENNGhTIGi42KoVI+MQ5D TqLw== X-Gm-Message-State: AOAM532X8XxC/d19xgL9hysOVBHzwDhOq5JMGPYTDWT/8KcOQUObhfY5 gIRiil9z85werrLaJ/yY7bs= X-Received: by 2002:a50:da48:: with SMTP id a8mr33312528edk.146.1633520877446; Wed, 06 Oct 2021 04:47:57 -0700 (PDT) Received: from localhost.localdomain ([95.76.3.69]) by smtp.gmail.com with ESMTPSA id y40sm1402187ede.31.2021.10.06.04.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 04:47:57 -0700 (PDT) From: Leonard Crestez To: Jakub Kicinski , Shuah Khan , David Ahern Cc: "David S. Miller" , Ido Schimmel , Seth David Schoen , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/11] selftests: net/fcnal: kill_procs via spin instead of sleep Date: Wed, 6 Oct 2021 14:47:21 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sleeping for one second after a kill is not necessary and adds up quite quickly. Replace with a fast loop spinning until pidof returns nothing. Signed-off-by: Leonard Crestez --- tools/testing/selftests/net/fcnal-test.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh index 0bd60cd3bc06..b7fda51deb3f 100755 --- a/tools/testing/selftests/net/fcnal-test.sh +++ b/tools/testing/selftests/net/fcnal-test.sh @@ -176,12 +176,19 @@ show_hint() fi } kill_procs() { - killall nettest ping ping6 >/dev/null 2>&1 - sleep 1 + local pids + while true; do + pids=$(pidof nettest ping ping6) + if [[ -z $pids ]]; then + break + fi + kill $pids + sleep 0.01 + done } do_run_cmd() { local cmd="$*" -- 2.25.1