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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD6B7C2BD09 for ; Wed, 3 Jul 2024 22:56:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D594B6B0088; Wed, 3 Jul 2024 18:56:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D08E96B0089; Wed, 3 Jul 2024 18:56:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA9676B008A; Wed, 3 Jul 2024 18:56:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9C30E6B0088 for ; Wed, 3 Jul 2024 18:56:45 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AC9F0120E51 for ; Wed, 3 Jul 2024 22:56:44 +0000 (UTC) X-FDA: 82299952728.17.230B807 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 0259A1C0010 for ; Wed, 3 Jul 2024 22:56:42 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XXYwWVqc; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720047391; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YU6KrCd6hiDYMGNUxkn1WxixFMqMcuCvmciEgwhqTyg=; b=W6NXZL22GZvpu+gF/5FS2Jv9sM8MLz7eq05bSwAkM0HNHMrWQwTGNhmkU6WNERAGWNLZuT GzOdB5QlZuio3PlK+vQm69jza/uwC9wdSDHX0j2D7bRYUSbD1fQUs1t9DjUg4ZSvJKctZJ DEotVETDKkx++dA8FTAbcD0O0d2vO+c= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XXYwWVqc; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720047391; a=rsa-sha256; cv=none; b=JIAJ5c5OGthO8uVXaJjxr/0J+CIkneY54cWXahqS+xczSWtmEm6mFYoBgKMv4fZFDnc73P I3cbc64Z0vioR3aSpooavjjGwGtUd2O2/8D/Tn6NIFk+WRuhAkJSOe8Br+PVUhd7Zj+X81 v8ENBHtE8Q06Xnk7DfRVpFGa2P7OEO8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D9C6B6188C; Wed, 3 Jul 2024 22:56:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35D60C2BD10; Wed, 3 Jul 2024 22:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720047401; bh=Yat0dK/GhlDCw3tceD2Z/jjY0MWRMnghoD2FZYxbUcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXYwWVqc3CV0XkQTLD4cWmjKk0wybWM5sGbLpuQhSvQ3bIot1RH1W2lVcT720kwPR 6gyQSNFj8vyx66ztit/JwRPYaBk6ZFYvp37tClSqpNRLkAzYwcJTteIp/2ovY7T+Zm 4QdEicx1aEjbCC1dPU55prGCONCM92aewgc02/hhjPg4bck9Q1YCkPBqtB79t9Zep/ FgyUn4ke0RDsrMYFOG3A/y2pBBpoErW9kEtp8t1UY8GeBu3nNUYUJ3Bv2MCYw4GDzK zES3yr87WT37H8E7ZIPCNoZBEI0ZTcpbJebiqryqdfqVxhaq+tEBjn5Wkx6bezb8zT Zpi+RT5U+DelA== From: SeongJae Park To: Lorenzo Stoakes Cc: SeongJae Park , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Liam R . Howlett" , Vlastimil Babka , Matthew Wilcox , Alexander Viro , Christian Brauner , Jan Kara , Eric Biederman , Kees Cook , Suren Baghdasaryan , Shuah Khan , Brendan Higgins , David Gow , Rae Moar Subject: Re: [PATCH 0/7] Make core VMA operations internal and testable Date: Wed, 3 Jul 2024 15:56:36 -0700 Message-Id: <20240703225636.90190-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <1a41caa5-561e-415f-85f3-01b52b233506@lucifer.local> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 0259A1C0010 X-Stat-Signature: o63ukssi1zf76d6m96nc7unhuo5whkz6 X-HE-Tag: 1720047402-805968 X-HE-Meta: U2FsdGVkX1/XogMMV3mlPwJd2DfuehzpeinzNFTkMSDnFYyO6z51KdFLA+8rh1t1zGHsoSrollQXbkcP8t9VyVCfRvxK8iG0i5aBlfOO4ahCKic6pNik8iM0dR6A+GUClG4ebnuNIMYb10++UwM5zNx6bbUgIt+BgjA7lF36yXKzZ6OvaBDqtTBu7a/6fo8o6FDQJAz20crKJaEysAZVh6/qLxOScja1TnEuA6y+6eb84geCLHK2b2KuJ8GcEd0e2igcTnm7pOBoCwLcOpBGGxy9N3b2fJO/epV0foXKLBFVNA3Rjm3KZKq3fAz4VjoBp2u9YKZvDFh8VquclsV3sU3GzFVvrNr9L3vtSlCHGYXtyjDj/T1TSN2KdhRYWcszyMs+3t3sep7rqHPehdysakRBnLWAd6berp+DGmquM5nBQjLZs/wBriq1tSzrE9DFF/W/ODcnHSWDacnmAE7zEPOAoqjbUQAdOlwQ0Y//Bw7YXgAhQScl47DQE9T3rqc/yPZXqQSg/zRTbA2REgkXNnF9CGZu7SNXbGLXuqyU0Ye946fOfcRusTzdeX7agOW3fGtKYfNctvMrdIjtn2UkxfNUW5HZrcHO4YUSQd/nGEiraUMr+0GBhQX3EiMsL+R4UntMinzQbgqZCis5QiYH+FMqahmdYtmSnPt5BNng0Bub8HkaY9LqJ/fTuiWqnYECWRphXehBYBejhXPPOEAmK6iYki7+ilpgz00KHNP72MEn/3Vo2IsVmovM1PNi/2TC01gcSkDX2XpvONHj6Qe34m5br7rhF12mZ3LvoNP8uPqXlV2XL+So0BGqKxhMlbmjzBiFyJsIKbCbcM+uddhNnlQlnV5H8hHV+r880e4rUTjkn10W2k1vWoLJh407KHq06aKlE/Xr6snTK1RDpIww6WT0ye8WgiEog17ptNIFalFBTDBiungWBxYMoUsuqgAsDAcKgKZe1nXisRilqDj UU0/IZj4 ilf2ia2U3Gk7oyXQmgYFBxqR0o1AU++HGxjdbmUfFjvAttXDJPcEJrfRGf8u4PoNekGYSo58FBhf88GqcAWtiIYluMR7gBIhanw+5a2KP/ylExfQCqCrP4T5zrEuI6sSC10tmOnTdqfX8TgLOl4nibShP76S6LYT+JbZKHO5cCW4Q0Vys9rpbvwnuVw8oy/DayR2H4EkH6k8TAbH2PSckLalEKU5dNISNSSkYLfDTcUVjWOyyBWsm4i/bPIIHzT+ZDp+eZtyAqfA/prI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 3 Jul 2024 21:33:00 +0100 Lorenzo Stoakes wrote: > On Wed, Jul 03, 2024 at 01:26:53PM GMT, Andrew Morton wrote: > > On Wed, 3 Jul 2024 12:57:31 +0100 Lorenzo Stoakes wrote: > > > > > Kernel functionality is stubbed and shimmed as needed in tools/testing/vma/ > > > which contains a fully functional userland vma_internal.h file and which > > > imports mm/vma.c and mm/vma.h to be directly tested from userland. > > > > Cool stuff. > > Thanks :) > > > > > Now we need to make sure that anyone who messes with vma code has run > > the tests. And has added more testcases, if appropriate. > > > > Does it make sense to execute this test under selftests/ in some > > fashion? Quite a few people appear to be running the selftest code > > regularly and it would be good to make them run this as well. > > I think it will be useful to do that, yes, but as the tests are currently a > skeleton to both provide the stubbing out and to provide essentially an > example of how you might test (though enough that it'd now be easy to add a > _ton_ of tests), it's not quite ready to be run just yet. If we will eventually move the files under selftests/, why dont' we place the files there from the beginning? Is there a strict rule saying files that not really involved with running tests or not ready cannot be added there? If so, could adding the files after the tests are ready to be run be an option? Cc-ing Shuah since I think she might have a comment. Also, I haven't had enough time to read the patches in detail but just the cover letter a little bit. My humble impression from that is that this might better to eventually be kunit tests. I know there was a discussion with Kees on RFC v1 [1] which you kindly explained why you decide to implement this in user space. To my understanding, at least some of the problems are not real problems. For two things as examples, 1. I understand that you concern the test speed [2]. I think Kunit could be slower than the dedicated user space tests, but to my experience, it's not that bad when using the default UML-based execution. 2. My next humble undrestanding is that you want to test functions that you don't want to export [2,3] to kernel modules. To my understanding it's not limited on Kunit. I'm testing such DAMON functions using KUnit by including test code in the c file but protecting it via a config. For an example, please refer to DAMON_KUNIT_TEST. I understand above are only small parts of the reason for your decision, and some of those would really unsupported by Kunit. In the case, I think adding this user space tests as is is good. Nonetheless, I think it would be good to hear some comments from Kunit developers. IMHO, letting them know the limitations will hopefully help setting their future TODO items. Cc-ing Brendan, David and Rae for that. To recap, I have no strong opinions about this patch, but I think knowing how Selftests and KUnit developers think could be helpful. [1] https://lore.kernel.org/202406270957.C0E5E8057@keescook [2] https://lore.kernel.org/5zuowniex4sxy6l7erbsg5fiirf4d4f5fbpz2upay2igiwa2xk@vuezoh2wbqf4 [3] https://lore.kernel.org/f005a7b0-ca31-4d39-b2d5-00f5546d610a@lucifer.local Thanks, SJ [...]