Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1237870pxa; Thu, 20 Aug 2020 06:26:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQpwNaIKYrxWb9/Yq1I/3o91N2TiAMnn0UJGGwPUFtDkd0A+2nffsTjdsZznQOfdiR6Nf9 X-Received: by 2002:a17:906:4047:: with SMTP id y7mr3156804ejj.21.1597930017560; Thu, 20 Aug 2020 06:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930017; cv=none; d=google.com; s=arc-20160816; b=wAnIVCq4sPDc39yRe0KwBZcP4mdZ/ljnm6Q334+R5uMh9b6Ndm7COyA/kxNUwRMRoj 49Zmm2b1fYwCMUvatPL7L7ma2HfVJ6mcKCQABADC1qOYoOxbByq1Xa7MarSEHtP3GJ0j TgsSO6zUyZ5SKr2fza5uuyb6owe8KsmtUptvwvIGLLyxDppcVwD8zxf9V4m8JRzuUfFr EFGioJgNXarsQ1MN8SwEuYCLmqqbEGjtPTHzWSeu5UdJaBTfVN7mOyUprYaebdkye3A+ OPNWbj9oUbNWtLQm5WtCwtcs8uxvmeMipmP2hIEn7YpZ2lWThraJJGjX/pJlKyVajs9s zM7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kpplXJdvUWhDPj/8A5UJ0jbt5Bd52K9o2Se9ameX4cw=; b=KGRlU2y40zd0/W1CbPpvXkxzy7ipW6QnevsDvrWqre5trX51xZ2nBA0TxRJFxEjA1Z cBxSap/dBprilKXcuKTCU/drT+ZmvR4NGoNG0LBX+XqetsJNDihkP3lTOOJWriWxABU9 UMEMXUbaqfZ5RZtBiqStyUTs6w32COV4zsKKe0+lhHwygcl8JuAhk0XX/iWln/F4Y9S7 o63/Mp+Mj1djLbZe1b14QER22sEDK0Grzm13yiyCp5U7C6PPEXlznQOJwpf4wWHePncZ XYz7jNIkw6+ldVZGy+/MTvTBWuGQ4vqzjx1eU33jrMRrNSR2ijAEv8M/PDewHDnphXyy Gbvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v+vCkMy+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si578450edt.42.2020.08.20.06.26.33; Thu, 20 Aug 2020 06:26:57 -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=@kernel.org header.s=default header.b=v+vCkMy+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbgHTNXZ (ORCPT + 99 others); Thu, 20 Aug 2020 09:23:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbgHTJeL (ORCPT ); Thu, 20 Aug 2020 05:34:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D781E208E4; Thu, 20 Aug 2020 09:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916034; bh=U+szTX/L2/s3tOi9Cau5a0/3kKmPmt+BJx8Y437yEqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v+vCkMy+OxVNhzxeDDz2810SiG/M3QICzXJSmrs4OLb609gg5PxTcyAn4PhO3F6j+ gNuOIDkIWYDppZ7l2gr8YkQHinHGSgwNRS8HKABToi4+gPf28ZO2XVOU4MkgZeFmj3 fdMWX+6w2x5BRWa7CpL4iHL7JqODT57oEoQm6by8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov , John Fastabend , Sasha Levin Subject: [PATCH 5.8 191/232] selftests/bpf: Prevent runqslower from racing on building bpftool Date: Thu, 20 Aug 2020 11:20:42 +0200 Message-Id: <20200820091622.043481957@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrii Nakryiko [ Upstream commit 6bcaf41f9613278cd5897fc80ab93033bda8efaa ] runqslower's Makefile is building/installing bpftool into $(OUTPUT)/sbin/bpftool, which coincides with $(DEFAULT_BPFTOOL). In practice this means that often when building selftests from scratch (after `make clean`), selftests are racing with runqslower to simultaneously build bpftool and one of the two processes fail due to file being busy. Prevent this race by explicitly order-depending on $(BPFTOOL_DEFAULT). Fixes: a2c9652f751e ("selftests: Refactor build to remove tools/lib/bpf from include path") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20200805004757.2960750-1-andriin@fb.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 22aaec74ea0ab..dab182ffec320 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -141,7 +141,9 @@ VMLINUX_BTF_PATHS := $(if $(O),$(O)/vmlinux) \ /boot/vmlinux-$(shell uname -r) VMLINUX_BTF := $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))) -$(OUTPUT)/runqslower: $(BPFOBJ) +DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool + +$(OUTPUT)/runqslower: $(BPFOBJ) | $(DEFAULT_BPFTOOL) $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ OUTPUT=$(SCRATCH_DIR)/ VMLINUX_BTF=$(VMLINUX_BTF) \ BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR) && \ @@ -163,7 +165,6 @@ $(OUTPUT)/test_netcnt: cgroup_helpers.c $(OUTPUT)/test_sock_fields: cgroup_helpers.c $(OUTPUT)/test_sysctl: cgroup_helpers.c -DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) \ $(BPFOBJ) | $(BUILD_DIR)/bpftool -- 2.25.1