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 DA0A2C25B76 for ; Tue, 11 Jun 2024 14:14:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6B046B0082; Tue, 11 Jun 2024 10:13:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1B126B0083; Tue, 11 Jun 2024 10:13:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBAEC6B0085; Tue, 11 Jun 2024 10:13:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A8BA56B0082 for ; Tue, 11 Jun 2024 10:13:59 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 43AC0A0617 for ; Tue, 11 Jun 2024 14:13:59 +0000 (UTC) X-FDA: 82218801798.27.0131F44 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by imf25.hostedemail.com (Postfix) with ESMTP id 6F4D4A0008 for ; Tue, 11 Jun 2024 14:13:57 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LyWzhl50; spf=pass (imf25.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.160.50 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718115237; a=rsa-sha256; cv=none; b=8jYEVGzlKJLZAk7G9JNkXV+wiyOItrGCrwOWB47fv+JjCnUV/gjCn98BNHgVqcbmHaLKNP OHSYgPpQUN/dVXIRgi6bJ5BNmnFsT2lF0+JJdfq71QraGMg8xw8Cyfs/mjbExpwORDtp1E ir84nrpmIGkIREOq6oHdGzEpEY97brw= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LyWzhl50; spf=pass (imf25.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.160.50 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718115237; 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=Zy8oHMpwAzTnrA6hIQed17Wxd5v4cl8lNZdtIYkbZh4=; b=XX3fxzhBboj21pVpFZW2qu3GXEQKn/zgO5sH3sGvrwJN4v8M7O0jzr8PZ3U8frBwqvSfE0 FCu4L7W+D5ME9JGguWlTtkNL5SNCIbTt1F4uItuhRwEeG3LunrEKHsQdrZHyNiD7KwPzgt n0WOFUKuSv1biFo5pUQ7Yg/lSE8E6NQ= Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-2508320e62dso405446fac.3 for ; Tue, 11 Jun 2024 07:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718115236; x=1718720036; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Zy8oHMpwAzTnrA6hIQed17Wxd5v4cl8lNZdtIYkbZh4=; b=LyWzhl50PpgvC/SilMFdYnG8RhylSO/XlDFYgUw7CyEESWU9bdyn0HZaLw8Ogy4hot n0Eblab+SpcVzg5oSlmM+siVbgAhvZafGKfReLoy1HciU/MA7JuBotosWw28mji9TEOp KMy95/DO7d3vS0VtSa6sPJhNyESSKEW3Hohgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718115236; x=1718720036; h=content-transfer-encoding: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=Zy8oHMpwAzTnrA6hIQed17Wxd5v4cl8lNZdtIYkbZh4=; b=WdxMkaRDfJVOYcENza/xZR7cOu2kLfqPCyM8wsQtxzPjfLgv5pcHjuLG4SqgH1ALWh T0CWtgGGG5UCpbw49GwKfd4yynMOVLw9w1kBj6aymozmWSBdhx9AImjnsWpBf2ciRnGq 3X3PqneRVHZkSoU/GOcM663i5zmHu58yjy1dh10J+d/b7StMKLJTw8xwbUM4/NaKpU3N zoETDlTg+wnQZFpzExASj7rnY7xS7Q9KWanVliupDXraKaxiGZDkE7DgsCjd2XyDX8XS AwiiwoDW921RuFLGEj3oNc5I75qXb5EvLzzKud6QQuCVoghaHmTfJSuunAKnchUlRrv8 oSrg== X-Forwarded-Encrypted: i=1; AJvYcCWhME9OCobX/FkBVKJ6s8PS0703yjQTY0Y8qY3FLnB2lroXrS+qRKLj4VL4py4/a14OFEKyfj6h9CYtemXe00K/ahA= X-Gm-Message-State: AOJu0YxOZuxWgHRyNUm/wRYdjEna8ns8w7WrzhP0xQi/6Y9DMhYuAEhC 5xkfyqY8oy7Rhjqz20pg6ES9U8QhFsTaTTiu6lQgXaYkuWhBTFBydEPQYZhdbghRONbMkUWIwrU a0ziAxFQezHQwWU7xCFunU1DBNhzKOBt0PfTd X-Google-Smtp-Source: AGHT+IEyLXp50AVlWar+ASEL8EEFzsgHFJzCmH5iDrtEytk/RBAQaUrOjGAzA/S0A1NSW/DgR87CGNyjYAUP4RRKdUg= X-Received: by 2002:a05:6870:ec94:b0:254:9ded:a3b7 with SMTP id 586e51a60fabf-2549dedd4b0mr9558744fac.56.1718115236307; Tue, 11 Jun 2024 07:13:56 -0700 (PDT) MIME-Version: 1.0 References: <20240608021023.176027-1-jhubbard@nvidia.com> <95005e7c-3705-48c5-8ee2-3d9b0688fcbc@nvidia.com> In-Reply-To: <95005e7c-3705-48c5-8ee2-3d9b0688fcbc@nvidia.com> From: Jeff Xu Date: Tue, 11 Jun 2024 07:13:44 -0700 Message-ID: Subject: Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers" To: John Hubbard Cc: Andrew Morton , Shuah Khan , Andrei Vagin , Axel Rasmussen , Christian Brauner , David Hildenbrand , Kees Cook , Kent Overstreet , "Liam R . Howlett" , Muhammad Usama Anjum , Peter Xu , Rich Felker , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: b8if7f4q47cpkjqyattk5mb7yxp5wmfe X-Rspamd-Queue-Id: 6F4D4A0008 X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1718115237-369249 X-HE-Meta: U2FsdGVkX1/iN28ltGPuB+i6W/CGZBTkQV4PbCLHqOT3OVwofpouVsqQ//wZSPvsAl4D5WJb2YWzRnAXvoZo5FTaJZcJsANyc/SkQmYAh7AkvQNdNJrUFMWFf7wIDrsxYsTs9SRYQSgekJKZLGyydKYEKFqOpJhxBitQzIjy9L0h4DZEusq0XJjlUQofXYt5Z5Ax6mXR81REAuIdhN+5SzRtTIxcyf1tWAxYXHppCz00qfQgvpTq/VEWI8WXGwhBCOp5sqle2zjc4fpEMk+/stJaYzJCDizSgYbdk0yF2lSYiutpVw3k2lPkXugxXnoTmY0ZN58UqRJ0EG0be3ubwEDVy5QJ00I08JmQmHpmvLVZYMZOPHWCoASeS1L3SAWLfN4XZNa//oNJarVlPsRQa2yN4BjboJEVavxgF7QNsla8D9ZZzdn3gY4TYsI5wfevvHBChvDWKD6t2W264ay2vhx5dTTa5210vgRMjoIxqEIFb1Jc85Kq7NXhAPKDPTBvoWHW/nmgee9g9GRY6uCe5eFtPY6/Cl/m68fpfWpol1TilQiz0SbRvuvmFziZj6GKuKRqAubNdIXQBh0CXOPrF98s/Bvfg62w2/H8LE13P/2nJCgHy81SQcMYwSUm+33lSdo2ypc/CAvcIKSdwyadIwc6NPBgHc4+ObXF3wI2ABK+uefbQjzvz/EgWlZtFf5Z7DVDIwRgVjec6SlLYAp79U13YkR3rAj5UqBiMkrbnIMiIaKv+sv+/AN7NayiO0Louufyt7DhquaLWACDwsZMfMF0KN04gYF9nB2lfyy9yI7hP7yVY+9gm1egU13ZSbAQgKnKHrat5xGPDLKjW/xY4iFjRRjlitZ4wP9ZSQ2AfUYX/HLdpeQYgyPUdcwTV+t8gYsOuK2HL5TCmtQeCYHSJaT3W5j6KhqChderJgZbqceOx9ZjNpbLy1sTpDFLwHzVSUxsW/BjTiFEyALAhua 4ljZOksU M4Xim+Kj/ulqHpbmr3fKsIcWr7T0L9dtqF791wct+YXg0dGU+xnmvBSSrMcIxGxM9RDD7+7wqysmpaNNUML6ZpkXzdYEJizKYbHscRxow68ny2gPxYVu4CMJqpetKa30cQYpPi5BRTEsyOE2pDg8oGDEW7vHz5g7brC3202fipFuyKoYVJ2MLx+qX2QCEf8IDJM4PbM407e5nR7g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.002406, 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 Mon, Jun 10, 2024 at 11:26=E2=80=AFPM John Hubbard = wrote: > > On 6/10/24 9:45 PM, Jeff Xu wrote: > > On Mon, Jun 10, 2024 at 9:34=E2=80=AFPM John Hubbard wrote: > >> On 6/10/24 9:21 PM, Jeff Xu wrote: > >>> Hi > >>> > >>> > >>> On Fri, Jun 7, 2024 at 7:10=E2=80=AFPM John Hubbard wrote: > >>>> > >>>> Eventually, once the build succeeds on a sufficiently old distro, th= e > >>>> idea is to delete $(KHDR_INCLUDES) from the selftests/mm build, and = then > >>>> after that, from selftests/lib.mk and all of the other selftest buil= ds. > >>>> > >>>> For now, this series merely achieves a clean build of selftests/mm o= n a > >>>> not-so-old distro: Ubuntu 23.04: > >>>> > >>>> 1. Add __NR_mseal. > >>>> > >>>> 2. Add fs.h, taken as usual from a snapshot of ./usr/include/linux/f= s.h > >>>> after running "make headers". This is how we have agreed to do this = sort > >>>> of thing, see [1]. > >>>> > >>> What is the "official" way to build selftests/mm ? > >> > >> From Documentation/dev-tools/kselftest.rst, it is: > >> > >> $ make headers > >> $ make -C tools/testing/selftests > >> > >>> I tried a few ways, but it never worked, i.e. due to head missing. > >> > >> You are correct. Today's rules require "make headers" first. But > >> I'm working on getting rid of that requirement, because it causes > >> problems for some people and situations. > >> > >> (Even worse is the follow-up rule, in today's documentation, > >> that tells us to *run* the selftests from within Make! This > >> is just madness. > > > > That is hilarious! :) > > :) > > > > >> Because the tests need to run as root in > >> many cases. And Make will try to rebuild if necessary...thus > >> filling your tree full of root-owned files...but that's for > >> another time.) > >> > >>> > >>> 1> > >>> cd tools/testing/selftests/mm > >>> make > >>> > >>> migration.c:10:10: fatal error: numa.h: No such file or directory > >>> 10 | #include > >>> | ^~~~~~~~ > >>> compilation terminated. > >>> > >>> 2> > >>> make headers > >>> make -C tools/testing/selftests > >>> > >>> make[1]: Entering directory > >>> '/usr/local/google/home/jeffxu/mm/tools/testing/selftests/mm' > >>> CC migration > >>> migration.c:10:10: fatal error: numa.h: No such file or directory > >>> 10 | #include > >>> > >> > >> Well, actually, for these, one should install libnuma-dev and > >> numactl (those are Ubuntu package names. Arch Linux would be: > >> numactl). > >> > >> I think. The idea is: use system headers if they are there, and > >> local kernel tree header files if the items are so new that they > >> haven't made it to $OLDEST_DISTO_REASONABLE. > >> > >> Something like that. > >> > > But I don't want to install random packages if possible. > > Well...keep in mind that it's not really random. If a test program > requires numa.h, it's typically because it also links against libnuma, > which *must* be supplied by the distro if you want to build. Because > it doesn't come with the kernel, of course. > Agreed. > So what you're really saying is that you'd like to build and run > whatever you can at the moment--the build should soldier on past > failures as much as possible. > Yes. That is what I meant. It would be a convenient feature. > > > > Can makefile rule continue to the next target in case of failure though= ? > > That could be done, in general. The question is if that's really what > we want, or should want. Maybe... > > > right now it stopped at migration.c , if it continues to the next targ= et, then > > I don't need to use gcc to manually build mseal_test. > > Let me take a peek at it in the morning. > > > > thanks, > -- > John Hubbard > NVIDIA >