From patchwork Fri Aug 19 19:19:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 12949126 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23596C32771 for ; Fri, 19 Aug 2022 19:19:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B68F6B0072; Fri, 19 Aug 2022 15:19:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 567718D0002; Fri, 19 Aug 2022 15:19:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42E096B0074; Fri, 19 Aug 2022 15:19:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 33EEC6B0072 for ; Fri, 19 Aug 2022 15:19:34 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D74D181867 for ; Fri, 19 Aug 2022 19:19:33 +0000 (UTC) X-FDA: 79817306226.08.70186C7 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf23.hostedemail.com (Postfix) with ESMTP id 84236140005 for ; Fri, 19 Aug 2022 19:19:33 +0000 (UTC) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-337ed9110c2so47691057b3.15 for ; Fri, 19 Aug 2022 12:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc; bh=7jW9JSFdBkYgLRSlwkmM/JIttkYceIPDZWewEa3r/u8=; b=oR+QcvLsAx7r4XQNN3cL0Twl29NyDz8147I+ryzAyb527+xnsfUFeLqIySHJ854uy6 ifH5GSNUxqLNTHZJIeGfD/3JXqZN8VpCi9HVpQ2fhFh+7fp1MKED4pUCnMP9FHX7Fco3 zkuh6QuX8n2LVfXK3Vb6ZiWkTTAFWETBsHj5R2e5uxY6TwbeZ67/O8q9UxiBX1GMQEM1 bt/E54Z4WsqFvIW9H+kN6PCddfpJYitM9/XHsCODdiIMc7pIbiT2CkjRGpPhQ7DJCqWi htrgbPkPU8Kj5Q1ngR1iVrLmBHp+vZguUJ3nXGw2WVxx9hf+vPmWnueCPSxgycGDaVbS jlqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc; bh=7jW9JSFdBkYgLRSlwkmM/JIttkYceIPDZWewEa3r/u8=; b=ZpHI6uUq4XmMRcV4aw7U5K8wZV5Jquv6s1/n7hV5sFGGkGNHwcHm6H0k7hkbF7PHuZ N6FjA/i70lUpshdhil+HjtH6KW+4wHi1BohRF5mFmAzjuhqs0sJ9rvtrgm6rvogcppDu QDSFAR+FWGRTAuouj0ftQ7A5L8ZuCKM8F1AVUIgy2oU5WXdTTsGZObM2X5hqOeQs5L0T KQencKO3CTy+qLJUincMUj8J2y6iZlUZcTtDsytsn4e53KYRjLLPYhafT1wZDhbikxQz PlI4osGt2tfvnxZDpuWb+CDldzcKgXacTFMTAQaucTINyJ+EVMQONQX+ByOj9KAg9zhK Jf4g== X-Gm-Message-State: ACgBeo2jxCxS62i2csVkbIHz6njbf4V5LPnUgqC0qaS+3sV4cW3Ev8Xa mgThKF2P18Nltwq2g309tBw4+ay4TlmuzrUkcRe/ X-Google-Smtp-Source: AA6agR4VD42sceVnWm58Z+eDpzGYApQVQC8yQTgPQxRlFe0oL38C+92/Nyrf7mt8jHbHD4sASoH0kBeSt4AWuHk9DBj1 X-Received: from ajr0.svl.corp.google.com ([2620:15c:2d4:203:676:8328:93fe:a318]) (user=axelrasmussen job=sendgmr) by 2002:a05:6902:154d:b0:67b:7908:9660 with SMTP id r13-20020a056902154d00b0067b79089660mr8579721ybu.607.1660936772678; Fri, 19 Aug 2022 12:19:32 -0700 (PDT) Date: Fri, 19 Aug 2022 12:19:28 -0700 Message-Id: <20220819191929.480108-1-axelrasmussen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 1/2] selftests/vm: fix inability to build any vm tests From: Axel Rasmussen To: Andrew Morton , Guillaume Tucker , " =?utf-8?b?SsOpcsO0?= =?utf-8?b?bWUgR2xpc3Nl?= " , John Hubbard , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Axel Rasmussen ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660936773; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=7jW9JSFdBkYgLRSlwkmM/JIttkYceIPDZWewEa3r/u8=; b=Z+PceHjxDfSft44/kKZwpxYETS2YIEwnimx9eqGbanXR8OTNE4YKwVEjhD+VtXAaFDE849 IWD/ARyPStB3jztvsNAMj4ovLKxJzva44hbsNQXw1GkP1y8n6uW6coI+eDcu4rjsYEBNN7 ChhmIA3wjbObRk0lAgHkq3th9Mi2kkQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=oR+QcvLs; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of 3ROL_Yg0KCCcDaHOUDVPXVVHQJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3ROL_Yg0KCCcDaHOUDVPXVVHQJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--axelrasmussen.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660936773; a=rsa-sha256; cv=none; b=xDece7K5tzh/mSwf+HsZlQjGCCfhCAFYuoQ4YM0XBjXHCB6OX0On6Z4/Dxw4rfKAGKSWeW AhrDzTeYwEg8UiGPPVySZqDT/LAdZxH1ZQxJpOY8zj4jbC9MKt5v0aXpJ0iCrXR4zliymo koCAEODC5kChWPoT0JirB2wYCSY1NLg= X-Stat-Signature: sw1q1uqbpkyh3qyr4za6t7zpzdocskrp X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 84236140005 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=oR+QcvLs; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of 3ROL_Yg0KCCcDaHOUDVPXVVHQJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3ROL_Yg0KCCcDaHOUDVPXVVHQJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--axelrasmussen.bounces.google.com X-Rspam-User: X-HE-Tag: 1660936773-601448 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000767, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When we stopped using KSFT_KHDR_INSTALL, a side effect is we also changed the value of `top_srcdir`. This can be seen by looking at the code removed by commit 49de12ba06ef ("selftests: drop KSFT_KHDR_INSTALL make target"). (Note though that this commit didn't break this, technically the one before it did since that's the one that stopped KSFT_KHDR_INSTALL from being used, even though the code was still there.) Previously lib.mk reconfigured `top_srcdir` when KSFT_KHDR_INSTALL was being used. Now, that's no longer the case. As a result, the path to gup_test.h in vm/Makefile was wrong, and since it's a dependency of all of the vm binaries none of them could be built. Instead, we'd get an "error" like: make[1]: *** No rule to make target '/[...]/tools/testing/selftests/vm/compaction_test', needed by 'all'. Stop. So, modify lib.mk so it once again sets top_srcdir to the root of the kernel tree. Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") Signed-off-by: Axel Rasmussen Reviewed-by: John Hubbard --- tools/testing/selftests/lib.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 947fc72413e9..d44c72b3abe3 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -40,6 +40,7 @@ ifeq (0,$(MAKELEVEL)) endif endif selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) +top_srcdir = $(selfdir)/../../.. # The following are built by lib.mk common compile rules. # TEST_CUSTOM_PROGS should be used by tests that require From patchwork Fri Aug 19 19:19:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 12949127 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F6DFC32773 for ; Fri, 19 Aug 2022 19:19:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E2896B0073; Fri, 19 Aug 2022 15:19:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 392D66B0074; Fri, 19 Aug 2022 15:19:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25B018D0002; Fri, 19 Aug 2022 15:19:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 15A306B0073 for ; Fri, 19 Aug 2022 15:19:36 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E6E3DA02ED for ; Fri, 19 Aug 2022 19:19:35 +0000 (UTC) X-FDA: 79817306310.17.BEC996E Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf21.hostedemail.com (Postfix) with ESMTP id 9A43B1C015F for ; Fri, 19 Aug 2022 19:19:35 +0000 (UTC) Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-3363b1dffa0so91124047b3.23 for ; Fri, 19 Aug 2022 12:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=FN3l7Edmt0N8hD2i6jpuTBKf9D3zI43oI6ElWLITPto=; b=Bw9oxVuL1mAMELgMlLatOutDlRfcfibuHS7Gw4khLfV8nWDrryFaFTnzdZn3sfxren 0NqPTWft+mcVVbDVIVZq19iU1Ahayk8YBEPxIyyLuh5E23B78obW2Yxv1OB+To4Aasta fCVHg5lzI4hthdRL/CdRCNSdTLkr3SOmoDGHwv2gZiYyiUXLyWnsNfFPdyCrBXioTAe3 0CUTZBzcknar9aL2UbV9WEw8MHWjNXWfuu4roNfPfS/o0Di0da3tEV8oEFRiPUxM4jAm zz+rDt9NdjR3WyAqSpMGQ6gxSKLVUvyIa/1BvU8bp1vsx2sEGvCPUwvpLGkDDVC8X6VT BHOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=FN3l7Edmt0N8hD2i6jpuTBKf9D3zI43oI6ElWLITPto=; b=r5OpFCMF+6lRcaadWfkPcNW23PfQxgQAEbdyrnIMngCoguCugEbnCgq2EmcVm+Wmbf WGuItzSau4izMYsaQpO1of/0bDpfI4lCW1h2WxuV40H7F/qE4sN8aJMAc15ymjRTxkc1 PP548Egv0sRr3QIwlunWU3SuG1fULykE44wCQi35MHtlqO3659xMlxeR4d+hN5jctq3B gDTgaLuBgI6zvjEWLavOigg1z+kqoPNp88SFtXKDRMcLekpM2/JG8yAf4RKXM20NxcMj 3m47p6+OerXsyzdVLXKoMPk4Y1qX0ZVL8hA8+ABFfCm+5vuw/hZ92d/pg7vz6wQX6061 0Ang== X-Gm-Message-State: ACgBeo1PqLPFgRYkmR5igv0s8wKVqnycoYl7Up+xb08BTF8s4R4oRvlI mZifKF/jsHozBfjOsWOM7+lBnvvAhO4RVk+mU2DZ X-Google-Smtp-Source: AA6agR6pQKrmoSd2Cuf9uYE0qJgeOlGD73u5ApSsOVKBUEzalfKaGHLjncY5Vt7iMPjrqZKhAvEfz7m2wAkDHWBAAYrt X-Received: from ajr0.svl.corp.google.com ([2620:15c:2d4:203:676:8328:93fe:a318]) (user=axelrasmussen job=sendgmr) by 2002:a05:6902:10c:b0:671:68b7:ab41 with SMTP id o12-20020a056902010c00b0067168b7ab41mr8569977ybh.608.1660936774945; Fri, 19 Aug 2022 12:19:34 -0700 (PDT) Date: Fri, 19 Aug 2022 12:19:29 -0700 In-Reply-To: <20220819191929.480108-1-axelrasmussen@google.com> Message-Id: <20220819191929.480108-2-axelrasmussen@google.com> Mime-Version: 1.0 References: <20220819191929.480108-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 2/2] selftests/vm: use top_srcdir instead of recomputing relative paths From: Axel Rasmussen To: Andrew Morton , Guillaume Tucker , " =?utf-8?b?SsOpcsO0?= =?utf-8?b?bWUgR2xpc3Nl?= " , John Hubbard , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Axel Rasmussen ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660936775; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FN3l7Edmt0N8hD2i6jpuTBKf9D3zI43oI6ElWLITPto=; b=zdG3Bkt8xrMGpBqQWKeKjPVP9Fh1NYOHFZgn3riWTENUvhvdgF9xIOttsXuct6J5VXPZJ8 l2xC2rT7AyWFcAnYjkMIEaatYk/UvwCgNODjVsDCrKcw0FAVxfL5jBkWKWPoZRXU92b8Rg vuo5b2xIxYo7ZhIwP7vEs59+/8xg0jE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Bw9oxVuL; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of 3RuL_Yg0KCCkFcJQWFXRZXXJSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--axelrasmussen.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3RuL_Yg0KCCkFcJQWFXRZXXJSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--axelrasmussen.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660936775; a=rsa-sha256; cv=none; b=eorvzUyDGzT/dcP2kYAClExITQfHhrmOh4i7jkJZ0qDuP0iz3Zc+8pCUEQ6lb72h66Kf4i VWsIly0abXY0mcPKB1YiPzkgAyHxL+14hoAAlwIZ7xqWLHeZMjoOtiv7ztLkXPxIqaZ4pI QiJAamcodbJ+3nN1+YcFsP2ZRJwjr4M= X-Rspamd-Queue-Id: 9A43B1C015F X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Bw9oxVuL; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of 3RuL_Yg0KCCkFcJQWFXRZXXJSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--axelrasmussen.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3RuL_Yg0KCCkFcJQWFXRZXXJSLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--axelrasmussen.bounces.google.com X-Rspamd-Server: rspam04 X-Stat-Signature: wdmwfm1yho5jchhhz5kmm8cbsqzzzfn9 X-HE-Tag: 1660936775-248983 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In various places both in t/t/s/v/Makefile as well as some of the test sources, we were referring to headers or directories using some fairly long relative paths. Since we have a working top_srcdir variable though, which refers to the root of the kernel tree, we can clean up all of these "up and over" relative paths, just relying on the single variable instead. Signed-off-by: Axel Rasmussen Reviewed-by: John Hubbard --- tools/testing/selftests/vm/Makefile | 2 +- tools/testing/selftests/vm/gup_test.c | 2 +- tools/testing/selftests/vm/hmm-tests.c | 4 ++-- tools/testing/selftests/vm/ksm_tests.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index d9fa6a9ea584..d516b8c38eed 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -25,7 +25,7 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/p # LDLIBS. MAKEFLAGS += --no-builtin-rules -CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) $(KHDR_INCLUDES) +CFLAGS = -Wall -I $(top_srcdir) -I $(top_srcdir)/usr/include $(EXTRA_CFLAGS) $(KHDR_INCLUDES) LDLIBS = -lrt -lpthread TEST_GEN_FILES = compaction_test TEST_GEN_FILES += gup_test diff --git a/tools/testing/selftests/vm/gup_test.c b/tools/testing/selftests/vm/gup_test.c index a309876d832f..e43879291dac 100644 --- a/tools/testing/selftests/vm/gup_test.c +++ b/tools/testing/selftests/vm/gup_test.c @@ -10,7 +10,7 @@ #include #include #include -#include "../../../../mm/gup_test.h" +#include #include "../kselftest.h" #include "util.h" diff --git a/tools/testing/selftests/vm/hmm-tests.c b/tools/testing/selftests/vm/hmm-tests.c index 529f53b40296..98b949c279be 100644 --- a/tools/testing/selftests/vm/hmm-tests.c +++ b/tools/testing/selftests/vm/hmm-tests.c @@ -35,8 +35,8 @@ * This is a private UAPI to the kernel test module so it isn't exported * in the usual include/uapi/... directory. */ -#include "../../../../lib/test_hmm_uapi.h" -#include "../../../../mm/gup_test.h" +#include +#include struct hmm_buffer { void *ptr; diff --git a/tools/testing/selftests/vm/ksm_tests.c b/tools/testing/selftests/vm/ksm_tests.c index f5e4e0bbd081..0d85be2350fa 100644 --- a/tools/testing/selftests/vm/ksm_tests.c +++ b/tools/testing/selftests/vm/ksm_tests.c @@ -11,7 +11,7 @@ #include #include "../kselftest.h" -#include "../../../../include/vdso/time64.h" +#include #include "util.h" #define KSM_SYSFS_PATH "/sys/kernel/mm/ksm/"