From nobody Sat Feb 7 21:53:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 840972D0AA2 for ; Wed, 30 Apr 2025 21:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046811; cv=none; b=SK6lMQHwEOwHnOd4N2EqJi67RvDSvzq/f05/Cr6a4BrQPHmlhmi+A6GhqChgRLoxYeHoW86B2nfg2tw6VRibdLiV26igReD3740ZyppTG/fxUmz4U4vioMvQzM41h/LBnbKYWqojh0ElFzT3UPlmOxVjtyJVJ5R9nnnEio9ZvRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046811; c=relaxed/simple; bh=xbayRUeDWjFnfHRNtE0mkOGITr3qyYQrs8XBjJE179E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UUitWg2WN53bjSaaoYB4vIRyYO+hrw5ypOsLmI8ssz4OdpkriHmDT4AIyhdT6k28lKJ6DnUDB7V5jsxGpQyQAZgr8fit7VJIYLE3Ha1mVvlwIMDy9HeOmOAQY0COCM9Pm1zs9HO9YJE7FnDe/hf/eIhJXaJFIc/wmj8QrUEhIpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QrDi6DdX; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QrDi6DdX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746046808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=85HS0oNtK3lcYayxAem2fVW6gu+Q3E9O800xuhezz9M=; b=QrDi6DdXMiD4lMvyVdodowqR0QshLcuam652QsIbvIbUZeshMAGptQkGXXW88u6vsTAdS9 Ztna4WjKT2p3spEKQOYgIT68wF8V6l4EWZMA2g1+vk6KQOBGOSdKcJV529fFIKhpDvrGk1 VowdoU6yUuU/ylO1BeG8Y5zMeh4a3Jk= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-lBdygPvyMqqNq255Awq5VA-1; Wed, 30 Apr 2025 17:00:02 -0400 X-MC-Unique: lBdygPvyMqqNq255Awq5VA-1 X-Mimecast-MFC-AGG-ID: lBdygPvyMqqNq255Awq5VA_1746046801 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 46BED1800368; Wed, 30 Apr 2025 21:00:01 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.112]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 45BF71800365; Wed, 30 Apr 2025 21:00:00 +0000 (UTC) From: Luiz Capitulino To: catalin.marinas@arm.com Cc: lcapitulino@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@redhat.com Subject: [PATCH 1/3] mm: kmemleak: drop kmemleak_warning variable Date: Wed, 30 Apr 2025 16:59:45 -0400 Message-ID: <97e23faa7b67099027a1094c9438da5f72e037af.1746046744.git.luizcap@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" The kmemleak_warning variable is not used since commit c5665868183f ("mm: kmemleak: use the memory pool for early allocations"), drop it. Signed-off-by: Luiz Capitulino Acked-by: David Hildenbrand Reviewed-by: Catalin Marinas --- mm/kmemleak.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c12cef3eeb32..e6df94c7b032 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -215,8 +215,6 @@ static int kmemleak_enabled =3D 1; static int kmemleak_free_enabled =3D 1; /* set in the late_initcall if there were no errors */ static int kmemleak_late_initialized; -/* set if a kmemleak warning was issued */ -static int kmemleak_warning; /* set if a fatal kmemleak error has occurred */ static int kmemleak_error; =20 @@ -254,7 +252,6 @@ static void kmemleak_disable(void); #define kmemleak_warn(x...) do { \ pr_warn(x); \ dump_stack(); \ - kmemleak_warning =3D 1; \ } while (0) =20 /* --=20 2.49.0 From nobody Sat Feb 7 21:53:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 8F3712D0AA8 for ; Wed, 30 Apr 2025 21:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046812; cv=none; b=UirOwKP+bl+/lbxI8YR5qOXNpgjBz2EmOqEkRERZg5+YgzMCQCZlzeLwVlt8FdR+rYE/CioVYYm8jE/T4fU8ZaWtUX1tFSWCrBtGyJaYDIpWwYiGYIV+cqcdPinoTISSRoWDBUNj3sFhNtpml6hJsteKLwFyQbO7MmH0tYg3Gjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046812; c=relaxed/simple; bh=1s5hFYd9NJcHRFKFOLnX07jmJHivkMWxQBmG7+r2fjA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JZMKEshbMs592E+axbG4MjNNE9YIIgLFzkTwrQRRbNp30WobIaHfLeyFTAsgN1gn+lxvwTNzLDlW6KTl09iU6I3ZI5U0GuzhP+mful868cWOLUgaJywR2jbIBanc9MxqrMKf+7xvNpKlDQjZPVe+f8iB3I7P+A05ZOZAOav5caA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=amomH7+K; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="amomH7+K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746046809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yLD7imfhXpRn6Ox9C3QK9gjBGTUmE2sAhURJOhLj7IM=; b=amomH7+KrBqkEmEZ/yCwNej2auvxmB4NdioV4cFx5bc1CYidvW89lsTsjotvcfZJQii8Vo yaWzEmxtFg+hxW6OjcQxOo8/mO4xsPIQ1rv6o8V/usVI/Ksg3MeABlrKf1ztj4v5jewsFA Cb2b+7H7ErIuPi9SDcMzLkMztWTFW9k= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-YQBImMU4NueJFZZXtG_fcQ-1; Wed, 30 Apr 2025 17:00:04 -0400 X-MC-Unique: YQBImMU4NueJFZZXtG_fcQ-1 X-Mimecast-MFC-AGG-ID: YQBImMU4NueJFZZXtG_fcQ_1746046803 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BC4551800983; Wed, 30 Apr 2025 21:00:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.112]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7E4EA1800365; Wed, 30 Apr 2025 21:00:01 +0000 (UTC) From: Luiz Capitulino To: catalin.marinas@arm.com Cc: lcapitulino@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@redhat.com Subject: [PATCH 2/3] mm: kmemleak: drop wrong comment Date: Wed, 30 Apr 2025 16:59:46 -0400 Message-ID: <3dfd09bc0e77bb626619184a808774ff07de275c.1746046744.git.luizcap@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Newly created objects have object->count =3D=3D 0, so the comment is incorrect. Just drop it. Signed-off-by: Luiz Capitulino Acked-by: David Hildenbrand Reviewed-by: Catalin Marinas --- mm/kmemleak.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index e6df94c7b032..06baa3475252 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -322,8 +322,6 @@ static void hex_dump_object(struct seq_file *seq, * sufficient references to it (count >=3D min_count) * - black - ignore, it doesn't contain references (e.g. text section) * (min_count =3D=3D -1). No function defined for this color. - * Newly created objects don't have any color assigned (object->count =3D= =3D -1) - * before the next memory scan when they become white. */ static bool color_white(const struct kmemleak_object *object) { --=20 2.49.0 From nobody Sat Feb 7 21:53:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 B4C6F2D0AC7 for ; Wed, 30 Apr 2025 21:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046813; cv=none; b=CVfsg4rgCiHx8di65RK45CQ2FPMAau+xjh5pvj0pc91Y4+ZYmlRiDQjFtdLmmXm7PlmKGYgwtGXqZQSZMpWmbpNy5L2N1hPGy4TFK/edDIFm1ngt7k1UAKnrVAMWPHYaAYq12HWuwyOKNOa5ueU7Y1JyEvg4JZpL7dj2OzIhr0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746046813; c=relaxed/simple; bh=uk2xviyq+Ect0iFU3c5Sru9bdCE3/joS1xAdgG559AI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZuUjJC7lktZRA7LhKWpxx5jnSXJ3cRBN3ecBY8iUHIZ6Nn5S89zhbjGuHA6iGqOgTrB3MyEzOv8hU1gRxwye0z38GpEoBuETo/tS+c6SZvDGOTegO2pt6es66gt+3Q3Mbav02B4Q4S/AmFwSia4GzQEanT5iDi6bsDuaqVWhHAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TixXlsv0; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TixXlsv0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746046810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0eS5EzPLPDf4NOmbcZOp9LkboVWEGMgOO+wOKHpyiNY=; b=TixXlsv0keFJSD04rDmecLG55KydcMnqXPr7k6brtP+TS9qBv/XgQNBdGLWvqEeM+WzU+G 0bDH+0kH/8ioOinwmpcCdoY/5KthXp0XOAnExTF1qDO04r0II7DjPcVgz0cZiGyGMSRRpB t0YeEAxnq1Ke5vP53/diHAGEZ2CFrfI= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-GaM4EZG4PoiVhFdgGwTi9g-1; Wed, 30 Apr 2025 17:00:05 -0400 X-MC-Unique: GaM4EZG4PoiVhFdgGwTi9g-1 X-Mimecast-MFC-AGG-ID: GaM4EZG4PoiVhFdgGwTi9g_1746046804 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8218B1801A1F; Wed, 30 Apr 2025 21:00:04 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.112]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1AFF91800365; Wed, 30 Apr 2025 21:00:02 +0000 (UTC) From: Luiz Capitulino To: catalin.marinas@arm.com Cc: lcapitulino@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@redhat.com Subject: [PATCH 3/3] mm: kmemleak: mark variables as __read_mostly Date: Wed, 30 Apr 2025 16:59:47 -0400 Message-ID: <4016090e857e8c4c2ade4b20df312f7f38325c15.1746046744.git.luizcap@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" The variables kmemleak_enabled and kmemleak_free_enabled are read in the kmemleak alloc and free path respectively, but are only written to if/when kmemleak is disabled. Signed-off-by: Luiz Capitulino Acked-by: David Hildenbrand Reviewed-by: Catalin Marinas --- mm/kmemleak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 06baa3475252..da9cee34ee1b 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -210,9 +210,9 @@ static struct kmem_cache *object_cache; static struct kmem_cache *scan_area_cache; =20 /* set if tracing memory operations is enabled */ -static int kmemleak_enabled =3D 1; +static int kmemleak_enabled __read_mostly =3D 1; /* same as above but only for the kmemleak_free() callback */ -static int kmemleak_free_enabled =3D 1; +static int kmemleak_free_enabled __read_mostly =3D 1; /* set in the late_initcall if there were no errors */ static int kmemleak_late_initialized; /* set if a fatal kmemleak error has occurred */ --=20 2.49.0