Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3976228pxk; Tue, 29 Sep 2020 10:48:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1er/8lrOP3zuotvz3Llb9rivIhqnd9dYW8xxoDW/wRDyvZo6Cl7MLC30PW007fjWEU0bR X-Received: by 2002:a50:d64f:: with SMTP id c15mr4526048edj.248.1601401697636; Tue, 29 Sep 2020 10:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601401697; cv=none; d=google.com; s=arc-20160816; b=p7Zw3fmxZTmZYJfRz/WgnKyVvTjfzCx8CuY4x89j4cjJAZLgRbO1jofyGZmxsatS4Y bzBPW8XYNJe0qxbWStBDaWBVe776nEZfnUagbRKespQSVX7dpZd3qv1Ul2Z5zGQXrRoT nKgaDQQsMPMbspiiWPoJq0n6Q1tayUMq5HkF4+AtE2kLkKOI9P5F0vw9IIaDzLV6qPt9 SJIb22anmIYpctltlVYuEYY12EQF0YPqIPLzCzxq1O7chAiuluJ9fRX0cXOfTt2hIaI1 Wq+Bg686iuUbWuS/+me6TTBCSc5OeykZAS9s5UBceeAV6Fpp0KxUe2mAC7LE4aHnNwZD F0FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uNB6W6VUgOF7PVI0O4uW24Wk0Hp70vGOsM51NQ2J+Xo=; b=ZteSYs6KZ+0+inTQV29Y6E0fyRxv8Tc2Vn1vwVGpmS1JpLuxs6rxKoz79upet5og6N oTZury9F8qXUYHHLYJka8TDT3ChKG5aRco3KIafncRVkU+BkGoooVXybpIUltbDjjTdi 5M4OITUJxziriXSwBnEatx35C9s0JgqqwG/fRNQNAWHcl8bhT3vEdBA9Bl+RA9U8onSl uhjuBmaT/3eXQE+GyhC801d0ubW+35/HA0GLJESJqnJor5TOIk8aAIg0/iZrkvxR58QQ gN1e7hNd9PhuYo/G1upxPJUjKKVychige357Z/RFOCOjrTnIo+x4vtK+J9OJrMgAkL2A VrKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=T25zSwWn; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr24si3144867ejb.321.2020.09.29.10.47.54; Tue, 29 Sep 2020 10:48:17 -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=@nvidia.com header.s=n1 header.b=T25zSwWn; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729943AbgI2Rod (ORCPT + 99 others); Tue, 29 Sep 2020 13:44:33 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:16614 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgI2Roc (ORCPT ); Tue, 29 Sep 2020 13:44:32 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 29 Sep 2020 10:44:19 -0700 Received: from [10.2.53.30] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 29 Sep 2020 17:44:32 +0000 Subject: Re: [PATCH 2/8] selftests/vm: use a common gup_test.h To: Jason Gunthorpe CC: Andrew Morton , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ralph Campbell , Shuah Khan , LKML , , , , References: <20200928062159.923212-1-jhubbard@nvidia.com> <20200928062159.923212-3-jhubbard@nvidia.com> <20200928125739.GP9916@ziepe.ca> <6481e78f-c70d-133a-ff4a-325b5cd8fd5d@nvidia.com> <20200929163507.GV9916@ziepe.ca> From: John Hubbard Message-ID: Date: Tue, 29 Sep 2020 10:44:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200929163507.GV9916@ziepe.ca> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601401459; bh=uNB6W6VUgOF7PVI0O4uW24Wk0Hp70vGOsM51NQ2J+Xo=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=T25zSwWnUbC5wggeyQkeiG3SpY0bF9dllCWrcl9qmeMPam+QqfE5yXi725BbPimLw uMGGWVg+kObDn3P6CVyIiiSpdYQhkt19mBrUU49eM9Xygp1gpM++3NMGhCgpYRy9Ax 6AtHWa8ndJVmvWK2H+hmkTRX8ePqTzQ9AfDAglOnTtB4qSJa+v1KWKsiienZfPvO2f Da5doU60TAsENipzY0Owwuuso8AjyDBo/akCrdDwvx7CuL/T0U2hIVYX8wCo9tdFu6 ogkDtq1tLCiKr0kvhN3cQ73Svdd7FPVnYHnshz7+mQ8u9UgeVb0DC1jcRrmOJzaf2H ZCBlQv0MjQf7g== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/29/20 9:35 AM, Jason Gunthorpe wrote: > On Mon, Sep 28, 2020 at 01:10:24PM -0700, John Hubbard wrote: >> On 9/28/20 5:57 AM, Jason Gunthorpe wrote: >>> On Sun, Sep 27, 2020 at 11:21:53PM -0700, John Hubbard wrote: >>>> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile >>>> index d1ae706d9927..9cc6bc087461 100644 >>>> +++ b/tools/testing/selftests/vm/Makefile >>>> @@ -130,3 +130,5 @@ endif >>>> $(OUTPUT)/userfaultfd: LDLIBS += -lpthread >>>> $(OUTPUT)/mlock-random-test: LDLIBS += -lcap >>>> + >>>> +$(OUTPUT)/gup_test: ../../../../mm/gup_test.h >>> >>> There is no reason to do this, the auto depends will pick up header >>> files, and gup_test.h isn't a generated file >>> Oh, I misread your comment! You were talking about this Makefile dependency that I'm adding, rather than the ../'s in the path. Well, for that though, it also has to stay as shown in this patch, because of this: I don't see any "gcc -m" type of dependency generation pass happening in this relatively simple Make system. And so, without including an explicit header file dependency (at least, that's the simplest way), changes to gup_test.h are not detected. Both the Makefile code and the observed behavior back this up. (I expect that this is because there is less use of header files in this area, because most unit tests are self-contained within a single .c file.) >> >> It is less capable than you might think. Without the admittedly ugly technique >> above, it fails to build, and as you can see, the include paths that are fed to >> gcc are just a single one: usr/include: >> >> $ make >> make --no-builtin-rules ARCH=x86 -C ../../../.. headers_install >> gcc -Wall -I ../../../../usr/include gup_test.c >> /kernel_work/linux-next-github/tools/testing/selftests/kselftest_harness.h >> /kernel_work/linux-next-github/tools/testing/selftests/kselftest.h >> ../../../../mm/gup_test.h -lrt -o >> /kernel_work/linux-next-github/tools/testing/selftests/vm/gup_test >> make[1]: Entering directory '/kernel_work/linux-next-github' >> gup_test.c:10:10: fatal error: gup_test.h: No such file or directory >> 10 | #include "gup_test.h" >> | ^~~~~~~~~~~~ > > You are supposed to use > > #include "../../../../mm/gup_test.h" Good, I'll leave it as I had it. > I have no idea what weird behavior the makefile is triggering that the > above include works > See the commit description for yet another Makefile weird behavior point. :) thanks, -- John Hubbard NVIDIA