From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 257EF25F981 for ; Thu, 6 Aug 2026 12:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786020420; cv=none; b=NsaNPl5+8JURWyYrn3baj4J7y6Z7JumI56T2YA0Lvv4hklF+dwc25BW5cCi0jjZzuUj2eRVOhHRQmGcAcdDDmJWvSAUycO1ErD5AT8E6YI/m7Wr0Q71LfGJ84iUUidTB2Uxyt9RY8K3TpcmFRNJYso5vOx3mtlN/9qNVCAY2LH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786020420; c=relaxed/simple; bh=ZhMfhfiD+p1cAovuuaQEhL54D067mJABtx8sYNrBQ+s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EuWq+xn6IAR+y+9k+omXJ8crjsiooRGbZZFUIQh9OPi3GVBbWtrh0TwKBmbPwKWo4qtgVwu6yTPE1Qb3Tmz1LamRU3JH0lLEvE/RNI/szD1MNJ06UYF6zRt0GbDXE0k2f4eam0XNmWgtG57NS6j7eOvls4i8KzrD72pi/zbo6oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Rx15opfQ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ij5WXpgQ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=bYbp36UW; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=jRs2wpRp; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Rx15opfQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ij5WXpgQ"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bYbp36UW"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="jRs2wpRp" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0E4983E05; Thu, 6 Aug 2026 12:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1786020413; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ndsVTs8Vb4+eWTvpoW1bxOyGOZV5iCDP4dM9epJVIgo=; b=Rx15opfQXS5I3BI39vYnXEpPK/6+OPHkvqqji4tLlzKku/Xc6VW1gR3VU7lJyBZ9UCeTNp O1OLt4KJuPtI9h4nkUAIXto4iIz3JE3/D3v9brY3vNTdU+ysTWk0Bz72JiMBX/rNhuG6LD rja9LRVJst/3YwYzzLbRs5QQbddnOEo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1786020413; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ndsVTs8Vb4+eWTvpoW1bxOyGOZV5iCDP4dM9epJVIgo=; b=ij5WXpgQwjwrIfHUCG6fP9eCVZIcTGBRs92l4E4ZBQVxNZ2zPeiM9Vh3cfBeHjx0dF8qrn EJ2MYvLH7AURu0Bg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1786020409; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ndsVTs8Vb4+eWTvpoW1bxOyGOZV5iCDP4dM9epJVIgo=; b=bYbp36UWOtJUk0fZmU0sGrRv9Bu4Tnr8ByfdLzmQh2naGO+RpNe+tDStvLM9gLurgmg0X+ VhHOE5UGWpSZRGgktzb03YrTHRM5Dm0JPVkZdS+4M0sTrj7l5DK/u/XxGXvgeGF37/08VV W4XVv8Dn7AyGtJSYnk16XdW0oLyBt6I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1786020409; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ndsVTs8Vb4+eWTvpoW1bxOyGOZV5iCDP4dM9epJVIgo=; b=jRs2wpRpRyVO8JwTQsP0w9mj/IQ9sgFTK1BHSozyRZ/gGqCawjxNpxEQ2GQs0LqXASM8eG NWq7q07Ab8dB7rDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EF646779B6; Thu, 6 Aug 2026 12:46:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id FV/AODiCdGqzcQAAD6G6ig (envelope-from ); Thu, 06 Aug 2026 12:46:48 +0000 Date: Thu, 6 Aug 2026 14:46:44 +0200 From: Daniel Wagner To: Keith Busch , Christoph Hellwig , Sagi Grimberg Cc: Chris Leech , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Dmitry Bogdanov Subject: Re: [PATCH] nvme-tcp: fix usage of page_frag_cache Message-ID: <7d7f4d21-eb8a-46ad-a903-873f2d90b4a5@flourine.local> References: <20260716-nvme-tcp-page_fraq_cache-v1-1-ea660828cf93@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260716-nvme-tcp-page_fraq_cache-v1-1-ea660828cf93@kernel.org> X-Spam-Score: -4.30 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] On Thu, Jul 16, 2026 at 04:42:19PM +0200, Daniel Wagner wrote: > From: Dmitry Bogdanov > > nvme uses page_frag_cache to preallocate PDU for each preallocated request > of block device. Block devices are created in parallel threads, > consequently page_frag_cache is used in not thread-safe manner. > That leads to incorrect refcounting of backstore pages and premature free. > > That can be catched by !sendpage_ok inside network stack: > > WARNING: CPU: 7 PID: 467 at ../net/core/skbuff.c:6931 skb_splice_from_iter+0xfa/0x310. > tcp_sendmsg_locked+0x782/0xce0 > tcp_sendmsg+0x27/0x40 > sock_sendmsg+0x8b/0xa0 > nvme_tcp_try_send_cmd_pdu+0x149/0x2a0 > Then random panic may occur. > > Fix that by serializing the usage of page_frag_cache. > > Fixes: 4e893ca81170 ("nvme_core: scan namespaces asynchronously") > Signed-off-by: Dmitry Bogdanov > Signed-off-by: Daniel Wagner > --- > If the target exposes many namespaces (>1000) and the host has many CPUs (>80), > it is trivial to trigger the allocation race condition in nvme_tcp_init_request > which results in the logs below: Any chance to move forward with this on?