Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp457157lqd; Wed, 24 Apr 2024 07:28:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUL0QNQWaFVV5shTH+HfSp9N1QHTSdsK5Otr6FRlSblBCoRg0CY0f6ky70OFfWnJbiH/HWI62i2qwk0klJp13RleC4ZAfI6yFPY/CqLaQ== X-Google-Smtp-Source: AGHT+IGTx0y34D7+yBUyHY6NWq4Kgow3Xn7UXDS1VtPkoGwPRDPTUaf9IW2xrn2gXUFdbd8eV4xA X-Received: by 2002:a17:906:4715:b0:a51:cc20:9116 with SMTP id y21-20020a170906471500b00a51cc209116mr1625991ejq.68.1713968900002; Wed, 24 Apr 2024 07:28:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713968899; cv=pass; d=google.com; s=arc-20160816; b=LZJ+VwitVodOhwf3XfFpz584uCmnEl75ooShad3USOjEj+tHj8HpCwW1oiim03ICRr dKV4UgBHSrmmbl0F6KIGIZ1imzqWjLMWzR+kWlvlMLOWBOPczoOdohXKeETBIsowtdCk tKjn1NiWQVNoRrzPDGtv2U9ZvZMp9H/3E4QY6Ruhu6uFqiml1802JUoxEqzHGKkX9ugN +nxEsshFZNacCyt6MWD/MHixdHt0va0xON13SjQwwwjIyS1qiQpa4+aSj8jkSErQSzCA 6hAebyuJdsSsxUlbMEyl/I3CopIrAz6hvb04/blYGcxZYaZ3/kmR+u98i7DVQB02z7Hj dutQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ezizs9A8Fz3H1qi5ShWed7nsr+iy/etecKSt02sUYP0=; fh=KUqUWnz0xQyEtWom/Uz3/y//AhtCuzY6E9BFtQ7SgJg=; b=Z0LWVXpkuXgRXXM5empGR34s4PJ+VXyWYs404SIahQ18/R4wRHnELiUuqTU3pPR0Yb JCVKceWeGqwmf+s3N99PFXjnyrRbHgrnXI7aofXX6dCZpFwIuCG6Whv4ubQcHjqGxhMh Be6t5qRUPaipXOpv+wi/8buTBge4XCzPNErt0NZlewiGsQ17NsKQaeyMC5I1fNAXu0Wv miiQvE/9FYzikVj0NPtJ5eK7brkyQwFoyA/ogneOtmgF2HeooYPcW4LoF5O6kSvXqAFW EQaJYA2zB3DVe29Q2LO8CkdXk1qtZFsDvOxhGz/+qw51lBQKJ8cx5j5WibLPBgqLvwJY bkkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DvFToGub; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-157062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 24-20020a170906319800b00a558a9e3dd8si7071911ejy.853.2024.04.24.07.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 07:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DvFToGub; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-157062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3F43E1F27732 for ; Wed, 24 Apr 2024 14:19:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 883C315E5DC; Wed, 24 Apr 2024 14:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DvFToGub" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 037BF15E5B1 for ; Wed, 24 Apr 2024 14:19:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713968366; cv=none; b=b8mkj7IAP/+kddM3Nl6KnoyxPMpF9pb5pT0MTi5kbTfc/5pXTitS5UqgEToMJGolWl++6NOSGbmdEz0Mipv540AgH+t+Tnoz46FAAwmjo21LSJGZUlG+maeT7Pijf2LfRNRc0XnyckV2hi5SJeB1CAO/1fmV4UAddKUpfxB1IRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713968366; c=relaxed/simple; bh=fZJNHIBFq2MxPupaYjlJMTkUfFiuqL1Gp84Ul8wEHfU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pxchGLLvBYCqmOLcbs9qlhRkNtMKsaAQN5UiZtMZGFzp7/6MOnNXOHIUlxYMeQCn9WJo8NrHIiFW5K+BEPsAB5lMyVwuTBK7W8K26cYyA6Ch43DO7HKtriblHqcJ3mKoa6tf9DRNEjeSHECiG81KpCmUakCeFsMqlrT12piT/7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DvFToGub; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713968365; x=1745504365; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=fZJNHIBFq2MxPupaYjlJMTkUfFiuqL1Gp84Ul8wEHfU=; b=DvFToGubKgUk6ZnIlqUmTrjWnD+BHGcRma89apjoEaI92Pzhglr9Ywkg GWk2Xd6zJl9AW0hfUHFCZAZwcUL7KS1LalBY6djME9IvOxARXyN/R5Wg0 PmcJZr98WQnpPxhciDtmvBHhMvptocWqi5frFPHNJpCKNvzxDpDOGVm6I txdUhdFhB2q3JsywzOkcV1hY9U/cY1m+ub4mWiNCTnTJj21L9glrEmicY x7P/3wnluqkn9n3PVG2UCZtjH5HuRajQiXb64MJKudj2aE7URp12cYZt/ Y6AHTcTrtCkzLL6KB0aAWpwe/dRrZY5bd4G1/1tJ3YPwZrq1NxiZfTHCK Q==; X-CSE-ConnectionGUID: cTEfzjrmQMCbqs6TaTlWSw== X-CSE-MsgGUID: w9IfvzXJQWGM+qcW0II9eg== X-IronPort-AV: E=McAfee;i="6600,9927,11054"; a="13391522" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="13391522" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 07:19:22 -0700 X-CSE-ConnectionGUID: KvEXr0tjQfGZeHLg1lHRzg== X-CSE-MsgGUID: kj/3o+gLTbmD0DYHOm+ejw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="29190985" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 07:19:20 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rzdSv-00000000fjW-3PLB; Wed, 24 Apr 2024 17:19:17 +0300 Date: Wed, 24 Apr 2024 17:19:17 +0300 From: Andy Shevchenko To: "Liam R. Howlett" Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Willy Tarreau , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Andrew Morton , willy@infradead.org, Namhyung Kim Subject: Re: limits.h in tools/ Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Apr 24, 2024 at 09:46:46AM -0400, Liam R. Howlett wrote: > * Andy Shevchenko [240423 15:31]: > > +Cc: Liam, the maintainer of the tool in question. > > I maintain the maple.c file in that directory, not the xarray.c one. > xarray is willy, and I depend on some of the functions from the xarray. Ah, okay, good to know. > > On Tue, Apr 23, 2024 at 10:29:31PM +0300, Andy Shevchenko wrote: > > > On Tue, Apr 23, 2024 at 04:22:01PM -0300, Arnaldo Carvalho de Melo wrote: > > > > On Tue, Apr 23, 2024 at 09:58:07PM +0300, Andy Shevchenko wrote: > > > > > It seems tons of the code in tools include linux/limits.h. But I haven't found > > > > > where do we copy it. Any pointers? > > > > > > > > > > Based on the discussion 20220603183231.15159C385A9@smtp.kernel.org. > > I was unable to locate this discussion. `b4 mbox 20220603183231.15159C385A9@smtp.kernel.org` works for me $ b4 mbox 20220603183231.15159C385A9@smtp.kernel.org Grabbing thread from lore.kernel.org/all/20220603183231.15159C385A9@smtp.kernel.org/t.mbox.gz 8 messages in the thread Saved ./20220603183231.15159C385A9@smtp.kernel.org.mbx > > > > ⬢[acme@toolbox perf-tools-next]$ diff -u /usr/include/linux/limits.h include/uapi/linux/limits.h > > > > --- /usr/include/linux/limits.h 2024-01-31 21:00:00.000000000 -0300 > > > > +++ include/uapi/linux/limits.h 2024-02-03 16:18:02.652000641 -0300 > > > > @@ -1,6 +1,6 @@ > > > > /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > > > > -#ifndef _LINUX_LIMITS_H > > > > -#define _LINUX_LIMITS_H > > > > +#ifndef _UAPI_LINUX_LIMITS_H > > > > +#define _UAPI_LINUX_LIMITS_H > > > > > > > > #define NR_OPEN 1024 > > > > > > > > ⬢[acme@toolbox perf-tools-next]$ > > > > > > > > And in the places where I test build perf I saw no problem so far, the > > > > build failures below are unrelated, but still outstanding, see below. > > > > > > > > But then is for building tools/, not the kernel, right? The discussion > > > > you said this question was based on is about changing > > > > include/linux/xarray.h, a kernel file, so should really be including > > > > just kernel headers, files in the kernel source tree, outside tools/, I > > > > don't see where what tools/ uses to build is relevant here? Can you > > > > please elaborate? > > > > > > I believe the tool in question is tools/testing/radix-tree/xarray.c. > > I'm not sure what is being asked. Are you suggesting that the linux > kernel xarray.h header is including non-kernel headers? I don't believe > this to be true. No. The problem here that tooling relies basically on the external limits.h. I.o.w. from the current user space. > However, the xarray.h tools/testing/radix-tree header certainly pulls in > the kernel version of its header. The point here is that we want to > test the xarray, so we need to have access to the API, but including it > after setting things up so it will work without the kernel. > > The directory you are point to is a testing directory which uses a > combination of kernel headers and custom headers (to avoid pulling in > the entire kernel) to build a test application. Sometimes the real > headers are used, but other times we are required to write a small > function to do what is expected (eg: allocating kmem_cache objects). > > So our tools may include some kernel headers directly, for testing those > functions. It also includes testing headers where we just need the > defined functionality provided for the testing framework. > > Specific to limits.h, if you look in the kernel header, you will see: > > #include > > So, most likely, just including the uapi header satisfied the > requirement without pulling in more headers with, potentially, other > issues. IIRC including the types.h header (also in the kernel limits.h) > caused issues for me in the past. > > I hope this helps answer your questions. -- With Best Regards, Andy Shevchenko