From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-65.mta1.migadu.com [95.215.58.65]) (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 870F414EC73 for ; Mon, 17 Aug 2026 06:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786947931; cv=none; b=oVQNQM9F1yikON/xrRtNmyGIUF3I/KJM/0dCuCzGdtHdukatDvCqc6jau91VDQHWf96tKY6cMEo/UZlrIvGP2wt3Bd8/KNy9TWHIrDPMOpffuvTfYXAiftzCIqWqVOHIE4HjGsjKYwhuJCV+nsGhDNI6iet0UiyOE2r0/shOtmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786947931; c=relaxed/simple; bh=cp1D9oBcDI7MYultp2oPrdx51BLqcKdTzDrSb3vQWvc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=tRd06mL007f248lggzZv0OhFBBsVx3InOZCOI+oaPjJU8MGdVd5dJRJ2TVvMI5Ug9T2v/diO8QYM0fCHEC79wKvCAWl4AsFjhW3amHJcEDIBC8X/zrDcbeYo8Lp/cBDURRcFtfFOPvX0xMTWyMNZM7plzDSB3bCHRF+Ujnf74Mc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YoX+JG98; arc=none smtp.client-ip=95.215.58.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YoX+JG98" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=cp1D9oBcDI7MYultp2oPrdx51BLqcKdTzDrSb3vQWvc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1786947928; v=1; x=1787552728; b=YoX+JG98liK4t9Ofiu8G839BsnNNR4l5NHUYJ9Y80GcE6MUVXTaL9Aq3pxKr9Hnn2kM6rVXr L+rhADpPT4fLMk1WGUJIUoCYkWgGJZtWJsR02xM5GG6g8OLGbRq3KAilIrokOgrz2jeABiHDfBc WNfEhzsDo+wF0ZDqyvLwHZDo= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost.localdomain (116.128.244.169) by smtp.migadu.com with ESMTPS id 50b8b077964e6df9; Mon, 17 Aug 2026 06:25:28 +0000 X-Migadu-Flow: FLOW_OUT From: Hao Ge To: Suren Baghdasaryan , Kent Overstreet , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 0/2] alloc_tag: fix a leak and a deadlock around shutdown_mem_profiling() Date: Mon, 17 Aug 2026 14:26:01 +0800 Message-Id: <20260817062603.106196-1-hao.ge@linux.dev> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Two fixes for issues reported by sashiko: 1. percpu counter leak on modules loaded after profiling is disabled. 2. AB-BA deadlock between module load and /proc/allocinfo readers. Changes since the RFC [2]: - The "move codetag section placement decision to layout_sections()" patch is dropped from this series. Its retry path depends on [1], so it will be sent as part of that patchset instead. - Patch 1 now returns -EOPNOTSUPP instead of introducing CODETAG_MODULE_LOAD/CODETAG_MODULE_EXCLUDED defines (suggested by Suren). - Reported-by tags added. Patch 1 skips percpu counter allocation when profiling is disabled, so the module loads without its tags instead of leaking counters. Patch 2 defers remove_proc_entry() to a workqueue. [1]: https://lore.kernel.org/all/20260812054105.102637-3-hao.ge@linux.dev/ [2]: https://lore.kernel.org/all/20260813093421.135230-1-hao.ge@linux.dev/ Hao Ge (2): alloc_tag: skip percpu counter allocation when profiling is disabled alloc_tag: remove /proc/allocinfo outside of mod_lock lib/codetag.c | 10 ++++++++-- mm/alloc_tag.c | 14 ++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) -- 2.25.1