Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1426528rdb; Fri, 16 Feb 2024 16:09:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUSKfnE78zGwa1Lq+foqLwoNkwKM4sHik2xakBVpHihBnfwRrT1GqZONOq4tCGehKWb7GCY+ULpJXyWH3mSsjFB0v3KFzwVkiQHzErIeA== X-Google-Smtp-Source: AGHT+IEfv/eCsoxZLD/SDW5zAvZmLMiocFfr/32EczfKx5S/tdyG49rj+ByH9LIgDZM6g4dKQAkj X-Received: by 2002:ac8:5a55:0:b0:42d:a986:c4bc with SMTP id o21-20020ac85a55000000b0042da986c4bcmr7103423qta.18.1708128542316; Fri, 16 Feb 2024 16:09:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708128542; cv=pass; d=google.com; s=arc-20160816; b=hvO3UuxQAeYapdPB4U+AyPPhXXRMGgRRxTFkoKNQ/r9E47KvirpmoR/3GJP3ZL/lXy vY7nyWDF4ifiZLxNOycBW83HbJOkxv4pCoDPFUA1PrtV8c/pcZOZp1dnf5A2B3y4H1Xu vyPa+xRTMwOQJ+9AckwMbuN+lP+zGWL7fvxPtBJ3wEC+qWW4k0H9ZxFq9W2mEyd2gATU Jywk98LWcjjAYbRuJF/HChCxGVGutusZ10p0a6QPS4hEZtoB90aUIuhSYeSS4d6fVeFf 43NhO4SFreX2Zf/6bnyhYUtIT2jKOS01838GOoB04dQN8p0aOKFuP5/GvWtgL4bjY7ET DTsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S1txfacIBFBZ/O4tjcxs+bfhiTiZyaDvYXwzko6DwYw=; fh=VywacuGvUKEVG2zdBnVyCKddxQNjFfLDQ94/WoX5Sq4=; b=j11hWielwwpF1uRx+kPdJiSmRdrqR5IfeVhjySRfYkowGaRM25HQcZ4XicANtj4G+j I/FxhFWBiyfZsEdivzJNEnA0vAlW8NAXcSufCslACqW3clxSxVKZMHPBM6qS4Zqz3KzB ptXGjuhwgD2kX+Uzk4uFVGMGKXJnii+ZHME7Ge3YquaNOvjbr6J73Z9pqEk/Dnv6DRNN ggLtTKQwWEmQgMM0DEvwDgsLbrtA6gpRiI8nShmIyuWo91yRpWJxL5jGfdVY/4Ohn6mG auVGAYPRaixRA/1gHhCY1odQrQ8ZmJTUr0wZjroi44zkeR76qiPaB+JwjZ/sGW1lGmXV WkEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FAXamuuN; 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-69523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69523-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 f20-20020ac84654000000b0042c3ed8f29bsi894011qto.391.2024.02.16.16.09.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:09:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69523-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=FAXamuuN; 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-69523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69523-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 186491C21238 for ; Sat, 17 Feb 2024 00:09:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04F2BD502; Sat, 17 Feb 2024 00:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FAXamuuN" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 6F9623D68 for ; Sat, 17 Feb 2024 00:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708128530; cv=none; b=Kff4BaauPN380w+hUU7FSG5MPndyEaI7L7hYsihxg9VIZP/iPEYJhdpYUwzQJSpnDb129W5hYh5UxRXctUOZGOqeJypD+yZQ+iROlqxFRTc7tcVagodAzbcBdwmIBjfSuUdDHTe9ovZFWvbhvMEzXosxvF/Hdg0968LKgXifbfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708128530; c=relaxed/simple; bh=plU6YhEkyhkbfKgfjHrx3qjSg7IHeMnpyb2DBIHN9Rs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LbDyQLKLT6LjnDclhaLZArborw8NK1DSr1wYfuzjQVD0PZ8jVeE8MurNnohajNCUnEJqbOKeFNNvkGIOrhOLCnrqZEkdQxHnROgMVmtigb5clxsEvCRk81jujXvnSShgGbvgEH3z3i5z4Cq06PHAvPtWkC9aRcT2hywW+DTVF04= 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=FAXamuuN; arc=none smtp.client-ip=209.85.210.180 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-pf1-f180.google.com with SMTP id d2e1a72fcca58-6d9f94b9186so2159587b3a.0 for ; Fri, 16 Feb 2024 16:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708128528; x=1708733328; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=S1txfacIBFBZ/O4tjcxs+bfhiTiZyaDvYXwzko6DwYw=; b=FAXamuuNv/zQzAsTiczfELCzSiTGSx1i/N2NTp0zupFLDQsEIxjlp36niuZ2AP+LXG uwz2r7+1poIRzYwVXiE5dopiurRDvewCRlMU4JDMQz2+foC3MvDRrVkWlpAZZy83/LUv Teb8jXfQwKklL/wDFlt/TtF/74WCF3iwL7PHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708128528; x=1708733328; h=in-reply-to: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=S1txfacIBFBZ/O4tjcxs+bfhiTiZyaDvYXwzko6DwYw=; b=HNrWUp2918JSr61tE4/dGSaB9IEDn+JGjjz7sQVxpOD/GbqUVeENiD0zKK1xN8PTtv +ugp3eYp8Em0TB0oEWEpmcRZ8tMhqEL3trbxNjQFL69/Jm9Sb8LEmAnxHyqMxuJ8d0Ww Fi/H8R2HcflG9FLvUv2Dm3dS1ZJv5UgrpvlDWckTA+RevbAC2n4K7a2pVW3TnMcASu93 9t8PHRji1nOxDZuu90jhvexqE3EkcjGhmntUZsI5YNWkVgaoPqp9yRR91ytwO5nq1qG/ ZTggyddQdTLLA7cDqHub+k2UaBYCbwywIbjJ6vYB35MrNbt33gyJBFJJdL8v1B6t05i6 eMQQ== X-Forwarded-Encrypted: i=1; AJvYcCVdgTCymEu2sEaFosQnELd+Xtco8/Ct+5J39iCLq4GAk0q0P3se+eVXtKfuKBp/7WlVEMNZ92pEdAcfigxJpeab+9luiTHvqv77zjLV X-Gm-Message-State: AOJu0YyGswTk/7g4KaoHHb3ObKy1w2jBTfTjT0s2wXbjzp9oInXZ+XC+ M6F+7GVWJxT6XJny2of04S85yItZHIi74B7xMMGpqhKGeKtEMyW4MGcZcLvt+Q== X-Received: by 2002:a05:6a21:3183:b0:19e:a9e6:c05 with SMTP id za3-20020a056a21318300b0019ea9e60c05mr7276163pzb.43.1708128527870; Fri, 16 Feb 2024 16:08:47 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id z3-20020aa79903000000b006e094bf05f4sm487826pff.213.2024.02.16.16.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:08:47 -0800 (PST) Date: Fri, 16 Feb 2024 16:08:46 -0800 From: Kees Cook To: Kent Overstreet Cc: Suren Baghdasaryan , akpm@linux-foundation.org, 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: <202402161607.0208EB45C@keescook> References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-14-surenb@google.com> <202402121433.5CC66F34B@keescook> 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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Feb 16, 2024 at 06:26:06PM -0500, Kent Overstreet wrote: > On Mon, Feb 12, 2024 at 02:40:12PM -0800, Kees Cook wrote: > > On Mon, Feb 12, 2024 at 01:38:59PM -0800, Suren Baghdasaryan wrote: > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > > index ffe8f618ab86..da68a10517c8 100644 > > > --- a/include/linux/sched.h > > > +++ b/include/linux/sched.h > > > @@ -770,6 +770,10 @@ struct task_struct { > > > unsigned int flags; > > > unsigned int ptrace; > > > > > > +#ifdef CONFIG_MEM_ALLOC_PROFILING > > > + struct alloc_tag *alloc_tag; > > > +#endif > > > > Normally scheduling is very sensitive to having anything early in > > task_struct. I would suggest moving this the CONFIG_SCHED_CORE ifdef > > area. > > This is even hotter than the scheduler members; we actually do want it > up front. It is? I would imagine the scheduler would touch stuff more than the allocator, but whatever works. :) -- Kees Cook