Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5081380rdb; Tue, 12 Dec 2023 19:58:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+ulDX4/ryyWeKU5cQAPqaS6pqm5mn/Vy1ZV+N9U2TBpu3zyK/eGCc0Va6RKVYn5SG/GRZ X-Received: by 2002:a05:6a00:1aca:b0:6ce:2731:47b6 with SMTP id f10-20020a056a001aca00b006ce273147b6mr8776469pfv.22.1702439913333; Tue, 12 Dec 2023 19:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702439913; cv=none; d=google.com; s=arc-20160816; b=FnlyJh0/u1t8IaOa+zUh8SSFuoU/6VUO1pb0AxPNm1rK4IvApKMTZWlVvIk6OapDBb sv10O/8Q6kCNWwByhTeBb8Q0M2gR+8HKPDAYC+gsuHSAxosHli/1G148+vI+HPirPajl AJ44T5I9KzEI/TeCyee4KmdmsNXgBiXxFoAGeXk1ZhD3vovLAesOaRVRZiXIVMrZHOgy aqjSBUndVbqYGVUCQ5XM66Sk1gOKERB3VZGHj3EK+WsR/8E0OhC6+KyUxQO0Y8iVXvs+ svs4lsQX2kQnwEu94tC2kGoyvwXseRdRpyqoapyQJ2PLSZv14aF/dJLF4GIR+JYEDqKM rmEQ== 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=PJJ6PZ4PdvAEnXO9rbql7ErzFCtEYWEM+Rc7rg302IA=; fh=q9Y0fxZoxKRc2gXxAfkikYFshYzqtLffSpSmRA9FagQ=; b=NE6BGBvIMl90y0vovS22KepZztggzIq6tTty5823Gq4pcH1C/bBHJVOyP7j3k3Ng5i JMfSFKBpSmtKyZlACyxnw7gepkoxogpKYi38aMubamj2cs0Dh65Nloy3euEShyyE6dPJ DMYINGJLCJgWmu4RknhzP7NcN+9i8WHyCIC1S4dVvuUzb5Cw1G+q5ljdmhaXv7IpRCT7 kRe0BPysAIHE4YWhgEUXyHJ/45QqHtxNzo/gprLiB5sR1UIoe5yl8FnynxzcctQOpkDg PopXMDVtc9xggV4cNXoVNIlD4QqvvnfzR8keJMf3ZNk8y9+tWxwhCrX76FQKEAG3FxO8 ZU7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bYYRLl0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s3-20020a62e703000000b006cdd595606asi8559122pfh.392.2023.12.12.19.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 19:58:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bYYRLl0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B2F7D80896A3; Tue, 12 Dec 2023 19:58:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378460AbjLMD6P (ORCPT + 99 others); Tue, 12 Dec 2023 22:58:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235216AbjLMD6O (ORCPT ); Tue, 12 Dec 2023 22:58:14 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF87E99; Tue, 12 Dec 2023 19:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702439898; bh=11blm8HJnQ9+FMdEFOr+A0pNMEFB7Ju+WMZoc5kI8rI=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=bYYRLl0jzzJ/ry5xSjKpPL3Ta4LRbgeYJx3Vgef71CF0GIHSmOPdE+YzqWjksBsGW d7D6bFX9jKH/NKYYgsHD+Hx61y+8aPtGJxa6ftQOA3QNawyzS7/2OT0cIKohk7KXNp Ta0Z7jytlPEm/dv4XB9uu3kZ01TwCcxFvk3s0Ze97Vs4v5Ymo687c6GBYiBUjusNxM 4AOPIQ8M5YIedSlhMujT/VRpw91eaObFkbTObneLptFPAsgiB+2uvpkrAcskIWlrGP BneWrr9+wgMp1N0R+bLRE/Nh9xaP4mOWhjbsACvzgCMSli8o+QnXqTMCRcAy/AVDaa 4oW120hXsVqSA== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (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 madrid.collaboradmins.com (Postfix) with ESMTPSA id 9787637813F2; Wed, 13 Dec 2023 03:58:09 +0000 (UTC) Message-ID: <2e4a719b-f2b3-48db-99db-d96040d78b12@collabora.com> Date: Wed, 13 Dec 2023 08:58:06 +0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , David Hildenbrand , Suren Baghdasaryan , akpm@linux-foundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, lokeshgidra@google.com, peterx@redhat.com, ryan.roberts@arm.com, hughd@google.com, mhocko@suse.com, axelrasmussen@google.com, rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, jannh@google.com, zhangpeng362@huawei.com, bgeffon@google.com, kaleshsingh@google.com, ngeoffray@google.com, jdduke@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Peter Zijlstra Subject: Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test Content-Language: en-US To: John Hubbard , Mark Brown References: <50385948-5eb4-47ea-87f8-add4265933d6@redhat.com> <6a34b0c9-e084-4928-b239-7af01c8d4479@sirena.org.uk> <3240f4b5-081b-4075-851a-7d1cd86f4333@redhat.com> <3eadd79c-c02a-495f-92c0-0315046ef59f@nvidia.com> <3d22f342-280f-4a44-87f4-8cca291cfce7@sirena.org.uk> <0f97db9c-5b86-4f56-8463-2520fe79f709@sirena.org.uk> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 19:58:30 -0800 (PST) On 12/13/23 7:14 AM, John Hubbard wrote: > On 12/12/23 07:12, Mark Brown wrote: >> On Mon, Dec 11, 2023 at 12:29:58PM -0800, John Hubbard wrote: >>> On 12/11/23 12:21, Mark Brown wrote: > ... >>> Or maybe there is an innovative way to do all of this, that we have >>> yet to think of. >> >> We do copy files into tools/include at random times which makes sense >> for things that aren't uapi, and we are putting bits of uapi there >> already so we could just expand the set of files copied there.  AFAICT >> the only reason we're copying the uapi files at all is that they're >> directly in the same include/ directories as everything else and are >> always referenced with their uapi/ prefix. > > Oh, this sounds like it would work nicely. No more "make headers" > required (hooray!). Instead, the new approach would be "selftests are > allowed to include from tools/include", and then we can just start > copying the files that we need to that location, and gradually fix up > all the selftests. No, this wouldn't work. * The selftests are applications which include default header files. The application don't care from where the header files are picked up at compile time. We should be able to build the application on normal system with latest headers installed without any changes. * The header files cannot be included directly as they need to be processed first which is done by `make headers`. Here is a diff between kernel fs.h and processed header file to be used by applications: --- include/uapi/linux/fs.h 2023-12-12 14:45:22.857409660 +0500 +++ usr/include/linux/fs.h 2023-12-12 14:49:23.469733573 +0500 @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _UAPI_LINUX_FS_H -#define _UAPI_LINUX_FS_H +#ifndef _LINUX_FS_H +#define _LINUX_FS_H /* * This file has definitions for some important file table structures @@ -13,14 +13,10 @@ #include #include #include -#ifndef __KERNEL__ #include -#endif /* Use of MS_* flags within the kernel is restricted to core mount(2) code. */ -#if !defined(__KERNEL__) #include -#endif /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change @@ -287,19 +283,19 @@ typedef int __bitwise __kernel_rwf_t; /* high priority request, poll if possible */ -#define RWF_HIPRI ((__force __kernel_rwf_t)0x00000001) +#define RWF_HIPRI ((__kernel_rwf_t)0x00000001) /* per-IO O_DSYNC */ -#define RWF_DSYNC ((__force __kernel_rwf_t)0x00000002) +#define RWF_DSYNC ((__kernel_rwf_t)0x00000002) /* per-IO O_SYNC */ -#define RWF_SYNC ((__force __kernel_rwf_t)0x00000004) +#define RWF_SYNC ((__kernel_rwf_t)0x00000004) /* per-IO, return -EAGAIN if operation would block */ -#define RWF_NOWAIT ((__force __kernel_rwf_t)0x00000008) +#define RWF_NOWAIT ((__kernel_rwf_t)0x00000008) /* per-IO O_APPEND */ -#define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) +#define RWF_APPEND ((__kernel_rwf_t)0x00000010) /* mask of flags supported by the kernel */ #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ @@ -364,4 +360,4 @@ __u64 return_mask; }; -#endif /* _UAPI_LINUX_FS_H */ +#endif /* _LINUX_FS_H */ > > I really like this, at first reading anyway. > > Muhammad, Shuah, others, what do you think? > > +Cc: Muhammad Usama Anjum > > > thanks, -- BR, Muhammad Usama Anjum