Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp214247rdh; Tue, 13 Feb 2024 14:45:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJ9gUpevY/ldhaqQIn2ssbHV2miIjmORm6+w24NWV2ix0j03vGwL6rFMOvg1AfsBNHXoAPs7SYROf/jW6mmoqkTAzcxD/aznxOkgupQA== X-Google-Smtp-Source: AGHT+IHKx49B0oyctkfk5gZEqaMuFPeFQD7PeVq7uJZtYWvAQpaHo+H/BiqrRd5U6XWPaQK02719 X-Received: by 2002:a05:6a20:ce4d:b0:19e:982e:c402 with SMTP id id13-20020a056a20ce4d00b0019e982ec402mr963131pzb.59.1707864346482; Tue, 13 Feb 2024 14:45:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707864346; cv=pass; d=google.com; s=arc-20160816; b=r3uS+d5IZUXnY0Au5cE6QVzaqpD9AEPpQ1zapqm2P4bCZoKlSRmwmyFjTO4ozuLK54 gEhgsQW0FcfBS5/mCgpWfH4wbc/Wgxx5TqMRNevYG2UVjo2qaYduC4g1cNnApPIQ9ptA fzJsIX0Gnb9zj3Q1J10orVKe+knZUHBJl3b6/nrLQspgdMbSAg+mgN9Av2X9t5Htl8z3 S23qej3PFgvCeS1dQE+KtgyDSJ1XSTXE3qOSKirhwXzrJspNK0mrZk1xkPe6gefaOHuA kntZX4Ck9sdA1gN7kpo0Vk2J6neMl8coJciz3SS+weVIO9NwYUma3W4eyc6XMBm9yY6j bFuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=2hiMS9Vllp3coocjvge8ABDhc28Vq8F9ZVWNu08lRdE=; fh=aYjmzl0B9hkjdhYx3xrzTXpDMEwAzQ21JhMBnxdGut0=; b=C/K6r2Eq7K9IE4gLimrLy9gKXMimpBSfp5eZWqxYaxH73tz2tbdDBhrPHU0GvoQl22 Q0oX/p0PyXGqWiRBX9xeqvWtbhsEuB0b/IX1ci24cCfj9WXRpALQtRq/d7F7bYPtHArG Iu/gflKMQRW6ESVrz6yQiwtz/YxWV8DH3Naqo/24sLkgeZTQXOD96rx6sIZRJsCReA29 YffIqlhO/0IV2EJUdaKm7/D8dqhO4eiGQzVpx/TpEiw5DYAEVVmmb/lJreppCdQ8F+Y7 Ej8J+S5hta9J+aAMTN3JRpQMOP+ftLFUWs9NjyDg2RThqu0SVso13zbqi44Mvk2RcPdJ nzow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JN+F//BL"; 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-64468-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCVhS/YaCMVxcBycsNcXyVYxqi6v1CZWGGljazy+fbiLprkfN3suDfJpCMJzc3S6YHoQxu1RhAKmWyDistwLagbX0+N21aP+CEbUfw8b3w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n3-20020aa79843000000b006d9b4ee5b2fsi7354974pfq.12.2024.02.13.14.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64468-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JN+F//BL"; 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-64468-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64468-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AB6A7284F37 for ; Tue, 13 Feb 2024 22:38:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9697A629EC; Tue, 13 Feb 2024 22:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JN+F//BL" Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 8F5BA626A1 for ; Tue, 13 Feb 2024 22:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863900; cv=none; b=ilZY/A7Odc2NVAAUyyXHdmmHGnOMtVx0sJVJVZFVAdBTkdEWS79x0nrqllniLvBvHNgLYEqhoEPy1r3Vh9Gw7aX8pqcIq5wtT93lXr6wGiE5C6pFAo5wf4OV/5QonzoVHYYZfEBn5GD+qxGqwj63gRE+YknsHaCVlyf4xGksylE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863900; c=relaxed/simple; bh=5lmrd2HyuhPw/NKgKAo36swBOE5JwrmFU/lD03z4V0M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oX0mJ6ldncMQnjqJ4c8c7IQUD55X65Ew67nY2HI+0zMl/fIItv997Wfp5L0Ow6dLy/JHVyDSsUXqDmApqydh7+1bw7Epc2Z/8fMG8HrQqPH/3Tllje+Aly2Ddow4BL/0XCFExvd/ylx6t7xb5hcCdr5Q9Ph+o+8p3K9ZNZPqk3g= 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=JN+F//BL; arc=none smtp.client-ip=209.85.216.45 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-pj1-f45.google.com with SMTP id 98e67ed59e1d1-290da27f597so2872184a91.2 for ; Tue, 13 Feb 2024 14:38:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707863898; x=1708468698; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=2hiMS9Vllp3coocjvge8ABDhc28Vq8F9ZVWNu08lRdE=; b=JN+F//BLH7Bz/09VqERqN2GIBcP+TbsfziWnzCv44cKRm8+QI8c6fsRD8VpVYozHp4 ZeuKjVg6bOhmyfSX6+yICv4uU2evm5CXHVx+of1l7AFBToCop6DZL81gdRz04pUSfjQV 3rjHtZtyuSsrybiPg1kzNoz8Z1CYySDw4MrwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707863898; x=1708468698; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2hiMS9Vllp3coocjvge8ABDhc28Vq8F9ZVWNu08lRdE=; b=pfMBm2Y89mYHICBzwepcZ46nE6CvnAvmHIPZIJmD4Iw8QOwjtp6NFG7JCUsOgoUbO5 oLaFa5+aYkvU0tm7VC9YIFxk3V5xcGRStZCIIB5fYeurMGarA+H/crAWc8rDfaFyohTn ONDLc+sr2tPyaW4U0/uWL23czJ2ORH+7XHTRR/jT7baOPmg8AheAd6YBihHCUkcZpnLr YlutAN56b8l1pEXQuRgplFAHLGQc/OLcCICGZkMEs+ekNKckJgQIIeZyn2q417C14fPt MidfvnXLmoU5W7NCSjfEsvxSiZRGkDf3bJr+3gJ1ZSkMdK4sB2E5eZ+MeU2o73nzay8n UBtA== X-Forwarded-Encrypted: i=1; AJvYcCU1mgvl5ZxdWSfbfQBRgeZ8HwozOaHKqIekYHie0vwHobktA3exR/UQbDwQMoBSKdvmxkdObIVPpz2we2mzTaQblF5Gn1N9ts12JqxV X-Gm-Message-State: AOJu0YyS5MMYsgOXEjUfBKlIC3TU3u42SjKW5uGmt1xlRkAmEe5hc76O BPjPDRwK6MeyjDykXMbVof1CaHXsATgOFpqe84XdfMBTZohjzsWRLnod9k+2jg== X-Received: by 2002:a17:90b:24f:b0:297:1a1d:ca86 with SMTP id fz15-20020a17090b024f00b002971a1dca86mr997602pjb.0.1707863897956; Tue, 13 Feb 2024 14:38:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUAJMGyS+cfE4Vm2UEiNKI/hecsbcAVG5WU/JHrRKkPbyIxrhsVjUn6Zi9OuF7mJnze7EYdor6qYoOKsCn8l4tMQmYmK/j47yu3M/lPS0Y9IgNhGhxdzHYC8jRKF6rcYTdZaVet8GHijHrj38weF04EDit6f8h5F20f2KGuxpehNQx3o3nAJox+coa8a+bjPvLNx0oEvLdolQ+1lVVE1tOCDnC2pgOuoKCMVZMqjMwPFqNvV7uULLMZiLRgxI8gwLUpFy/uV6qID+9NjuBNYMG12vCZHM7WCP8Bdd/jNaEXKRzpcngBW/+mwAuZ+gPLq9Ts+obYMaH3/Un48+/pL4/Lu6yj7TGH0wp2nRRqVVMMbLJMARzVsoQcMSapaM3EtoFqwoxydbubxnv3yVpvPThtnhILB0yRor3VOUu6pH/xtpAUORQUgIExaI8bixGj7KfPYv+uqJ71f3YzyS7zHqDC3D6peX5jywvDEn2CoBxOoF9qZyOgpIwmy6K+eWdJJtn187KGDWfVsmIu5FaSEbq4susI7ZxfLL1Rmz1bQ5sq4PhxOWIzGjs6L740RyKsDndaNQEXn3jZmwrl3+Cfq3vuCb9nM+t0chloxM8OhhopMK8HSW48i2nxxMPLu1cQBlEA0KpkMHRrltEIKuhNqiYXuyvb4j6P62sHq8bVVDcROr2w/LNlYg5lS203DjRScHnWHA+YRRiCxw9nSigv402S5c1vOEEGgb/528h2sdwRyBoL+ZLMZ7Q9d/5S8UAa+eMaYQSXcs8oQ9VlgNcIpfQm26V+ Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id 60-20020a17090a09c200b00298b2d60ae8sm40014pjo.11.2024.02.13.14.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:38:17 -0800 (PST) Date: Tue, 13 Feb 2024 14:38:16 -0800 From: Kees Cook To: Suren Baghdasaryan Cc: "Darrick J. Wong" , akpm@linux-foundation.org, kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Subject: Re: [PATCH v3 13/35] lib: add allocation tagging support for memory allocation profiling Message-ID: <202402131436.2CA91AE@keescook> References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-14-surenb@google.com> <202402121433.5CC66F34B@keescook> <20240213222859.GE6184@frogsfrogsfrogs> 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: On Tue, Feb 13, 2024 at 02:35:29PM -0800, Suren Baghdasaryan wrote: > On Tue, Feb 13, 2024 at 2:29 PM Darrick J. Wong wrote: > > > > On Mon, Feb 12, 2024 at 05:01:19PM -0800, Suren Baghdasaryan wrote: > > > On Mon, Feb 12, 2024 at 2:40 PM Kees Cook wrote: > > > > > > > > On Mon, Feb 12, 2024 at 01:38:59PM -0800, Suren Baghdasaryan wrote: > > > > > Introduce CONFIG_MEM_ALLOC_PROFILING which provides definitions to easily > > > > > instrument memory allocators. It registers an "alloc_tags" codetag type > > > > > with /proc/allocinfo interface to output allocation tag information when > > > > > > > > Please don't add anything new to the top-level /proc directory. This > > > > should likely live in /sys. > > > > > > Ack. I'll find a more appropriate place for it then. > > > It just seemed like such generic information which would belong next > > > to meminfo/zoneinfo and such... > > > > Save yourself a cycle of "rework the whole fs interface only to have > > someone else tell you no" and put it in debugfs, not sysfs. Wrangling > > with debugfs is easier than all the macro-happy sysfs stuff; you don't > > have to integrate with the "device" model; and there is no 'one value > > per file' rule. > > Thanks for the input. This file used to be in debugfs but reviewers > felt it belonged in /proc if it's to be used in production > environments. Some distros (like Android) disable debugfs in > production. FWIW, I agree debugfs is not right. If others feel it's right in /proc, I certainly won't NAK -- it's just been that we've traditionally been trying to avoid continuing to pollute the top-level /proc and instead associate new things with something in /sys. -- Kees Cook