Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6756232rwd; Tue, 6 Jun 2023 01:10:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vOu/HYzR7pExWnxKzCkkplAc6uwdNrZIR8dID9sbxctpvjtbtk1g/gnjPajThMi1hsbfn X-Received: by 2002:a17:90b:3712:b0:253:2ddd:4a36 with SMTP id mg18-20020a17090b371200b002532ddd4a36mr258017pjb.6.1686039006819; Tue, 06 Jun 2023 01:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686039006; cv=none; d=google.com; s=arc-20160816; b=jpjIF1d9i5kxLKCcV6whfZQj1G6WpALawJCV3D00AaGirqTrbcEs67pLLQcC5N9bwj 4pbFoig9YimDd5QGA35WxOhY5WuanozKjrTyrNumoqaqoJVAEe02ulRCjzIXDhXxqiAb P9eh3bVCAMoQTxtzGUclR1xGMWBO0nClAcV3MtF8eI+I4EfAqI67xsePhw7ckdcTD06+ 26maF0WaYcQEq3KkYpZIX+X8NfYi22LyzMuWU3++qV2CCr3NMvXOv1leNdfPgjBvUQWt 99GBV+rbD9FEF9TCaL72FnAGdu7o9pLrtfQrFy4HzB1rUNT27JwoirkOWkLgyAkewEy1 EOLQ== 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=GfQXi2O45pQjC/Qp+NSVXwS5kDzau7wGnRxOjIDkpqY=; b=gsfMuXVXs5vpARrA6AVXjA3vah7NXAgqNEXbEOm28PILxWUD5i6gCAH3FqQZE/qiBD +2G5EQrrU+2bfeQVlTt/OBA0L4ijdcTnDRIuVPe2ewv0p62oCgp3lpbYeOFmUw/1wss7 xQ7BKVdOJWRfBfFjakEQKgQoQp5zWVHoz8iZFc3b+sQmy8ZAFn+Le0THhXQKHIkSR/rV 4VKs/qO2Ke4w3bHQSjhoQnpbqN3GGw2IEDTOz80R21iJtwy1n686tcLaki/bv+OVujDs +HioqNsF7K5TC3prrSPYx/nwOx0oZUF5qKKQmMFakiwYQQPctzQSiBiDxi7GoY7HTaxm S7IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KvYkoem2; 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 b13-20020a17090aa58d00b002470ea7f67fsi8777929pjq.3.2023.06.06.01.09.53; Tue, 06 Jun 2023 01:10:06 -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=KvYkoem2; 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 S236337AbjFFH6p (ORCPT + 99 others); Tue, 6 Jun 2023 03:58:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236167AbjFFH60 (ORCPT ); Tue, 6 Jun 2023 03:58:26 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6B01FD7; Tue, 6 Jun 2023 00:55:46 -0700 (PDT) Received: from [192.168.10.48] (unknown [119.152.150.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 5D6516602242; Tue, 6 Jun 2023 08:55:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686038138; bh=16/hORSZZsCnXMLprufrbcrkPHQ/ZtHj8guWXjMMmvo=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=KvYkoem2SbKT/M9jRwwrkYvg017GNTT8CVZYApJnmMd/C6ZXaqSOweAc7q78EcQEG z/rWjRXBVfC4LAIOwPRedMxCK5jS+4mKCyGvIRWtLhobIr87rBPOdaF28aCKk32+Bn acMDIJPbi8HrrI7Em7/euPHXXZAZQcdNl+bedQZCU4BvkjihpC85p0tUr5TMgK+qp0 nIN/BBsZm3WwR+1toXYUFYtujzKi0UweDvwgxlxUElJmLCRDXW2upnkB2R8JwEItYv CLZExNDRu+Pe33+Ybh09iZXzon15y/NzmVYOMfQOScCGpHik/qEJlv/GLverLq3+a2 2gBYhWj9+Ak2g== Message-ID: <22d7a678-7f8b-a6ef-d280-f5c0ad3e5dbb@collabora.com> Date: Tue, 6 Jun 2023 12:55:32 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: Muhammad Usama Anjum , David Hildenbrand , Peter Xu , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Subject: Re: [PATCH v3 08/11] selftests/mm: fix build failures due to missing MADV_COLLAPSE Content-Language: en-US To: John Hubbard , Andrew Morton References: <20230606071637.267103-1-jhubbard@nvidia.com> <20230606071637.267103-9-jhubbard@nvidia.com> From: Muhammad Usama Anjum In-Reply-To: <20230606071637.267103-9-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/6/23 12:16 PM, 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. > > Reviewed-by: David Hildenbrand > Cc: Peter Xu > Cc: Muhammad Usama Anjum > Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum > --- > 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