Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1204407lqd; Thu, 25 Apr 2024 08:40:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQNQMEloLBoZ1pEIfzOCrkRE/4jgBo0sA9Fo4GIfNcxCMuprLdUiSMgebQ4GYke8BGWvpJ4WMqe0rALj+M7Rw2WgXA770EfQ+hMkrzRQ== X-Google-Smtp-Source: AGHT+IHYwSrxxpLjBw1lnd9Zx0KjT8HIvbiG4YFR4ciHonXJ5BS8sdUClYtlxSO8gdbVyrt3NQKO X-Received: by 2002:a05:6a00:2392:b0:6ec:ffe8:af92 with SMTP id f18-20020a056a00239200b006ecffe8af92mr149753pfc.5.1714059611038; Thu, 25 Apr 2024 08:40:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714059611; cv=pass; d=google.com; s=arc-20160816; b=zKQ/OHQuuuL19H5fRi8LTqHI80Od8oQJsfgP4fYcVSy1R+xSNBfEsFaPsAyByCrL+t +4L3WLvFM9408YfTVxQal0zRXATeEdLLjwwacirnpeR7SlDvLNgg9FgdER3kS1xZJwLS pxY+rvBQCh5BcU0C+UXc8LSB9ni/GVVzhubXhtjTxbxmZeGAcEvwgwGl62/qAdGhquBo 9fNNa+GA/59f0k30CkVtPHbp3wEM89N7tnlZ+9An4p03XLo28C2ScZ24txukjcqoBuGF j1kS4d6dwYC46VuR10MFhxegkTCLBw+gKkF92Q5zdEs5SJYZrSpYAnVoFmajK8sUU+b1 MRUg== 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=e0BChCss6w1nIzeILAtQLE3LhBpW3YXUB4HhPqTq7zU=; fh=mhhGM88LI3ivcKjpcxiNbb3hg+UQQtS38xSXBHjuTeY=; b=oCU74UcpBXJzEbyPpRbF/nGF/kybctLZ53gLR7Rxq7WEzGxCLU2mSHKoifLvQnAp4P 1bVR7Zk+B6vFGxPt06ts7th+tg919XFcKHZsBZ7FHNNbrknCfNkm/YImJwinoOdHjKwb Npm2vOchS78AjTCd61pjSMbdCHlk0ZX9gCRLRXMYOBsJGtZkVvOumJnyejOGKhe5BQg7 MqhibAIC9NYMqRSql6oAv8i+GdnjJmfB/obpfODoC11wkHWqMzOfJ22BBcUQAkreR9FK CUmHZ5u0ouzwz32Jloua4NexQzISF/S7ITEN99QTRxCyl2yOUwn/18+6PjPsJz7pUaKQ nxBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Lu6K1LeB; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-158821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j15-20020a63cf0f000000b005e4f1d48cbfsi13814139pgg.816.2024.04.25.08.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:40:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Lu6K1LeB; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-158821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DA66E281EE1 for ; Thu, 25 Apr 2024 15:40:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E824814C597; Thu, 25 Apr 2024 15:39:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Lu6K1LeB" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 6FC3B374F5 for ; Thu, 25 Apr 2024 15:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714059593; cv=none; b=U3JuWoYl6vpmuREyYMHmX9RmRlJCk45kZW7n6DDupM+TTjm9s5Cq5UkNhW3TpC2CD/1enae4/ICEz4B04wy6iqTwmeWg/reGlZcFJHZIo58y54SgIqISBrc3Jsq+DT9tLNJsPKZUGDBZECYG+uj6dDdby16GIr8X6pVR+iMHpK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714059593; c=relaxed/simple; bh=WF+dlvX2I/JhfKIJrRxXQkXnpq+LBXuSxxxOJYIm9Ew=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jUzOrR/zsP8f+vz6VR27XAVuIVmsGqfVNp/1wV4gDvuCDNiW8Ahqo56hk9dq4XFCYeMRcFkRbx0xkOMpxehc7rcWtJ1pYX32zbWoK/S/RkrMbPkcHexwWlOddoWF+Y+l8Da9ELWbH4lm9pO7MIr/3Mt0M07dTCi8AhBk/5kQsDM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Lu6K1LeB; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-de45dba15feso1385016276.3 for ; Thu, 25 Apr 2024 08:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714059590; x=1714664390; 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=e0BChCss6w1nIzeILAtQLE3LhBpW3YXUB4HhPqTq7zU=; b=Lu6K1LeBSNBNuTVNCNhOq9CVfWCgWKfOOjLOuPvMlbZ4TbQX9Y6s3T3Dfquhqvq1gF mSGKoXEglg6vdgTDr5v9G47Ub46LTi7qUsk9DMx4zz8NmC2nBp58STboK2hpJPK6D8vG o+k4gfJ4LMFLggYdCwnnrRUKnZBBA4vmXiIPPSCwSNsbpdnV+ZvkvC1X8/O9rc+7Ft5w BDqipbhrArlE1vJtRM3CYBzMarSxplWxzeMnYt3vsxsEkfrb0jSHO8Nssq7cY4Ni3EIp ivIsN7Lhc03KWHjEh+harc3wwEVQW9cNDWot+8WGoPk7E/RremVKM910I6z8wswDBghp OxJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714059590; x=1714664390; 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=e0BChCss6w1nIzeILAtQLE3LhBpW3YXUB4HhPqTq7zU=; b=OHkYaPFirJr5mr4bwdyGTRs4arhsOOKwP0T8qiqZyRPW+31L+lEEHKsmK/xlMPpRWW 9MT6Fjj4IPOTm0hcjvjjYAmgToH5WLiJq6BzIWts5xgK4dmSwTTwBpDyYGFN/vlBTypO x04KzYhGBZRdegn0DTBAoIr7KqYeYHVroOcmcHqy/pg63/9RPrFdRyUVd5JLG/3Iz+pT r5gGb/nHlMhVOWlJGBM+2fqb7Lbx39/L4opPI4VPwQIUVP/uIHklqWou1YAH+hxXceUw wsI7612oBh61CpKAFjzS0rpMvPmMMxYprH8PLuPLj12f7+LgM4yPCHYu5KZzUZnlu82G ee+w== X-Forwarded-Encrypted: i=1; AJvYcCVsttpYgOPZEALkt7Lo2ooT9Exa33kjVuQ/l2hqRojjSXBxhlyADCIrrmVw3ygxKB2eP224zN4UTTFnQjxhQikh1SYTWxIZ7qSMe9pB X-Gm-Message-State: AOJu0Yy0kPM4Sa3R8GmVyVkI3Hwu7jZ9Jamplfs0YZbZpzi0kaL31CFx 95NcL5TivTnZSsrGbaJ4/uz31xF4jIcRJQI3y4Yq8OqL+fRNyRtRde2LvVwZbCUJwuw45achM9D upBQSpa/rq1yuPKNjY/9PiONS3KF3KHWnf+dT X-Received: by 2002:a05:6902:54b:b0:de1:849:a6f3 with SMTP id z11-20020a056902054b00b00de10849a6f3mr5525501ybs.7.1714059589879; Thu, 25 Apr 2024 08:39:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240321163705.3067592-1-surenb@google.com> <202404241852.DC4067B7@keescook> <3eyvxqihylh4st6baagn6o6scw3qhcb6lapgli4wsic2fvbyzu@h66mqxcikmcp> In-Reply-To: <3eyvxqihylh4st6baagn6o6scw3qhcb6lapgli4wsic2fvbyzu@h66mqxcikmcp> From: Suren Baghdasaryan Date: Thu, 25 Apr 2024 08:39:37 -0700 Message-ID: Subject: Re: [PATCH v6 00/37] Memory allocation profiling To: Kent Overstreet Cc: Kees Cook , 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, penguin-kernel@i-love.sakura.ne.jp, 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, jhubbard@nvidia.com, 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, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 8:26=E2=80=AFPM Kent Overstreet wrote: > > On Wed, Apr 24, 2024 at 06:59:01PM -0700, Kees Cook wrote: > > On Thu, Mar 21, 2024 at 09:36:22AM -0700, Suren Baghdasaryan wrote: > > > Low overhead [1] per-callsite memory allocation profiling. Not just f= or > > > debug kernels, overhead low enough to be deployed in production. > > > > Okay, I think I'm holding it wrong. With next-20240424 if I set: > > > > CONFIG_CODE_TAGGING=3Dy > > CONFIG_MEM_ALLOC_PROFILING=3Dy > > CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT=3Dy > > > > My test system totally freaks out: > > > > ... > > SLUB: HWalign=3D64, Order=3D0-3, MinObjects=3D0, CPUs=3D4, Nodes=3D1 > > Oops: general protection fault, probably for non-canonical address 0xc3= 88d881e4808550: 0000 [#1] PREEMPT SMP NOPTI > > CPU: 0 PID: 0 Comm: swapper Not tainted 6.9.0-rc5-next-20240424 #1 > > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06= /2015 > > RIP: 0010:__kmalloc_node_noprof+0xcd/0x560 > > > > Which is: > > > > __kmalloc_node_noprof+0xcd/0x560: > > __slab_alloc_node at mm/slub.c:3780 (discriminator 2) > > (inlined by) slab_alloc_node at mm/slub.c:3982 (discriminator 2) > > (inlined by) __do_kmalloc_node at mm/slub.c:4114 (discriminator 2) > > (inlined by) __kmalloc_node_noprof at mm/slub.c:4122 (discriminator 2) > > > > Which is: > > > > tid =3D READ_ONCE(c->tid); > > > > I haven't gotten any further than that; I'm EOD. Anyone seen anything > > like this with this series? > > I certainly haven't. That looks like some real corruption, we're in slub > internal data structures and derefing a garbage address. Check kasan and > all that? Hi Kees, I tested next-20240424 yesterday with defconfig and CONFIG_MEM_ALLOC_PROFILING enabled but didn't see any issue like that. Could you share your config file please? Thanks, Suren.