Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2695641rdb; Wed, 15 Nov 2023 08:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG78m2ZLfzzbni1mJvYpXhagVlwsPyZJulTUm3dRgMDBrVV6EJ+a9LWNGjpp9tYeCOjAof2 X-Received: by 2002:a05:6a21:33a8:b0:187:9ff3:98ac with SMTP id yy40-20020a056a2133a800b001879ff398acmr91703pzb.4.1700064311620; Wed, 15 Nov 2023 08:05:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700064311; cv=none; d=google.com; s=arc-20160816; b=T6C+ASR2q4PDVkgXSonMDuDFOBX/WEF1aCzHUAUHFrsy+Lrfg0M8UlwgI9x1Uc+gna 56sVV6YMsjntzsg/p20f+FEBLYyrVLpnhNgsLwMcHMnFeYjQ/MKwxBX1nw1mh8kmaqiJ 6eQ6C/lzOvg2TkGWVyyk5A5yZ34RQyx+hgJ1o6J3oo4CBB4zcAAk3eyVvIf74aNx41Yt UNERNpr/gYu8h5oqbdoOZ3+KzY7olmRQBbNfQY/sOAIaqXvRdgpHGsxBZHhZvWd3aL+h /0IY0p5NjmlLZfCJF+BOnIPGxRSQwrNg0U7yCoIrvCF337x+qTyx5Qst/CUGdu9K1kB3 2tng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jzZnZquzqfUk+KfrDds9CQaV555iZ1w7ZZ/4IXXyLOU=; fh=vNd71FXPA8jGSmc7QT4ju/Mcvu+Q5LqZXc7QSskat8w=; b=daBNTgrsbTtWutBYFTNn4sQMSEcl4S+2vdawQDOVu5VMaywBtlgL7/tTzbT9/sXYnW si7N7QmJxA+EKdjnL3b7cCSb6DhZWcoNOxA3O5IGd9D5K32jKnWMpOOQ4iTk9LWO0UOG EcwsH/hj7jKkhjI8sXpm5iLr/5TLUEsNGt7fsVg0Q7HCNvBbv8K5osIOl/jB0ao5c5xe 7HWFN77qcbngYst3dqARFYufM1aZCFZssaYHFLQyp70t5Vf//naAYWxqgsZfG/jLYrD/ 9o0iTvoreaYoeG8uBmkguc3rkBQohRDKrM0uHwEfU+/TAnsaEn1yyt6OhfwnTPIkUgbU Wtiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=B5jNO081; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n127-20020a632785000000b005bd6897634dsi10626141pgn.249.2023.11.15.08.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:05:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=B5jNO081; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D80F4804195E; Wed, 15 Nov 2023 08:05:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232158AbjKOQFC (ORCPT + 99 others); Wed, 15 Nov 2023 11:05:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjKOQFB (ORCPT ); Wed, 15 Nov 2023 11:05:01 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 653B1195 for ; Wed, 15 Nov 2023 08:04:56 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507973f3b65so9861878e87.3 for ; Wed, 15 Nov 2023 08:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700064294; x=1700669094; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jzZnZquzqfUk+KfrDds9CQaV555iZ1w7ZZ/4IXXyLOU=; b=B5jNO081WHszP07ZsBKM1CDWKnvz3FH9mmZUeIJOBeQ4RtSAnsgAlB/4zNCkcM4btj yDGuU/TQucx9vY2Jb0NlNiwMLl4aSHjmpEVeUYpX4EA5IB6tvF1LI2LIDmwHGCzJaKYX ClTQWQx89VcjPw2bT8IytM4QZ8n5qS0hVIvp0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700064294; x=1700669094; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jzZnZquzqfUk+KfrDds9CQaV555iZ1w7ZZ/4IXXyLOU=; b=MltM9roa4RItmC/7xkVyyyz6mzhe7TrK9UHtfyNRTo31ixwoQ9+8tWY6h8tTmxqTrP PpR4IFCCLEdC1GuQjdiso963F9ErJj20pf0YHUR/Hez0CtbmM7Cpa42RNM29I8C5VB+U dFStu7tbVMgMYjg/l5n6VuJO+jW/max2LlV5DE9dr1Sb0vcLJC9h0RCot8kOL+Ape/Ye 9PYhjOKO8ZaLc8s74olr8SR5xBit8FLDcrshBXcrMdHEhZtCstUdMYvw78dTna4ex4MU rr1MRAaRot/gPuYYbvHh6EIjsubNPZJcQ/Zt6Bk8S4EqPxr0t9HWVzpnDb3smvVzuz4E 2X2g== X-Gm-Message-State: AOJu0YxdsPW2aLVQvAypf8Y4/hVQPwvguMJX9CxfJRZyNYEF/o+V2/gD /jg3b+drMZNPDuAT83UYrQUsuWhj8wgaCuNFtgbDcpTy X-Received: by 2002:a05:6512:3585:b0:507:9d71:2a77 with SMTP id m5-20020a056512358500b005079d712a77mr8358106lfr.17.1700064294298; Wed, 15 Nov 2023 08:04:54 -0800 (PST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com. [209.85.208.49]) by smtp.gmail.com with ESMTPSA id ko14-20020a170907986e00b009dd701bb916sm7217056ejc.213.2023.11.15.08.04.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 08:04:53 -0800 (PST) Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-53e07db272cso10761256a12.3 for ; Wed, 15 Nov 2023 08:04:53 -0800 (PST) X-Received: by 2002:a05:6402:34f:b0:540:7a88:ac7c with SMTP id r15-20020a056402034f00b005407a88ac7cmr10183276edw.21.1700064293347; Wed, 15 Nov 2023 08:04:53 -0800 (PST) MIME-Version: 1.0 References: <20231115154946.3933808-1-dhowells@redhat.com> In-Reply-To: <20231115154946.3933808-1-dhowells@redhat.com> From: Linus Torvalds Date: Wed, 15 Nov 2023 11:04:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 00/10] iov_iter: kunit: Cleanup, abstraction and more tests To: David Howells Cc: Christian Brauner , Jens Axboe , Al Viro , Christoph Hellwig , David Laight , Matthew Wilcox , Brendan Higgins , David Gow , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 08:05:09 -0800 (PST) On Wed, 15 Nov 2023 at 10:50, David Howells wrote: > > (3) Add a function to set up a userspace VM, attach the VM to the kunit > testing thread, create an anonymous file, stuff some pages into the > file and map the file into the VM to act as a buffer that can be used > with UBUF/IOVEC iterators. > > I map an anonymous file with pages attached rather than using MAP_ANON > so that I can check the pages obtained from iov_iter_extract_pages() > without worrying about them changing due to swap, migrate, etc.. > > [?] Is this the best way to do things? Mirroring execve, it requires > a number of extra core symbols to be exported. Should this be done in > the core code? Do you really need to do this as a kunit test in the kernel itself? Why not just make it a user-space test as part of tools/testing/selftests? That's what it smells like to me. You're doing user-level tests, but you're doing them in the wrong place, so you need to jump through all these hoops that you really shouldn't. Linus