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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 EAECAC2D0A8 for ; Mon, 28 Sep 2020 20:18:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E10C207E8 for ; Mon, 28 Sep 2020 20:18:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="mzXVXwiR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E10C207E8 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 C8F996B006E; Mon, 28 Sep 2020 16:18:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C3E2B6B0070; Mon, 28 Sep 2020 16:18:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B08456B0071; Mon, 28 Sep 2020 16:18:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 985866B006E for ; Mon, 28 Sep 2020 16:18:58 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6396B1DF3 for ; Mon, 28 Sep 2020 20:18:58 +0000 (UTC) X-FDA: 77313583956.10.bean88_4f0cf4127184 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 2085C16A0B9 for ; Mon, 28 Sep 2020 20:18:58 +0000 (UTC) X-HE-Tag: bean88_4f0cf4127184 X-Filterd-Recvd-Size: 4038 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 20:18:57 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 28 Sep 2020 13:17:16 -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; Mon, 28 Sep 2020 20:18:55 +0000 Subject: Re: [PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency 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-9-jhubbard@nvidia.com> <20200928130245.GQ9916@ziepe.ca> From: John Hubbard Message-ID: <982fd9bf-64cb-00e9-f092-13849c7cf7d9@nvidia.com> Date: Mon, 28 Sep 2020 13:18:55 -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: <20200928130245.GQ9916@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: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601324236; bh=O2i3Vdy5N6Vs0TRULMqHmrEurgd7OBZM5lfhatrbaRg=; 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=mzXVXwiRJ+Il0yV0xeEzTd7ksvI/MhOCIjEBbWjkvlITArH3Mqb9yFhwVo3s2Qq6H uRxhc98vGseLTO//ZeUc98XyvBExMD0JZbk9uO+fkSK9463sKShxdXO4PSHDhpVY6l 6ZRqsNpkB3oXpo/f3MA9WLP9zTxu58u59M5XbkWfXsLQaOWl/ABVQuCqG+7Qq111nG RmMzTPY8pK3CMb1292VSCjmeXOhODzka6F+vTjqwkUzp8fm3msMU+vpSJQCcvO7mmk w0cr273zgoiDsUaJpISMH9GmXR6RgXeCPeflmVz+1CC2bFmtBzYpgvvNBBcBgqQlOp KN5PBysEory5Q== 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 9/28/20 6:02 AM, Jason Gunthorpe wrote: > On Sun, Sep 27, 2020 at 11:21:59PM -0700, John Hubbard wrote: ... >> +gcc -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1 > > This gcc has to come from some makefile variable ahem, yes, that really should have just been $(CC), will change to that. > > This is kind of janky :\ > > Could we just not use libhugetlbfs? Doesn't it all just boil down to > creating a file in /dev/huge? Eg look at tools/testing/selftests/vm/hugepage-mmap.c > Well, the situation is a lot worse than that, because hmm-tests.c is using a few helper functions that end up pulling in more and more. My first attempt was actually in your direction: just grab a bit of code from the library and drop it in. But that ended up turning into several pages of code from quite a few functions and definitions, and it was looking maybe excessive. (I can look at it again, though. Maybe it feels less excessive if there are no other acceptible alternatives.) So then I thought, why not just *delete* those two routines from hmm-tests.c? But Ralph didn't like that because he notes that hmm_range_fault() loses some useful test coverage by being exercised with hugetlbfs. So finally I landed here, which is so far, the smallest change that would be potentially acceptible: a couple dozen lines, in order to selectively disable the problematic routines. Anyway, thoughts? I like the current approach but am open to anything that makes hmm-test Just Work for more people, on the *first* try. thanks, -- John Hubbard NVIDIA