From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-110.mta0.migadu.com [91.218.175.110]) (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 9F0D114EC73 for ; Mon, 17 Aug 2026 06:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786947987; cv=none; b=G7bi7n2vbUSTpiOVKb2BktU8ebFFyQQaogf+KHomm6NjhqlHgYhUzmemTqsEEO9eSePkfwSShUWwl6PazkCnSeB1kpFr9JbMrcTk6c43ZabXSVreJyM/ctxYI7mI8VYVk9Ul87W1J32LQNPM72TX17y/SGsjAyylKYugd+WXG7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786947987; c=relaxed/simple; bh=cp1D9oBcDI7MYultp2oPrdx51BLqcKdTzDrSb3vQWvc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UWKHW3uGrEX1IE8eLmBj2+1FgjorcxXML96atzAGN8CUaC4K8E63lUY0CD42Xjzqq+P3vEqwfuiFtJWxnW2g4jH5moYhD5VPJvW6W7r4zB7K6ihwb5pV02zdBnGQXGvhpwSesdSjdMpKqA86Ur5el7G6DyaRZvAbhj7XxoG6nps= 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=XwBc449t; arc=none smtp.client-ip=91.218.175.110 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="XwBc449t" 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=1786947983; v=1; x=1787552783; b=XwBc449tpRkKp/LyfvHGsJXBG3TcE6YhyzhwknRPia1PHwPNqzV4eUQH7OAGzxQyQSPZ1uw8 PXL3U67bIaGY1wEobzacnkqfXyjOy0TvGaC9ofwuOmGt8bFm4+NEQ8R0ueG1l0ViJTp42zHZsoC 8+EskMo+yjxeNDZqslmP2YFw= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost.localdomain (116.128.244.169) by smtp.migadu.com with ESMTPS id ccceb9cb2e5afc2e; Mon, 17 Aug 2026 06:26:23 +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:00 +0800 Message-Id: <20260817062702.106408-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