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 75CE7C3ABC0 for ; Wed, 7 May 2025 20:50:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D54CF6B00A0; Wed, 7 May 2025 16:50:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB5BF6B00A1; Wed, 7 May 2025 16:50:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B57546B00A2; Wed, 7 May 2025 16:50:57 -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 8F87F6B00A0 for ; Wed, 7 May 2025 16:50:57 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6D74012121D for ; Wed, 7 May 2025 20:50:58 +0000 (UTC) X-FDA: 83417306196.24.887CB88 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by imf25.hostedemail.com (Postfix) with ESMTP id 421FEA000E for ; Wed, 7 May 2025 20:50:56 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=NgoCEEM+; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf25.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.47 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746651056; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=l1i3VA5pX+AnNv8o3MlfdxwnFv3V4vTyMLMmTMdRyK8=; b=q+i2kYr1HBgoUZfVU/FQlngm9J1DJg6TShY3ph7V1vFh90Se/3CHTZGOCuh2rgQwWtTPZ4 i0mwsmtEYlIlCAXilB4Jzt3EAN6Cvk/vKcR6Az2xVZrj01GWMnkwxBnacec/0wGRIvmQQy 75by1XSx7WlaTgfLyMETkLO/xcLT5nU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=NgoCEEM+; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf25.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.47 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746651056; a=rsa-sha256; cv=none; b=OjcGOfjw89zdmQUfuYpGdP0LQwR+4NzZN1vxFjoE7VHgake7TC2K3mL1ps9gRdE9SmYZy6 PaJ6qNvHj2VJ/aYXmrz2OFogmxJ87n9L+AHTFbnXxJ4oq3HhBZpRSbFKZKVNwaymP7t7PD dfA8ViVcRjOeuW9xF9X1/ZwlvNRvQR0= Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-85b3f92c8f8so18962239f.1 for ; Wed, 07 May 2025 13:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1746651055; x=1747255855; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=l1i3VA5pX+AnNv8o3MlfdxwnFv3V4vTyMLMmTMdRyK8=; b=NgoCEEM+M+K+az3EkNaudxWyOzqGuToizTRqcBZ+MbldRgxWaKAPbGxCCEywAQDrGr HOfQ9LlVuw/0hTIuws0JX1DNeiiLmuKNPW+gSpcw6kRXzGaQZbf/3GMZEqsgYeW1VUIG DtLlvOlLm724E6sPFwK4yS7zB8C6KDg2DQAMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746651055; x=1747255855; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l1i3VA5pX+AnNv8o3MlfdxwnFv3V4vTyMLMmTMdRyK8=; b=XbRjL6Rma9aROv/Vhyt3sjgFo35Jl9ARJJXf5j3lsxbjoa9KPxpd16wQXNnBMdoZHB GS20dVQTtM3F+N0n+Q7dI2hJ/u2+QCYVp9EfXVrx0wU1LxVdqIegzfvKh/xE21by8zf9 NBowJn+Z2XaeE5LrKd/Z63J+8luQCzdL8H5wkWNElTTdnPM0QG87rfXg0RzM2/Ke/7s2 RCcHDJX5yvjY+Fs1EJrlkvl84C+tWuCULqtebpNkAG5Dd98TFAPoW7fdz6XyOFEr9wHL OpW5YZyqO+zbodyzn1G7IzQd5gkxIJfUfZVS9aQsZc79vZwbZqLWQlaVGfzEhU+QfFk9 jW0Q== X-Forwarded-Encrypted: i=1; AJvYcCX9x41L82OcfzSzvekrQ74XT1OiakTj4bhf3h9bjMxeWc2hUNd8O1IkEi8o+aI0qgIiF5r5OTglQA==@kvack.org X-Gm-Message-State: AOJu0YwkZOBdCmSHGSvM0yMvALaD6S5FmMTLYAJOe05Q4tE9iQlEWg2m eDd7ZcE9ZwMs1FFtde5Ko2sKiVp0h43/2+Ssy/h/jAxru8TraLFod5hbWoCP1RA= X-Gm-Gg: ASbGnctfrtTEouq8Kq0of5+GnKiNgzD3PA8yrbzANLPUpMAVc//5nDgQUEHXs6eMqrj 7ZorFkI+PZ/ObFX7SgEIeislgreZKWPQ3LWHmLWLNvDVn80c4UcPIOdMZEI2AqFTO6eTnDbrFko VYefQhccKKVZZrTNZIkodLZ4Rocq+dAY4ZA1DNHQAJrdCDDqhoPUpO4BuS2P7dwBWg+jUW2VQp7 NCOYNF7Lb6oVmrb5oc/BeSBtD7bwVHc1feFAeQKxER0TXSjTkR5c6oRx0eamQolwC5YT6x5qtVx kCAjbrgE3MTH+wDpH3AD/Nivm9FMBRkvR6xBWlyGVyE/Lw5za3k= X-Google-Smtp-Source: AGHT+IGXfbY2TdlADjhrlZDdaegNr623acfnrkFbqKORg+uz4s4neNOrD9k8reaOICCdp3cse52JQw== X-Received: by 2002:a05:6e02:1489:b0:3d9:5d50:e3b1 with SMTP id e9e14a558f8ab-3da739304a7mr62088825ab.18.1746651055223; Wed, 07 May 2025 13:50:55 -0700 (PDT) Received: from [192.168.1.14] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3d975eca7b6sm31478705ab.38.2025.05.07.13.50.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 May 2025 13:50:54 -0700 (PDT) Message-ID: Date: Wed, 7 May 2025 14:50:53 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: The "make headers" requirement, revisited: [PATCH v3 3/3] selftests: pidfd: add tests for PIDFD_SELF_* To: John Hubbard , Peter Zijlstra Cc: Shuah Khan , "Liam R . Howlett" , Suren Baghdasaryan , Vlastimil Babka , pedro.falcato@gmail.com, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Sang , Christian Brauner , Lorenzo Stoakes References: <6dd57f0e-34b4-4456-854b-a8abdba9163b@nvidia.com> <3687348f-7ee0-4fe1-a953-d5a2edd02ce8@nvidia.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <3687348f-7ee0-4fe1-a953-d5a2edd02ce8@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: gzmxe7kbec4kbrur53bg77mmk8ajhmpj X-Rspam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1X/2Gdj7SR0YJHSlKm7bdFU22izat3rvVvNIK/J5Bn/3X+jsLRPvlCs4xQZEZv/ucxv5idlHuGrqOEgWGdA+BeUt/v5bOVUA/pxPbImnKnp6URsLddjvZolcGYAz5SKsm0HaV5j4Z1wLW+ZvfRxgTf5n2Ig6L2jHS6WxNmwuqgVk5Oy0++PZcohv/b/bAMyM2w0HbG/lNde4QziaAPwxPWTfP+s2iTiCBTUh/mB3RyMc4rQ5IxM9/OL8UiOb/8hAPMh6cMxGJWU+vLzcxGAn+nZ2/oVWPfaiT9xMohjFerLSXZyp08OsDTC+EMw1ItTqZn+d3TxCiXsSGqAflTlDZvz/4W6Hjc6TOEia8cen2IEe0r4AxwlaApXqqlaete9E1PyM1f8F2zeIKTYXqMz+l9VvFcN8OIkAyw9jcvXJbZy32e1B4FT8xw9z8gUkz9DJPVYiWcXMbAAzGxMrHQdEa1lSreYsrVIuJ72cAE5phdHnVRwplgEPoe4KUo5H89isrs= 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 10/17/24 10:47, John Hubbard wrote: > On 10/17/24 9:33 AM, Shuah Khan wrote: >> On 10/16/24 20:01, John Hubbard wrote: >>> On 10/16/24 1:00 PM, Shuah Khan wrote: >>>> On 10/16/24 04:20, Lorenzo Stoakes wrote: > ... >>> The requirement to do "make headers" is not a keeper. Really. >> >> The reason we added the requirement to avoid duplicate defines >> such as this one added to kselftest source files. These are >> error prone and hard to resolve. >> >> In some cases, these don't become uapi and don't make it into >> system headers. selftests are in a category of depending on >> kernel headers to be able to test some features. >> >> Getting rid of this dependency mean, tests will be full of local >> defines such as this one which will become unmanageable overtime. > > Not if we do it correctly...Please do look at the reference I provided > for how that works. Here is is again: [1]. > > The basic idea, which has been discussed and reviewed, is to take > very occasional snapshots and drop them into a static location where > they are available for kselftests, without disurbing other things: > $(top_srcdir)/tools/include/uapi > > This has worked well so far. > >> >> The discussion should be: "How do we get rid of the dependency without >> introducing local defines?" not just "Let's get rid of the dependency" >> > > Yes. Good. We are apparently in violent agreement, because a few lines above, > I wrote: > >     The requirement to do "make headers" is not a keeper. > > The "make headers" is the problem, not the fact that we need to depend > on various includes. And so the solution stops requiring "make headers". > It gets the includes from a less volatile location. > > Yes? > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e076eaca5906 > > thanks, Posting this on this thread as well - Peter, John, There seems to be confusion regarding KHDR_INCLUDES. Tests don't have to use KHDR_INCLUDES if they don't want to. There are 4623 test Makefiles (excluding the main Makefile) under selftests/. Out of those 73 Makefiles reference KHDR_INCLUDES exported by lib.mk and selftests/Makefile. The rest are happy with system headers. The support for this KHDR_INCLUDES was added just for the case when a new test depends on header change. This is the reason why only a few test Makefiles use it. When test rings ran into issues related to dependencies between header changes, we recommended installing headers to solve the problem and introduced KHDR_INCLUDES so test Makefiles can use it in their Makefiles overriding the framework defaults. If your test doesn't need it, you can simply stop referencing it or use the approach used in mm test. It is a manual step. Works well for developers who know what they are doing. This isn't ideal for test rings. This isn't an ideal solution really. It works for the mm developers. # In order to use newer items that haven't yet been added to the user's system # header files, add $(TOOLS_INCLUDES) to the compiler invocation in each # each selftest. # You may need to add files to that location, or to refresh an existing file. In # order to do that, run "make headers" from $(top_srcdir), then copy the # header file that you want from $(top_srcdir)/usr/include/... , to the matching # subdir in $(TOOLS_INCLUDE). TOOLS_INCLUDES := -isystem $(top_srcdir)/tools/include/uapi The issues Peter is seeing regarding KHDR_INCLUDES in the following tests can be easily fixed by simply changing the test Makefile. These aren't framework related. kvm/Makefile.kvm: -I ../rseq -I.. $(EXTRA_CFLAGS) $(KHDR_INCLUDES) x86/Makefile:CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) futex/functional/Makefile:INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) futex/functional/Makefile:CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) You can make the change to remove the reference to KHDR_INCLUDES. If don't have the time/bandwidth to do it, I will take care of it. If test build fails, you can then figure out how to address that. Hopefully build issues related to header changes are infrequent. thanks, -- Shuah