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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCF4CC54EBC for ; Tue, 10 Jan 2023 10:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231517AbjAJKGe (ORCPT ); Tue, 10 Jan 2023 05:06:34 -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-Google-Smtp-Source: AMrXdXsFgWkzbQ2X01cVjAwNnoWvoKKf9DNAG5yZ3Ygp1x3LFRmRcYVTqXVI6DFXgV0rPJV/rKWJYA== 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 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