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 9EF44C8303C for ; Fri, 11 Jul 2025 12:09:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FFFB6B009E; Fri, 11 Jul 2025 08:09:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D15D6B00A2; Fri, 11 Jul 2025 08:09:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F29526B00A3; Fri, 11 Jul 2025 08:09:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DF6016B009E for ; Fri, 11 Jul 2025 08:09:51 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 10316140B0C for ; Fri, 11 Jul 2025 12:09:51 +0000 (UTC) X-FDA: 83651864982.15.71DBE7F Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf08.hostedemail.com (Postfix) with ESMTP id 30D14160002 for ; Fri, 11 Jul 2025 12:09:48 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=P4owD6Hi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of lianux.mm@gmail.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=lianux.mm@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752235789; a=rsa-sha256; cv=none; b=00Qa27RBC7BefkuzzgWpD42ahXGpEf9CU0vyf+TaJkOa1aq7R+oo3IJb6FgBCncguLd0ut 3w0rQLFpK7zroUrYxJUDVz5Wn29KWWW57b2R45QVWOZ0wc+Oms4peY1l5u27imUcJU1itC PjKcg9C0sOuxpo0Q0LkaxvJLhRilqN8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=P4owD6Hi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of lianux.mm@gmail.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=lianux.mm@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752235789; 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=RZh+h9FkEGoNBmFQ/fWxX9YZY8n00mTm9exBYWyxMyE=; b=Ozgsu3o+SRcrJfoAbEx6uFweaQFjpMnOJFRxLNHW+SazqcmXfXZjSOpHBEcdS5SDtBIFqh iU5FCbseG+U0p3EOmalFAW8d7reJd5U2Onf45B3pkGEUd3NwNBxtjD5EjUjFZato4OMC94 AROmYZtppzjjZxcsKwx8eLSUTWThNag= Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-73972a54919so1811764b3a.3 for ; Fri, 11 Jul 2025 05:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752235788; x=1752840588; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RZh+h9FkEGoNBmFQ/fWxX9YZY8n00mTm9exBYWyxMyE=; b=P4owD6HijuLlpUt8AW9HC7Y523qKtTm7Y1IiVL8n1XEUz+A06zG1A4E/6Jlplz8U6o /0YXvHLDiVlyI40eO9luR+aMXID25xNElBWbXbrmLZpg4vgk5HdApOSaNdGO/dj9yYI8 o1YF5Qxa4VIOoPyDutWnRC3Pi9zIGs8oO79Q5DzKObVcjweJcdDqt2KLJB0R7yRVGt49 2GuM9bqkjyYSJPqV479i0Ji6eud05uN5z3NXJYvfIgWJIU6Cfgw5HGWeImBs0JTp4WtC LEI6/qQsLF4NoMn7PX7S/IDeaUoPTdjfuO2fG+W3bGG6hK8G1q6u301AtTJwuObSXq7q +Cuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752235788; x=1752840588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RZh+h9FkEGoNBmFQ/fWxX9YZY8n00mTm9exBYWyxMyE=; b=ZZQUd9loZhJa4kd4lcEGRYAElHofzVPtomDgNfS3vIVK93/2MdbMlpcWB1d4Ln8dSE FZGRyI7vo7zuFpQTK5gyDHZEPwH3VSHCcMjqNW7XwieJ0TWETXjQHpQOijZlRDoZGYPl GsovDSutfQ75Hl84am+D8DYVrrN3F54r1DGeMHnqGjISaQIpHnxVCMYmqYFIaRCQ+QQd 0Tc6fh5UVR2++NnOcmIOr2xjudgjIMyc9hO2wKaeeMuZpP9IvA7xWX6PpVOHtvYQFpeE KWQheEISYxu7lPoj3KAqJop9mk6Xp2eixmba/uUXae7dVtxcRm1IleZZapIwYyS1WIh0 bbxQ== X-Forwarded-Encrypted: i=1; AJvYcCXxRQbAztKyLYb57yNa0GadFLZirR4rXwxsqmpkwFdHB4BED3J/APlagj1mqNKkyYpcTGS2SOyZow==@kvack.org X-Gm-Message-State: AOJu0YyVq9B39y+C6mNiJKdd5MU3K6jF1mKMl16wpZA5z63bth6lce8u x2oKM2FcAh3/9j2/76z4LGmjXYv92eYUp2Un5l8Xo+pzQSMcvLIQueGO X-Gm-Gg: ASbGncvPZyalOxU5EIdOrORqAqRLZ2AkzLJsKbMFGn38JGMDOSVk2mkw5Y5NKIauQtp +d0wiGn8znmmPRzW3jn0qnjcb/LnuX+hEsW2igJcqf3AlVkX9U1Ytdih0pkkG4y3KPXaLK4iPNR X9pjq7fBTS7Q5v57JV63vz5RHcqgApJI/LOuZytRDxVgYW+GZfKFpojDzwm1TuEUVVcOxdrbkMb oWm01kaTjJU7W3qNRccOC8BXUtyMxHhztaoBDMKrWVJPEyxlBBj6YL8piqsSino22Z81nToh75B s9lNHayCuN8SDSa9eXlmHo/XOlJ37X1vHvnrYRB8ZDR3Wgnd/vYXha5s9gh5kuCJPzGYk8ybrsl 1rCHoJyHNILShScbNSnREU+3BptqEcONuzcOc7joMPzVpCmpm X-Google-Smtp-Source: AGHT+IE2NZ0+J8d0OK9Iy+YWW1/9BUq73Ob8bE/TFoBEJqMyC+uapo8S3f7XGSDKa5bAQ5+00q06WA== X-Received: by 2002:a05:6a21:8dc7:b0:222:1802:2dd7 with SMTP id adf61e73a8af0-2313504f6f3mr4547110637.13.1752235787862; Fri, 11 Jul 2025 05:09:47 -0700 (PDT) Received: from DESKTOP-GIED850.localdomain ([114.247.113.178]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3bbe72913csm4944545a12.72.2025.07.11.05.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jul 2025 05:09:47 -0700 (PDT) From: wang lian To: lorenzo.stoakes@oracle.com Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org, brauner@kernel.org, broonie@kernel.org, david@redhat.com, gkwang@linx-info.com, jannh@google.com, lianux.mm@gmail.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, p1ucky0923@gmail.com, ryncsn@gmail.com, shuah@kernel.org, sj@kernel.org, vbabka@suse.cz, zijing.zhang@proton.me, ziy@nvidia.com Subject: Re: [PATCH v3] selftests/mm: add process_madvise() tests Date: Fri, 11 Jul 2025 20:09:38 +0800 Message-ID: <20250711120938.15270-1-lianux.mm@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: 1wia4xgc9gzgdrxunfcokhagyhzkbh5c X-Rspamd-Queue-Id: 30D14160002 X-HE-Tag: 1752235788-807318 X-HE-Meta: U2FsdGVkX18Vz0iiLHxoX1Uxjr0unrXAxudZpnSkEzYUYIq9sxDZ7iaMGY3FiuGeubD5Nlxq4fXN+cudOH8LmIoUztQIwrVsGoC37iBRuNk/+2pw1M82hQEo//cPtyOtcblAeHcUHOU1CkNECtPwyq/9JYOi6nX2z7JzKeEviX07vCfbaARgu4g9iXvBZPCoy5Q/Bh9Xj8PXloaDV1QQzQnpNUxiZ7oYq8MhXW+zQWnnLlIX4imANmSr+bfblDAlkgQb5E5qXr13gWL7b1ZbEyBnct7/FiQy2YSEzhhGIJD6q+patqDOW2TmL7RK/6v4Ps8cRFBx9w2UmJOiZsS/YvyAmoyU2hbjVyp2mnMufBSCJJgfuw0v54Ry9YywvBLt0TsEVNZd8mXbzosT3/JQp1NeU2HWjLVWpqEuaKZKjtE+QBxvV3gomR4y3dNrd8x/pE+mZ3hinZJCbw9JcuF9F+uMVZ78t5n1CDNGonbBOMsUWprKk9n9oei4dcNjLLLP94aUFHPebY5sPUqiuZTKsGDN6McK3P8j6djc6CSHWkuzW+eDqAHriFCkUFboe+j93pn2ylcCEUPXpfglxPbCWJT16olVh+ifKPI6/zmFaBUyAiRyzCnGSQUJi2a3VSa5kX33U1QostUHTMz3eibYGBVogL1wpCxbSv575BYjut4s/SbmcssHP7GOQn/ckId/l+uz9d9Q+IuRkS5w6Zssb8uyNRg3UFDjJJwRUSucm2GOEX80Nn1aE937ytJYxxn9/kyNhxIu5sDKDtzS8wVj8DZOHxLO9c3+uBNpo8j5Y1/d7ZGcBMlM2b5UA0iYmphH7dVdH8ukvX/82ZXQHuyGy0pfPgziHwQ/qjrpFYI0G/bKM9H3Z7Js1pT2LdrKud3gxnjKmCUAM96rq3XXCZeiNn68oTR4DR3ixSmK0tvDuW+tx20Zm3/eWjpbnqi+5yPe39IZxzHw6W+UjFzdBHd zrH+pBIf nBs5hRjRMMBuSqbggURYapRDXbOmd7ycQKj0Sj6B2r1edRxF9Ds+YEyBsrtf79rDw8JbvpI3SXee+D5AjMk/JNFShPAzLHsIr+1MVwJtprnlOBDwQRzwtmCwNZ6+sYAh8DTFY8YXQ183kRXkjm+9VsSZeFYy5ONJP2F56LU7XcDqfeNAhdw3p7nZvYTFoVO82upSJau8a8hG/G1ewggLKTbfPP8IfFmbus/7wpOEwkR20VbvrJPDXmCNrWEU2JVXNpx0HGDiF/SPwrXiK5zyFOhaNETOL/7mf2akvV5mP7yMZZk/r9vBHSqY9TH083lZ5FSuAvPD/e4SLfgebMjkuoIK997Nr+eCH4EEZA5yyXr77Pk+vMHPAO1ui9lhyNvtTvu0xQkTrrpEwuxvzdbWJuvrdAW+tXfWSJw1BoWAVq6WhDdr7dOprV75B78PAarxXXtyv8qTtzUI5EeSgpkk/un3/ybLs9Pxj1ymjQKOolNiLnbGSNFnmzlcfKTfTIt3V4vxHlDGO0798O/IJFv2j557HdHsg5eZ1N5xr 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: Hi Lorenzo Stoakes, > On Fri, Jul 11, 2025 at 09:34:38AM +0100, Mark Brown wrote: > > On Thu, Jul 10, 2025 at 12:28:13PM -0400, Zi Yan wrote: > > > On 10 Jul 2025, at 4:42, Mark Brown wrote: > > > > On Wed, Jul 09, 2025 at 10:46:07AM -0400, Zi Yan wrote: > > > > > > > > > Right. My /usr/include/sys does not have pidfd.h. IMHO selftests > > > > > should not rely on userspace headers, otherwise we cannot test > > > > > latest kernel changes. > > > > > > > > That's not realistic, we need to be able to use things like libc and for > > > > many areas you'd just end up copying or reimplmenenting the userspace > > > > libraries. There's some concerns for sure, for example we used to have > > > > > > Sure. For libraries like libc, it is unrealistic to not rely on it. > > > But for header files, are we expecting to install any kernel headers > > > to the running system to get selftests compiled? If we are testing > > > RC versions and header files might change before the actual release, > > > that would pollute the system header files, right? > > > > Right, for the kernel's headers there's two things - we use a > > combination of tools/include and 'make headers_install' which populates > > usr/include in the kernel tree (apparently mm rejects the latter but it > > is widely used in the selftests, especially for architecture specifics). > > These install locally and used before the system headers. > > > > > > OTOH in a case like this where we can just refer directly to a kernel > > > > header for some constants or structs then it does make sense to use the > > > > kernel headers, or in other cases where we're testing things that are > > > > > That is exactly my point above. > > > > What was said was a bit stronger though, and might lead people down a > > wheel reinvention path. > > Let's PLEASE not rehash all this again... > > This patch literally just needs PIDFD_SELF, I've provided a couple of ways > of doing that without introducing this requirement. > > We already have a test that uses this with no problems ever reported on > which this patch was based. > > Thanks. You are absolutely right, and my apologies for introducing this unnecessary header dependency. Just to clarify, the build failure Zi Yan reported on arm64 was not caused by PIDFD_SELF. It was from my use of the pidfd_open() glibc wrapper in the test, which incorrectly pulled in the system's . Based on our discussion and a review of other tests, I understand the correct approach is to avoid such dependencies. I will fix this properly in the next version by using a direct syscall wrapper for pidfd_open. Thank you for the guidance. Best regards, Wang Lian