From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 E0B2686341 for ; Wed, 4 Feb 2026 04:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770177656; cv=none; b=pQhFPp22MQEBBUv7rv8vWNl6qf9lTPDA7JM5Egmej5ro6ncRsDsWJ9ucV7gnNlYBa9e17br4IhmgqY29woLsIzyuMrRlyqhSz6UuhVGC0eJmQ1VJ/ZhyYiP9uSBUdzSm/asDGAM9Nuvv264kBRHKV7NjfhAtCRy7YVK2fZTpYpY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770177656; c=relaxed/simple; bh=NxQndONrlkQiarlPwBkTwHo7wH1xrM/y1VeFxMK7N0k=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=JIoyXUEzvRsrP3xtm5WnkzNiVwuq03BJAokXtH7hNy3BmykAfcizxyFqc1ddTpud23MmkUj30GjdA2LAN+rtt1Sw3jBmRSyNU5nYSbw+2vFDaK5sXB7kefSt8YsNeD38x8ui3d//XTL9VCG0tpQEKQELUzqU9Zkce8mzUGPytcM= 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=LzgIfLHJ; arc=none smtp.client-ip=91.218.175.185 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="LzgIfLHJ" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770177652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NxQndONrlkQiarlPwBkTwHo7wH1xrM/y1VeFxMK7N0k=; b=LzgIfLHJS9Qoe9l1zGg2dKXdf9ziPdD0leE/cmSIJAzTsoD4ZmhIIhtkJ0kw5cDCAqlMbs U10pXtOBbD8a0reVaH5KCRNAHTpZh6SBoiiQswRMzI0XpT3CImnjbwABk8lhZgseFBxEd5 vajh8uIluYBEf8weBch/Dg7OXTjZC8I= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.300.41.1.7\)) Subject: Re: [PATCH v2] mm/shrinker: Fix refcount leak in shrink_slab_memcg() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20260204033553.50039-1-ahacigu.linux@gmail.com> Date: Wed, 4 Feb 2026 12:00:15 +0800 Cc: akpm@linux-foundation.org, david@fromorbit.com, zhengqi.arch@bytedance.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <4FEDFC64-4EE4-4FC5-98DB-FAF9182FDFAB@linux.dev> References: <20260203073757.135088-1-ahacigu.linux@gmail.com> <20260204033553.50039-1-ahacigu.linux@gmail.com> To: Altan Hacigumus X-Migadu-Flow: FLOW_OUT > On Feb 4, 2026, at 11:35, Altan Hacigumus = wrote: >=20 > When kmem is disabled for memcg, slab-backed shrinkers are skipped. > However, shrink_slab_memcg() doesn't drop the reference acquired via > shrinker_try_get() before continuing. >=20 > Add the missing shrinker_put(). >=20 > Also, since memcg_kmem_online() and shrinker flags cannot change > dynamically, remove the shrinker from the bitmap to avoid unnecessary > future scans. >=20 > Fixes: 50d09da8e119 ("mm: shrinker: make memcg slab shrink lockless") > Suggested-by: Qi Zheng > Acked-by: Qi Zheng > Link: = https://lore.kernel.org/r/20260203073757.135088-1-ahacigu.linux@gmail.com > Signed-off-by: Altan Hacigumus Reviewed-by: Muchun Song