From mboxrd@z Thu Jan 1 00:00:00 1970 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 DFA8BC28B2B for ; Thu, 18 Aug 2022 23:30:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57E9D8D0001; Thu, 18 Aug 2022 19:30:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 52D638E0001; Thu, 18 Aug 2022 19:30:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3801A8D0003; Thu, 18 Aug 2022 19:30:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2834A8D0001 for ; Thu, 18 Aug 2022 19:30:50 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F1DADA44F6 for ; Thu, 18 Aug 2022 23:30:49 +0000 (UTC) X-FDA: 79814310618.25.0ADFFD4 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf02.hostedemail.com (Postfix) with ESMTP id 2C11D806AF for ; Thu, 18 Aug 2022 23:28:12 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id b2so2271579qkh.12 for ; Thu, 18 Aug 2022 16:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=7oe2Eodvo4cHSy2YtCc59ePq/pRiQuqwvHx5VzBYsYs=; b=edIm4Rg6BSJsMQXvCvLFwwFXy0SgZL16xDx+ddO+pIxGoxGhVBW1JCUG4UJ4nMUG8M h9wXvegj3gt22AUMb2wOXjwfw2exTUiCTBBx/czTYs8MX1XFi3rftEoMeav0o1sDi4PH T5O1xzJMMPnXq9Tm/Z2EFTSP1YGgWu/FUpjClXnfOiUHoAd4VQvibkoMme4W9oxkJhWm 9GMqef+W/Vs+jkHaqJVlLMkA+d4lhvKd+F6yj/327zqFExvFnlp9sarw3XYr4YD+WO7X FfTLBskgqGWvD6e+k6RBRl9E7jBeyHO2EstWlzSxL9MHnzGU6oG0h9vOvrFHR4B9mVtJ 6C3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=7oe2Eodvo4cHSy2YtCc59ePq/pRiQuqwvHx5VzBYsYs=; b=iwnN37gNDoMikw5wWpuWIeXxBNFwkA+Vj/EPS1Ed5Y4RSeadmPFDtN6Uact09y8pAT bfi3/ZhYzkiXuEtNOH9TTMXVeyvVB03TkpM7UNwuGqUWmkYrme4p8+ayWbKBktalJTaG YKEJBLOR6+Gyb9de5pCWciGKxVCIb0QllgGgNN9g63AvGd1nVSo17hEKyiiLGuzUXR5P Yv3EYkZllfWs4uTCM6igeORSVnNihTtnD2iE4Oy5SyFAOwbIR5sxMaDfOeqPDUDoRSy4 LGcFAduGDtodUxyqxlbs0eDITimiiIO+oCDLMt92JYUbmcdPwkFfK2OTq3ng1gM0sTm8 URRQ== X-Gm-Message-State: ACgBeo29iyVdfBnT6kGEwXF41wIRKQQkcVE2Y4ntm5hy31pySBbGD0Zi +w6KgTuudP8LJjfFruYeQSFbxlHrVYTKL8VnmrCoKEupoU4= X-Google-Smtp-Source: AA6agR4U+57gHVzGKChcaUfF5FOoGlpZMDiAtZPsr1UjDP45RsQZeuVCHp+BILRKLZOZ5NtZ/tNWWI+NXk0bJOcx7N0= X-Received: by 2002:a02:7a4d:0:b0:346:b4db:f4da with SMTP id z13-20020a027a4d000000b00346b4dbf4damr1863490jad.52.1660845558863; Thu, 18 Aug 2022 10:59:18 -0700 (PDT) MIME-Version: 1.0 References: <20220817211356.273019-1-axelrasmussen@google.com> <190edda8-1f37-0fa5-1cc1-ada97518698a@nvidia.com> In-Reply-To: <190edda8-1f37-0fa5-1cc1-ada97518698a@nvidia.com> From: Axel Rasmussen Date: Thu, 18 Aug 2022 10:58:43 -0700 Message-ID: Subject: Re: [PATCH] selftests/vm: fix inability to build any vm tests To: John Hubbard Cc: Andrew Morton , Shuah Khan , Guillaume Tucker , Linux MM , Linuxkselftest , LKML Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660865291; 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=7oe2Eodvo4cHSy2YtCc59ePq/pRiQuqwvHx5VzBYsYs=; b=iSZesHfQ0jc/t0EsnQwFj/K73odXyKFxWwrL01qT+GlxTJ7UcDXMr6AXY1n5wqwczGbNyl ay0ExiJ+zB1HuywQn3+wolnaa5AAONembCvDw1prmfcYBJlaUPcut0oyXphw+rqHikoKtK MXa3t5KOT5VCY2HKnkna9G5eJivYfQk= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=edIm4Rg6; spf=pass (imf02.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=axelrasmussen@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660865291; a=rsa-sha256; cv=none; b=Q4ckxGlXLw96BMdNfRPhfaE2b8MV+ssplAcnnXfj5J9bsRMui87GDGzMA3+7dQkuFksK9H 8v8J0BJNkpVw9H535yFowigMRpXvpvs1TsF/r/UsRzg7j+RamLDwVXrRclZpGvxZHv0QHB K5EmcsawDGnhRDRSibd15w1+B8a4sP8= X-Stat-Signature: 9ma9ooghhz7cxaym1jrf4kundeuz8rqb X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=edIm4Rg6; spf=pass (imf02.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=axelrasmussen@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2C11D806AF X-HE-Tag: 1660865291-27585 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000026, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Aug 17, 2022 at 3:15 PM John Hubbard wrote: > > On 8/17/22 14:13, Axel Rasmussen wrote: > > Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") > > Signed-off-by: Axel Rasmussen > > --- > > tools/testing/selftests/vm/Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile > > index d9fa6a9ea584..f2a12494f2d8 100644 > > --- a/tools/testing/selftests/vm/Makefile > > +++ b/tools/testing/selftests/vm/Makefile > > @@ -1,7 +1,7 @@ > > # SPDX-License-Identifier: GPL-2.0 > > # Makefile for vm selftests > > > > -LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h > > +LOCAL_HDRS += $(selfdir)/vm/local_config.h $(selfdir)/../../../mm/gup_test.h > > Hi Alex, > > Thanks for fixing up this build, it's always frustrating to finally > finish working on something, only to find that the selftests build is > broken! > > This looks correct, and also I've tested it locally, and it works. So > please feel free to add: > > Reviewed-by: John Hubbard > > > A couple of follow-up thoughts: > > 1) I recalled that hmm-tests.c in the same directory also needs > gup_test.h, and wondered if that was covered. And it turns out the the > relative "up and over" include path is done in hmm-tests.c itself, > instead of in the Makefile, like this: > > /* > * 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" > > It would be nice (maybe follow-up polishing for someone) if this were > done once, instead of twice (or more?) via different (source code vs. > Makefile) mechanisms. Hmm, I suppose the way to clean this up would be to have the Makefile compute this once, and pass in "-I $(selfdir)/../../.." to the compiler so we could just "#include " directly? If there aren't objections to something like that being too weird, I can write a follow-up patch which does that. > > 2) Commit f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") > claims that it is now required to "make headers_install" before building > the selftests. However, after applying your fix (not to imply that there > is anything wrong with the fix; it's fine), I am still able to build > vm/selftests, directly after a top-level "make clean". > > I believe that this is because the selftests are directly including > gup_test.h, via relative up-and-over paths. And I recall (and also did a > quick dry run, to be sure) that this internal gup_test.h header is not > part of the headers_install list. So that seems to be all working as > intended. But I wanted to say all of this out loud, in order to be sure > I fully understand these build steps. I agree this is working as intended, my understanding is that "make headers_install" is really for the stuff under include/uapi/*, whereas headers under mm/ or lib/ aren't really meant to be "exposed to userspace" except for these particular selftests. So including them directly instead of looking for them under usr/include/ is intentional. > > > thanks, > -- > John Hubbard > NVIDIA