Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7596168rwd; Tue, 20 Jun 2023 03:39:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7U8PkH00CiMoF84EgBNoB1ouopsJNBeVgW/n2qbo49wef/jXhtcakDgkVs/GT6b9GK7cGr X-Received: by 2002:a17:902:74c5:b0:1b0:6e16:b92c with SMTP id f5-20020a17090274c500b001b06e16b92cmr12162297plt.54.1687257592119; Tue, 20 Jun 2023 03:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687257592; cv=none; d=google.com; s=arc-20160816; b=IjdUbmRLr38EF+qJECyv+rO7oZJWcKlu2P5eyMQH+ULVLX28A4dEY4OkvZvAgsHsGw avvq5/zElt4etUlrzSxlB0kHY7afnz1U5XFMaYj85lTIaXuEHhJe7BDo8m9bqEIqZsfT Y9bBsfNDKtDqU3eDCwpypX9WoXrW3XFNGygsc0uL7FNrSKVq8RvpHmsXIHEwx7WClhGa zd0mWhtWgcD4Lo2iprV3/0QXF87NQB7EivCA7e4u4pF4UtAhENL78ods5CvoZbFjTqD5 I9xfENlyRPR0xcb/33LFbQemnrQVCCwaZFl9CUhjv51Zd5i6VWEN1hLXelNbLc214Y0T bL5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=PIFx7jNY3iVIPJkg+ymleq1vafUYZpvKZQEulPZ4l44=; b=on7358DmynCeIPNvWS22rwnTgVSvSbIGjvLxnLKaffsV7tNZwHu30Ke7nEOWQyc2YY BwmSBevf1MCJ5shTc/wE3fCiH0QlbXvCHQxl0M3wWIGg8ng4NOmDcvnBTQZF/ynIw09L 8aBGN2UBpLNnGEDYfyk5aLZh+VHseaL+MQYZGNefIBYvTX67IoFLiOoAK+Ng+Eg2dQf2 /Q35jq7lZRHqguAxyilEZ/pZy4Sz4QDwnEasobsAGG1CyiE3mmq4PRhka3Eud05a8W4J RcdoR9cnQ4jhJIA9Ppoq4indwhg1m6Nyi8hrobvd6HrFy+waQ1UybK81w88dOOS07yVB ic1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mQJjtR8I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a170902d08a00b001b52e89895esi1582398plv.181.2023.06.20.03.39.38; Tue, 20 Jun 2023 03:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mQJjtR8I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbjFTKRZ (ORCPT + 99 others); Tue, 20 Jun 2023 06:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjFTKRX (ORCPT ); Tue, 20 Jun 2023 06:17:23 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0FBEA2 for ; Tue, 20 Jun 2023 03:17:22 -0700 (PDT) Received: from [192.168.10.54] (unknown [119.155.63.248]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 934E46603219; Tue, 20 Jun 2023 11:17:19 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687256241; bh=yWkS6pO416E5oq9sw7CdY2vXXy8yufI+SlXkoSBh3TY=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=mQJjtR8IcDbWExW9CfMbofKiPKmgOyXTZWjmobyxBDjDK6DQuFB1SsHjRzZAKabMG CvxLOPZ2n2/Rba+PL7BRfZYjbR+iReSA9GCMf6MKNoAJ+oSqm3Z9ptP03l3k7E7HDi thObNF7YFCWPEv1AbU6PSyLuj2nxR7CDZLhnlrz7tQLgZYtt5D4h3c+ZMUWuKkIYtF 8pK94nfjilWkWscv2iof7cU9prhPpKJc5bStqiQDeDamPHhCCNmloGL8AW1wxMpQ03 SDq5x4u7UvSqBjl8QHVGsGUfkDldHEIA2HSh+m4k+hzBdP13OAzF5OZ5iV9YpxNZFG ySkR95cc5JukA== Message-ID: <575a395c-0608-00da-3aa3-cbe4a5bd157e@collabora.com> Date: Tue, 20 Jun 2023 15:17:15 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Cc: Muhammad Usama Anjum , Andrew Morton , LKML , linux-mm@kvack.org, Peter Xu Subject: Re: [PATCH v2 08/11] selftests/mm: fix uffd-unit-tests.c build failure due to missing MADV_COLLAPSE Content-Language: en-US To: John Hubbard , David Hildenbrand , Oscar Salvador References: <20230620011719.155379-1-jhubbard@nvidia.com> <20230620011719.155379-10-jhubbard@nvidia.com> From: Muhammad Usama Anjum In-Reply-To: <20230620011719.155379-10-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/20/23 6:17 AM, John Hubbard wrote: > MADV_PAGEOUT, MADV_POPULATE_READ, MADV_COLLAPSE are conditionally > defined as necessary. However, that was being done in .c files, and a > new build failure came up that would have been automatically avoided had > these been in a common header file. > > So consolidate and move them all to vm_util.h, which fixes the build > failure. > > An alternative approach from Muhammad Usama Anjum was: rely on "make > headers" being required, and include asm-generic/mman-common.h. This > works in the sense that it builds, but it still generates warnings about > duplicate MADV_* symbols, and the goal here is to get a fully clean (no > warnings) build here. I've not looked in detail. But it seems like your first revision was merged and after that my cleanup has also been merged. My cleanup patch is adding correct header files and removing these duplicate defines: It is in mm-stable now. https://lore.kernel.org/all/20230619232244.81CB3C433C0@smtp.kernel.org > > Reviewed-by: David Hildenbrand > Cc: Peter Xu > Cc: Muhammad Usama Anjum > Signed-off-by: John Hubbard > --- > tools/testing/selftests/mm/cow.c | 7 ------- > tools/testing/selftests/mm/khugepaged.c | 10 ---------- > tools/testing/selftests/mm/vm_util.h | 10 ++++++++++ > 3 files changed, 10 insertions(+), 17 deletions(-) > > diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c > index dc9d6fe86028..8882b05ec9c8 100644 > --- a/tools/testing/selftests/mm/cow.c > +++ b/tools/testing/selftests/mm/cow.c > @@ -30,13 +30,6 @@ > #include "../kselftest.h" > #include "vm_util.h" > > -#ifndef MADV_PAGEOUT > -#define MADV_PAGEOUT 21 > -#endif > -#ifndef MADV_COLLAPSE > -#define MADV_COLLAPSE 25 > -#endif > - > static size_t pagesize; > static int pagemap_fd; > static size_t thpsize; > diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c > index 97adc0f34f9c..e88ee039d0eb 100644 > --- a/tools/testing/selftests/mm/khugepaged.c > +++ b/tools/testing/selftests/mm/khugepaged.c > @@ -22,16 +22,6 @@ > > #include "vm_util.h" > > -#ifndef MADV_PAGEOUT > -#define MADV_PAGEOUT 21 > -#endif > -#ifndef MADV_POPULATE_READ > -#define MADV_POPULATE_READ 22 > -#endif > -#ifndef MADV_COLLAPSE > -#define MADV_COLLAPSE 25 > -#endif > - > #define BASE_ADDR ((void *)(1UL << 30)) > static unsigned long hpage_pmd_size; > static unsigned long page_size; > diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h > index b950bd16083a..07f39ed2efba 100644 > --- a/tools/testing/selftests/mm/vm_util.h > +++ b/tools/testing/selftests/mm/vm_util.h > @@ -63,3 +63,13 @@ int uffd_register_with_ioctls(int uffd, void *addr, uint64_t len, > > #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) != 0) > #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1)) > + > +#ifndef MADV_PAGEOUT > +#define MADV_PAGEOUT 21 > +#endif > +#ifndef MADV_POPULATE_READ > +#define MADV_POPULATE_READ 22 > +#endif > +#ifndef MADV_COLLAPSE > +#define MADV_COLLAPSE 25 > +#endif -- BR, Muhammad Usama Anjum