From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 16CE732AACB for ; Mon, 2 Mar 2026 09:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772445408; cv=none; b=UdZC6Xdno4+Vyp2NdVhra9aLPPO2KjFJgBYzi76fJ4aX/OoCGSkF5uLSt2gRtNPCWftGFhFgfRm8lx08h4wCoH8NBEBEyaGyX+yz4yZ5n2N28Blfr0tSwKE2N40lWwAlMNVgNITA8p2Hzc1LCyf5RR8V++9WbXhSOunI+KMUIJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772445408; c=relaxed/simple; bh=ymifcMsF7YD25E9NmfzPHaiii49VQhEvKOqAxzRSraw=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=sgf08g/uUyvUihmvaTAnuTyKlCPr+hxXMTIvkDu/DMwrdeDk4zf6qc9bS/QEBeklDklrM8cGnpmotNXaCzahdmDCJP6OUQxHzuBckU0NeYvk5T9IsclmnhfR2qDp7jOE/jZ1S56shxOLK7L3z/g6ixakWMQ6/B2bbUMNT7YWc1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QD+qQUgg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QD+qQUgg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34860C19423; Mon, 2 Mar 2026 09:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772445408; bh=ymifcMsF7YD25E9NmfzPHaiii49VQhEvKOqAxzRSraw=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=QD+qQUggdg16qUF+ThiK9SpceGs9NVztqTP4NH3rCuuNPvfJq58NExO1KA9LN0U7R 1leTG5x2NmvdwumDAbUvg3E34UadqLdtGmfiebpMOsR+mS0n4isgk1KeASKkixNJe8 tNpOA+eTCN5kKhCaYGsSL2PzlW1DfD+V67qnsVs6OYA1w4umVWMNAr/nT3YPfsT2Lq OoDRNy+QdLzO67cgPoXplUVqAuKPVqegw6OtDzKKuPkE7NDXZJ2AWSgZqPiu8WffC7 hEijgtuowbB/ShOHcbezze8656WSU1XMMW0N0XBL8oI6oe7bdbO1lKSjbhF2ANOq9p J+MmKdwsdjvbw== Message-ID: <3016b42c-643b-4e65-a6aa-67a91676d3f7@kernel.org> Date: Mon, 2 Mar 2026 10:56:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] slab: distinguish lock and trylock for sheaf_flush_main() Content-Language: en-US From: "Vlastimil Babka (SUSE)" To: Harry Yoo Cc: Hao Li , Marcelo Tosatti , Andrew Morton , Christoph Lameter , David Rientjes , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260211-b4-sheaf-flush-v1-1-4e7f492f0055@suse.cz> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/26/26 15:50, Vlastimil Babka (SUSE) wrote: > On 2/11/26 10:42, Vlastimil Babka wrote: >> sheaf_flush_main() can be called from __pcs_replace_full_main() where >> the trylock can in theory fail, and pcs_flush_all() where it's not >> expected to and it would be actually a problem if it failed and left the >> main sheaf not flushed. > > Thinking about this more, I now think it's not a theoretical issue because > on PREEMPT_RT I think pcs_flush_all() can preempt someone holding the lock > (on PREEMPT_RT it doesn't have to be an irq handler preempting a holder), > and then fail to flush the main sheaf silently. > > The impact is probably limited though - if this failure to flush happens in > __kmem_cache_shutdown(), it means someone was destroying a cache while using > it, so that was already buggy. slab_mem_going_offline_callback() could be > where this matters although it's unlikely someone would do memory hotplug > together with PREEMPT_RT. > > But maybe still worth tagging this as Fixes: 2d517aa09bbc ("slab: add opt-in > caching layer of percpu sheaves") and Cc stable and sending it as a hotfix. Added to slab/for-next-fixes with adjusted changelog: https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git/commit/?h=slab/for-next-fixes&id=48647d3f9a644d1e81af6558102d43cdb260597b