Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1645942pxb; Sat, 16 Oct 2021 15:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdhlRtRoKgAYNVosJAZaCWS4N9tC482BYm3BwJ4mzFCpWo/BGeo1sM9FGda02DvmtyWMWm X-Received: by 2002:a17:902:d50b:b0:13f:69af:5ae7 with SMTP id b11-20020a170902d50b00b0013f69af5ae7mr18804922plg.39.1634424506487; Sat, 16 Oct 2021 15:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634424506; cv=none; d=google.com; s=arc-20160816; b=uGZpAv8fC0KW+xzvbAfgOyBOvOoYHsdEno0bEzyu4KLoy6MlKcbmns+50efEMcxgI+ l8VWubibaY+KYR602Ap5hXo7exN5WQgk2yst9gmoyrSbGoJYeD5/2Cz28kK5jLy1BOa2 3b+KOUrPh87XattF5GBnkMn8homfAnyZliTN0b2hB8zAFBZh/RihP8a+lXLkvLxKVRaH ++hnOuqvLn6vwp2OBm0e3X+Ca89sh+W6h6v8Dql3DwPJYfSt4qxfmvoda+pPf/hmwmo/ PmXQIEmE+ViAte7rC4DoWR2NePoGqCJHifcPCkC+l6Jfw0sPVdnfC+GPJhYldZyiw636 0GXg== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=/+Q0m93eDQUsQs996BqvSBuleHVWdL0Hp5smaHrBxAk=; b=GiTHDfH5OwIs4rDsF73K1mt3i5nIVNzb1ClIJWV621OPu6syFkdn26kqnfUXwRmC+u jjJ8ilczxaqqjn3xjV1JtErsL6Q29k6YJdUYZ5pl36aIr9S+4qXp2pDvSnf2wWS6t6RO Msaq69LQRTKbQyAoWpbeoqorlyeC8L6UFEsiBNnqqzVwCKrLvaLnIoe2omH6D2DWc10p tcRw+GgZXSUKT/4XWr8f4oGr2ZmEApFTFkWRsu6M/nqB5FYNE+Y/POiA2CLq8RL/HgRo LdmCPNw4WDCQ2Q7dSbg7/L0RhMk2masumyYHb25IdHjGgfag57sxAtkxskprYjK99EVq Sbuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eBVrbuDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r13si14496053pgr.342.2021.10.16.15.47.49; Sat, 16 Oct 2021 15:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eBVrbuDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S237055AbhJOPtP (ORCPT + 99 others); Fri, 15 Oct 2021 11:49:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20958 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234829AbhJOPtO (ORCPT ); Fri, 15 Oct 2021 11:49:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634312827; 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=/+Q0m93eDQUsQs996BqvSBuleHVWdL0Hp5smaHrBxAk=; b=eBVrbuDgxjnXaUnPuBKwpwgU0pnsn4fIgGJwYSfzb3wVYQTfO5i7J1woZxFmUaBiwigk/a d28rUgLbq6TvErbOvWSpU38hpzQtqxih8rRCXJExI01iJ1iORDiA1KGJUPTAAzeae208sI edjZlbP02yPp6toKpF7ihhmmsNHnMiM= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-f-t_n8O1PGKSalit9L18lQ-1; Fri, 15 Oct 2021 11:47:06 -0400 X-MC-Unique: f-t_n8O1PGKSalit9L18lQ-1 Received: by mail-wr1-f71.google.com with SMTP id j19-20020adfb313000000b00160a9de13b3so6103706wrd.8 for ; Fri, 15 Oct 2021 08:47:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=/+Q0m93eDQUsQs996BqvSBuleHVWdL0Hp5smaHrBxAk=; b=xlRNtAjMrz/EqTOJu/0gB1mBy/t8kc8AaUcU+FWLFN4F88ZtGoCqdUgAPi9Dpomaaa dq59xZX9phGiMgIWpDHmA8kTNqMADAlmeL87FIDO66FVwwK8c1vmLfsmRAxqOJzqsHzQ /kqmNV3nErmduMQbB30iaOTeBCIzvAL61q4ODSjLm0B1qWpHafeS4jzsJvHU/SJdCjxO lQaxwqFDwkGno5IW3pSovPKu3GWREue0/59e2YOPgx//06Yh20ZnT3C4sssq96DBetNp baiLwIGuLSPhK+ikfaLGOX+YGwjnYk3L76tbopLzaOha0RfXtXxnKyMhbz9e38aXDS+Q rTSQ== X-Gm-Message-State: AOAM532laTZMlb5agDdLHkjlrJInQnoxkUq9Z/mnwN1RK6dJlMgNUI/M zbBq9Ob7nluOy2PukGvFrf7n9tw+h2CoL/WWNBEwvk+fk0DMhfJGj3YaDHwNisRnzi7mb3JRYQO FwQuPKLPDZAggd4RxzphDYZAY X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr12990757wmq.67.1634312824940; Fri, 15 Oct 2021 08:47:04 -0700 (PDT) X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr12990737wmq.67.1634312824703; Fri, 15 Oct 2021 08:47:04 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6a01.dip0.t-ipconnect.de. [91.12.106.1]) by smtp.gmail.com with ESMTPSA id w1sm10807575wmc.19.2021.10.15.08.47.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 08:47:04 -0700 (PDT) Message-ID: Date: Fri, 15 Oct 2021 17:47:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: selftests/vm madv_populate.c test Content-Language: en-US To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <0a20f6b6-5985-8b3e-a577-7495dcf7d2b8@redhat.com> <3a06d58e-7301-6fbc-a305-d9f7c7220843@linuxfoundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <3a06d58e-7301-6fbc-a305-d9f7c7220843@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.10.21 17:45, Shuah Khan wrote: > On 9/18/21 1:41 AM, David Hildenbrand wrote: >> On 18.09.21 00:45, Shuah Khan wrote: >>> Hi David, >>> >>> I am running into the following warning when try to build this test: >>> >>> madv_populate.c:334:2: warning: #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" [-Wcpp] >>>     334 | #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" >>>         |  ^~~~~~~ >>> >>> >>> I see that the following handling is in place. However there is no >>> other information to explain why the check is necessary. >>> >>> #if defined(MADV_POPULATE_READ) && defined(MADV_POPULATE_WRITE) >>> >>> #else /* defined(MADV_POPULATE_READ) && defined(MADV_POPULATE_WRITE) */ >>> >>> #warning "missing MADV_POPULATE_READ or MADV_POPULATE_WRITE definition" >>> >>> I do see these defined in: >>> >>> include/uapi/asm-generic/mman-common.h:#define MADV_POPULATE_READ       22 >>> include/uapi/asm-generic/mman-common.h:#define MADV_POPULATE_WRITE      23 >>> >>> Is this the case of missing include from madv_populate.c? >> >> Hi Shuan, >> >> note that we're including "#include ", which in my >> understanding maps to the version installed on your system instead >> of the one in our build environment.ing. >> >> So as soon as you have a proper kernel + the proper headers installed >> and try to build, it would pick up MADV_POPULATE_READ and >> MADV_POPULATE_WRITE from the updated headers. That makes sense: you >> annot run any MADV_POPULATE_READ/MADV_POPULATE_WRITE tests on a kernel >> that doesn't support it. >> >> See vm/userfaultfd.c where we do something similar. >> > > Kselftest is for testing the kernel with kernel headers. That is the > reason why there is the dependency on header install. > >> >> As soon as we have a proper environment, it seems to work just fine: >> >> Linux vm-0 5.15.0-0.rc1.20210915git3ca706c189db.13.fc36.x86_64 #1 SMP Thu Sep 16 11:32:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux >> [root@vm-0 linux]# cat /etc/redhat-release >> Fedora release 36 (Rawhide) > > This is a distro release. We don't want to have dependency on headers > from the distro to run selftests. Hope this makes sense. > > I still see this on my test system running Linux 5.15-rc5. Did you also install Linux headers? I assume no, correct? -- Thanks, David / dhildenb