Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp378012lqp; Tue, 11 Jun 2024 07:14:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDlE3ZKPcmUqtGuw8h9cLLoX06TeIUN48/Zf/T/B+9C+JEzNmFhRpcZAnhLGqz2gUcEBi3tEi1sXNYHr1aQIlxSSnFVOfjIn3e4vIjwA== X-Google-Smtp-Source: AGHT+IEJ8INWSHidJp7trhXDCGloH5quKnqPSj1vuhFfPnkLf8Cc9p02YA1adzkpjF7zd7PRzf2m X-Received: by 2002:a05:620a:248e:b0:794:9968:6b16 with SMTP id af79cd13be357-7953c4ab476mr1515580885a.59.1718115263985; Tue, 11 Jun 2024 07:14:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718115263; cv=pass; d=google.com; s=arc-20160816; b=mWwGABtTG0xdPsU1c4dn35r9vTvOB5wqziQdAlGsi9R24pfku9DgREfRLCGDAhpYPW ZFVvqIf/3mG4kx4PqiU04Zkf7ogbkRrxbZ3g41Qh17EjNz1w4SfT7sLe0J4ZTJMJqs2P 3MMfuMjBStV9sp7EMyi82qEKyuTJz6z4Klq/gz0TpAbq14HQ3BhOG+bNYWjKKnR5o0cj AufnFmIBPW4ue7mJcNxJ0UK2+S59/en2WF1EK0W1SrEEvoBh1qqcdSlVa2SwxBs/wc1w MfJzNmYwlb4PbbxvdzpdjawucXc8nZVbwlCMISlCl385yPoZeM1YWmJf8Nq1pvwyzUfu TQPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Zy8oHMpwAzTnrA6hIQed17Wxd5v4cl8lNZdtIYkbZh4=; fh=vUD+IVb5Bl847Y8ckTZ12sQdczGXj5Jst3LSoJeYLLI=; b=rvL+/RgJj6+MfktijHZ7Pz2TzDS3zaGvVPAg0XvmvA8xiaLWfDe60qxUfxATd1wfXu YErc/30sc+6pffuJgxaZVsd5RVugqMcRd9mN8ask1BlGnLnNjVhvMf/D3NcpJGgTXJV6 AJrV8OVyXmAmJFh50K179a8HaLy91DOs47vsbNL0TE8y0aQKg9PY3CuWlJuOdsaRe1pQ Fbfc2aPYdSk7T7FyoMuuWNkwrvies1xhnM7heOkocfjl8N6sWcBgvbm52lptNEPvXI3x uONW2O8UQUuIsMBq7i2HSGpRA3NLNUWfYPEW6pWrqhcn1Mn2ApxXs/3SBw8ZICRvWLUS WkWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aUivzDZW; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210045-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795599602bcsi728498785a.778.2024.06.11.07.14.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 07:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aUivzDZW; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210045-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 959B21C22545 for ; Tue, 11 Jun 2024 14:14:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5C1D17DE14; Tue, 11 Jun 2024 14:13:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="aUivzDZW" Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F16F17D8B2 for ; Tue, 11 Jun 2024 14:13:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718115238; cv=none; b=oO5ZTgU7Uj3ZziRSgOjGHqe6lBmYeUKGYc9YMXtum0Xqwz+HpL2Yw6Ky/HRLHmT+/R33WK5f7k71X5grCBWravCAXxztEEvFgTeTd+tOJi+54W6cTExBl+r/zmSuSPQtWGMxKDuU6Vh/Km23MXZju2OOk/B7/2GC8gX9N0MtP48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718115238; c=relaxed/simple; bh=DenBAvY1VgHb5IE7Lt78+EUBNFqsgXe3l0GramNtKiU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nZ8cZ386gGoaAzv/If5g2HYcF0Jg6lGPWWkrO3Rt3RNByjUeT1dpjBPySeuY5pXzvAk2eTzbPzj4wNHVlDfEr8o0D5tc4IvsReJd+VADVgcjEUfINOlMs7S1tcicPm8QMReYBgvs1bvD118wFXQtUEnHdWVrXM8eNFNdMTXTqpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=aUivzDZW; arc=none smtp.client-ip=209.85.210.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6f9774a556cso697756a34.0 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=vger.kernel.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=aUivzDZWNQ8SqyNsbBG3+4fNSTd21gRLOewQWkR8CmKrEEtlA5k8BTZ2V0tCo3OsNN 1LyesWDclfUe4hEDsrXOl9FIyaWsbAXXk4Du839UG3R+QWUv2vNQX0y6SZgfewHPrb3D HZSy/Y6Fc25NHT2o1qnlAhs0pX+FZQvohHN+E= 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=e6jWlhCs+KCWCGLjXemaaWKHUzZC9A22G1ydvqocU93KxDqZETFUDbZGUGSJOiTgyo YX+D4TVWy8tk//4m6ZjEJOE5H2BNhhPtE4IlK8BgTiyXUad5tKMIJraSjWB814G1ZTZ4 +Kz5hW/wKkufdwF3IfCJd8Ahj2CHFUdSnr+BBaeOfMiBkcdJ4wRCCogGOdImY8eQfOHN o18PFGHUwX+mzuArV/AYxZefVQULK+PXlN2Vbqj5jZN2PQraxWhNTYV8zHvCqe21ojzV OaFOyC8AZaemE//QhLYFU83D9WwIS+kO4/6JaRERBd9VP5IDqYDF//+6pRA1O/rg/nTx 1QWw== X-Forwarded-Encrypted: i=1; AJvYcCVf1AyBdiu1O81qFfuB6B9FW38LECXovzepuTBqq2bbXKYV9ikXv3kCQ0mzENczwcifvvTccCG8+/Br7kovJgGW7R7Hysp0KTQnjpAj X-Gm-Message-State: AOJu0YwUt7VVMiYO4kxhsDwCKuwCrOMRsHWwqEZCRxrxM32BzQ64bGGW DkkZsGDcdRCC2AD4yQ4hvIQ2GWDOow90CWD342GR1yV4ALHvtpZaLZpMaGyrvl7YRkKgMqxuYq2 pJATlfINdMSj3gTup0iEQqvyRSjv/dHQah1eA 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 >