From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-81.mta1.migadu.com [95.215.58.81]) (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 1A5BF14EC73 for ; Mon, 17 Aug 2026 06:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786948012; cv=none; b=sdF7FDU5aSDP5HZJM4r4S74Llg+zmvE9Cyn462im7G1FC22gAjTIUjXbRudY2/5SE4AyyAVo4tY5fYnPMkw/sHze4JmmpsJJtSFYVzGCzhFJ7ZwwNvW6SPkqiZdJEXxJ8ueJp2SLVc3CvhxfDO/7+CigxA5qMg6pIpDpetkweIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786948012; c=relaxed/simple; bh=cp1D9oBcDI7MYultp2oPrdx51BLqcKdTzDrSb3vQWvc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kznOjFp5hG/qPlXt4WbXpV9dknvEwEtTnCjZL0id4dZBAupv/OBuKwg4iezNK9cvwuKcl1FN3QQOdVBvW99RbIyt9VFEfM+/GPtKVextPN0fQGJJZabtuY/1ggNm5ftiTVnYO+++nMohhwmRyYwBwwfvaWlhLl5yuSoDnRSLDxY= 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=LqdowEqv; arc=none smtp.client-ip=95.215.58.81 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="LqdowEqv" 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=1786948008; v=1; x=1787552808; b=LqdowEqvk3kL1t3sJQuK9rAEPmY6H0EkyU9fVoxPTNAldQHvHShFulplwPdL/RI6xp6cjgeT d3zvllnCBZa3vFTSRPHfETNeE/QwBB4SK4/JLonUAieNB/rOi4RW95Sj0iEUO/mjp8iTogkxgWS 61JeRlzX3ldVZjNb4rMx1L4E= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost.localdomain (116.128.244.169) by smtp.migadu.com with ESMTPS id fdcc2f1a69ec06f3; Mon, 17 Aug 2026 06:26:48 +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:27:24 +0800 Message-Id: <20260817062726.106511-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