Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7549171rwl; Tue, 10 Jan 2023 02:12:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvQzcLG3ZXO1utGrv4z9h0f1R7IyDyVbhKW/YvstkYtnJOS49VTd+7WInn9ZRO7vaNYdh2Q X-Received: by 2002:a17:902:9a87:b0:193:37c1:9b0d with SMTP id w7-20020a1709029a8700b0019337c19b0dmr4389956plp.55.1673345558631; Tue, 10 Jan 2023 02:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673345558; cv=none; d=google.com; s=arc-20160816; b=JmBPOwHzbrJ/8lWJgjfv3CraERvahFoTxp9nGJsSr/sNnj2exXJ1tow5gBd/ohQ5f7 kJre6CXFKZ11ocQLa7SOC7uGCkdxSoFkRQkoe0VJGW3PqxtDfhLBcXXtvVJIkEkPDeqf GhxDhAfSO9kiOy2ZZSx+JQmwWAiPcrbiRBNph7iRx7z7bfeRW6RDWEmDJ0IAIOidppWy IVx+GeJb9txODk66U2bj0f8zMXM17QZr+yuGgMOWb11Vx+Jc+KX5oLFmDs6MG3b6Hm7X KnYlk5kgd3lc/wBUni0S6eLpXZKZDk9z65/IKuwgnZ5/7FJNOiLI1nfTO3K4TYrvQPdz lmuQ== 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:subject :organization:from:content-language:references:cc:to:user-agent :mime-version:date:message-id:dkim-signature; bh=pQos0rL6v0IJhlQcBZMrcxW60aPh1eJ2JqufvK5QrGs=; b=d52BwjQngkkeDC46YzXmbHX9RD8DL44xrF/xbvA2tuCZNNteVvnuAMtblJvkXWJRdh QoRy5l2zEKiLJ/8NYEmm7xZMEWx/VVPCbiBKZDoi/z+oZktOQg7DMEn0+NHMVGn1QzC7 BO7ycmWFWeOCw/hX+lEVWeDv+o+njNpuzh9ubzA7MSwEdj7BBmUazQMgYOtbdRb55bQ4 WvJcSHJm5NiZTyyrZEZbtEnnO+Z6rynIrv6qry3vyaKR2MImUvZ7qVGX3qvNF2repvM/ p95N+hGAjFOrONnFTc9MwNP6NpPURMyC9dUOjqOucwnQYeU8WffppRMV1T54zULpGqsR kDLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GSrgvO9o; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a170902744700b00190d86865e9si10706401plt.368.2023.01.10.02.12.32; Tue, 10 Jan 2023 02:12:38 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=GSrgvO9o; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbjAJKGb (ORCPT + 53 others); Tue, 10 Jan 2023 05:06:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231332AbjAJKG2 (ORCPT ); Tue, 10 Jan 2023 05:06:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69D250157 for ; Tue, 10 Jan 2023 02:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673345142; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQos0rL6v0IJhlQcBZMrcxW60aPh1eJ2JqufvK5QrGs=; b=GSrgvO9ofcKnCj6ymkM+QUYyL8oyM1HdezXXINbjkj7WlTxMn9u1LezadMen15GQMHQoYl Qsj2wQLtI5usO8YrUDDf0G8ignQ68/tBNsxza5loLSBOuw556SDh9JbG9yJ/+7TTRDxVF1 99PxFUCvqqj8nW31gcuBrTxwOp8UYIc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-425-v-yYPawzOTu1YI4m-PPqlA-1; Tue, 10 Jan 2023 05:05:41 -0500 X-MC-Unique: v-yYPawzOTu1YI4m-PPqlA-1 Received: by mail-wm1-f71.google.com with SMTP id bi11-20020a05600c3d8b00b003d9ebf905c9so3485041wmb.5 for ; Tue, 10 Jan 2023 02:05:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :content-language:references:cc:to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pQos0rL6v0IJhlQcBZMrcxW60aPh1eJ2JqufvK5QrGs=; b=IXXL8t4j8FMy7OAfPFNAv4K8k29xRa857AWWbDoFVIs6Y4SFRVQ5sphX2RN6BKLm6N CnJy0ZbiXbcBk1l+3VAhEqunSQHmqtxq/fUvqZzUOkzFEQaQXj7rGSSx9LgidxO1T+A2 4OTNP3zuUmnrl13/XcmRC5+FACC42NJ9q7CrGjhHKXNDjz2XtJBPV2GZKuc9Nx1bSGmw fkF3iwkyqw0nKgrXTnMQzlCOKE0O2hfpEgIrzPLegXKPBrFT9+YJ0f+x45atoTy96Wjz YbylOig/cITUsNcAQ97nRuS1DF4M8hbGf9kdFnWHmUYxzKzZeJwca7SZJGgWpZA5poLb uKiA== X-Gm-Message-State: AFqh2kpZA7B/mSsDXI1UnO4niS9B+QcW58+ZKpapVoZaa4M8YquMNzts s4JCGt0kFey0omOoiCp0xbYlEkIJvzBhAD0m8M7GGsG/nZ+4rv3r2WZiklZkqA9ackMrridn38G fdl1LVqWXNvSyS0w0xrT7QCcs X-Received: by 2002:a05:600c:3d8a:b0:3d3:4406:8a37 with SMTP id bi10-20020a05600c3d8a00b003d344068a37mr48796535wmb.41.1673345140650; Tue, 10 Jan 2023 02:05:40 -0800 (PST) X-Received: by 2002:a05:600c:3d8a:b0:3d3:4406:8a37 with SMTP id bi10-20020a05600c3d8a00b003d344068a37mr48796515wmb.41.1673345140308; Tue, 10 Jan 2023 02:05:40 -0800 (PST) Received: from ?IPV6:2003:cb:c708:4200:65d9:4d0d:bb61:14c8? (p200300cbc708420065d94d0dbb6114c8.dip0.t-ipconnect.de. [2003:cb:c708:4200:65d9:4d0d:bb61:14c8]) by smtp.gmail.com with ESMTPSA id bg42-20020a05600c3caa00b003b4cba4ef71sm21771935wmb.41.2023.01.10.02.05.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 02:05:39 -0800 (PST) Message-ID: Date: Tue, 10 Jan 2023 11:05:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Mirsad Goran Todorovac , linux-mm@kvack.org Cc: Andrew Morton , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <0f117203-3227-cd16-61c2-2dd3de75ecc7@alu.unizg.hr> <0ee389dc-5e47-5b7e-4db5-637eb2b3fbc9@redhat.com> <0e692e52-0a4f-3892-ed25-f3fa12892b6f@alu.unizg.hr> Content-Language: en-US From: David Hildenbrand Organization: Red Hat Subject: =?UTF-8?Q?Re=3a_PROBLEM=3a_selftest/vm/cow=2ec_failed_to_compile_?= =?UTF-8?B?KOKAmE1BRFZfUEFHRU9VVOKAmSB1bmRlY2xhcmVkKQ==?= In-Reply-To: <0e692e52-0a4f-3892-ed25-f3fa12892b6f@alu.unizg.hr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 09.01.23 22:41, Mirsad Goran Todorovac wrote: > On 1/9/2023 5:42 PM, David Hildenbrand wrote: > > Hi, thank you for your reply. > >>> I hope this is enough information for you to debug the issue. >>> >>> I am standing by for any additional diagnostics needed. >> >> Won't userfaultfd.c fail in a similar way? >> >> Anyhow, khugepaged.c jas >> >> #ifndef MADV_PAGEOUT >> #define MADV_PAGEOUT 21 >> #endif >> >> So most probably we should do the same. > > Actually, David, it turned out that userfaultfd.c compiled > out-of-the-box, and side-by-side comparison showed that it also included > "/home/marvin/linux/kernel/linux_torvalds/usr/include/asm-generic/mman-common.h" > > The only remaining difference was including , which fixed > the issue w/o #ifdef ... #endif > > Hope this helps. > > Please find the following diff. > > Regards, > Mirsad > > ------------------------------------------------------------------------------ > diff --git a/tools/testing/selftests/vm/cow.c > b/tools/testing/selftests/vm/cow.c > index 26f6ea3079e2..dd8cf12c6776 100644 > --- a/tools/testing/selftests/vm/cow.c > +++ b/tools/testing/selftests/vm/cow.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > #include > I already sent a different fix [1]. I suspect when including linux/mman.h, it would still be problematic with older kernel headers that lack MADV_PAGEOUT (< v5.4). But yeah, I saw that userfaultfd.c was fixed that way: commit b773827e361952b3f53ac6fa4c4e39ccd632102e Author: Chengming Zhou Date: Fri Mar 4 20:29:04 2022 -0800 kselftest/vm: fix tests build with old libc The error message when I build vm tests on debian10 (GLIBC 2.28): userfaultfd.c: In function `userfaultfd_pagemap_test': userfaultfd.c:1393:37: error: `MADV_PAGEOUT' undeclared (first use in this function); did you mean `MADV_RANDOM'? if (madvise(area_dst, test_pgsize, MADV_PAGEOUT)) ^~~~~~~~~~~~ MADV_RANDOM This patch includes these newer definitions from UAPI linux/mman.h, is useful to fix tests build on systems without these definitions in glibc sys/mman.h. [1] https://lkml.kernel.org/r/20230109171255.488749-1-david@redhat.com -- Thanks, David / dhildenb