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 X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF63C433E7 for ; Sun, 18 Oct 2020 19:12:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8CC6422282 for ; Sun, 18 Oct 2020 19:12:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="lnYHg7tR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CC6422282 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B57A76B005D; Sun, 18 Oct 2020 15:12:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B097E6B0062; Sun, 18 Oct 2020 15:12:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F58A6B0068; Sun, 18 Oct 2020 15:12:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 67FBE6B005D for ; Sun, 18 Oct 2020 15:12:57 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F30EC180AD811 for ; Sun, 18 Oct 2020 19:12:56 +0000 (UTC) X-FDA: 77385993594.06.fan82_0f167e927230 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id CCCD1100BC99B for ; Sun, 18 Oct 2020 19:12:56 +0000 (UTC) X-HE-Tag: fan82_0f167e927230 X-Filterd-Recvd-Size: 4988 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Sun, 18 Oct 2020 19:12:56 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 18 Oct 2020 12:11:22 -0700 Received: from [10.2.63.174] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 18 Oct 2020 19:12:54 +0000 Subject: Re: [patch 16/40] selftests/vm: use a common gup_test.h To: Matthew Wilcox CC: Linus Torvalds , Andrew Morton , Jonathan Corbet , Jerome Glisse , Linux-MM , , Ralph Campbell , "Shuah Khan" , Jason Gary Gunthorpe References: <20201017161314.88890b87fae7446ccc13c902@linux-foundation.org> <20201017231425.0OZYgQdDr%akpm@linux-foundation.org> <20201018190327.GN20115@casper.infradead.org> From: John Hubbard Message-ID: <9eaf122b-e877-e104-6175-13d48c13ac85@nvidia.com> Date: Sun, 18 Oct 2020 12:12:53 -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: <20201018190327.GN20115@casper.infradead.org> 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=1603048282; bh=MO9ORh0C2doNOpWqZJ0xuaxzV5H/WDp2WKaa1sE7MOk=; 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=lnYHg7tRfAk0vkgdemf0u0wgZi6KXbwveLSD5oeLXRe17UbIAGMyT3De1M86MbCKY FqoRJxOSI0kqWS+lP/wa00TucREYq5eWHM8JeXds+xOizEHQy/N/SYcxKxbFc6f8ei EE/nHkFQMYJR2Tso+uv0HCnAAp1Ppvoy/R7zioe9s8flXnE7gk6ZPO9sh0eND618Nc V8N6imRBWBlpIw+E9iDAam01hBOaqCR7JBsRrIWytabAdXy3Xi+hPr89b0cD9D3MOk UsnqLAEskLBfKSFo19b1HHYrJrxSMB6dbh/HM4io+RQmqp3lMJ1MJ2Qb78yw0GaPuM uwiDGpayRLSkw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/18/20 12:03 PM, Matthew Wilcox wrote: > On Sun, Oct 18, 2020 at 11:50:10AM -0700, John Hubbard wrote: >> On 10/18/20 9:18 AM, Linus Torvalds wrote: >>> On Sat, Oct 17, 2020 at 4:14 PM Andrew Morton wrote: >>>> >>>> --- a/mm/gup_test.c~selftests-vm-use-a-common-gup_testh >>>> +++ a/mm/gup_test.c >>>> @@ -4,22 +4,7 @@ >>>> +#include "../../../../mm/gup_test.h" >>>> +++ a/mm/gup_test.h >>> >>> There is no way I'm applying a crazy patch like this. >>> >>> That can't be right. >>> >>> And even if it works, it *still* isn't right. >>> >>> Linus >>> >> >> I feel the same way about the ridiculous ../..'s in the include path. But that >> seemed to be the accepted way (I even have an email that I'm trying to find, in >> which someone confirmed that...ah here, it is [1], and I'm adding Jason to CC) >> for the odd situation of sharing a header file between kernel and user space, >> for the kselftest world. >> >> If there's a different acceptable way, I'd be delighted to use that. > > See where it says: > > CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) > > Does adding an extra -I../../../../mm to that line not do the trick? > Yes, that works. Here's a differential patch on top of the series to change it over: diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index a9332a7cf33f..350d37c21671 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -23,7 +23,7 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/') # LDLIBS. MAKEFLAGS += --no-builtin-rules -CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) +CFLAGS = -Wall -I ../../../../usr/include -I ../../../../mm $(EXTRA_CFLAGS) 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 1bef28174f3f..a8adda6edb07 100644 --- a/tools/testing/selftests/vm/gup_test.c +++ b/tools/testing/selftests/vm/gup_test.c @@ -6,7 +6,7 @@ #include #include #include -#include "../../../../mm/gup_test.h" +#include "gup_test.h" #define MB (1UL << 20) #define PAGE_SIZE sysconf(_SC_PAGESIZE) thanks, -- John Hubbard NVIDIA