From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51A0CC282EC for ; Tue, 11 Mar 2025 15:46:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 678D8280003; Tue, 11 Mar 2025 11:46:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 627F7280001; Tue, 11 Mar 2025 11:46:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CA42280003; Tue, 11 Mar 2025 11:46:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2E0B1280001 for ; Tue, 11 Mar 2025 11:46:50 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9E558A4C9C for ; Tue, 11 Mar 2025 15:46:50 +0000 (UTC) X-FDA: 83209698180.08.9A95198 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf14.hostedemail.com (Postfix) with ESMTP id EC102100004 for ; Tue, 11 Mar 2025 15:46:47 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KoOUzBlM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fjOPsmIx; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KoOUzBlM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fjOPsmIx; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf14.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741708008; h=from:from:sender: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:dkim-signature; bh=p3oherzCMUXjtYIF1ejjUtJkcZvyvW/dxDTzBhXyNRQ=; b=7RAbi9f4Bb0k2N2IySuzlBc0kOriD4UBL7qjgDoYBwV5gmZsL18VzOpnhExiTuwU6jsvwv 2XvQGSf55ErjuwJr8hA0i3gWBJJzmgb6+yEG8J4e4RaT3GPWWgk1cJzHIJav+M0P9MHrN8 svfJOpwdlkvqNvVl5oi5enAxVfXEtuU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741708008; a=rsa-sha256; cv=none; b=5JgSOsmVJ0cI8tM71vEUGQEFDPzbBGNLp3Txc34Kc/06qHZ4Ier6Emnr9aefwKHUbA7COT d8ROWRBR3eM34wYbRBoSlt4iNHdPB3uq0dwlBV3WrIJy2Cyryad8jGxG/8jc9vSpdm1fmy JJ0bZDmeFEd36eetd3iMUQ/unQn3Wvc= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KoOUzBlM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fjOPsmIx; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KoOUzBlM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fjOPsmIx; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf14.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id 29B39210F4; Tue, 11 Mar 2025 15:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1741708006; h=from:from:reply-to: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=p3oherzCMUXjtYIF1ejjUtJkcZvyvW/dxDTzBhXyNRQ=; b=KoOUzBlMemMLreYbo46bxIO96b32y+jV55OjpF3JGKg6XBo4TTcle/UhCUx/P+d5Q8KLt0 bqS+d/3EIwjTFQZiieuqp5t1ANE7o0DXw5gS2kwUh9nAK3ifTPQ3+A40uI8gg9lPOnAZnE kenh69Zfx+Jhi5Pkb3ZrevD3q93KqKo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1741708006; h=from:from:reply-to: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=p3oherzCMUXjtYIF1ejjUtJkcZvyvW/dxDTzBhXyNRQ=; b=fjOPsmIxa2oKzV/8IOob/bR1RN4azFo89M9K5mUHusbUxsNueDNrelb4XFI3/muKWbbNzI /eNJIrXZY7bPLEDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1741708006; h=from:from:reply-to: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=p3oherzCMUXjtYIF1ejjUtJkcZvyvW/dxDTzBhXyNRQ=; b=KoOUzBlMemMLreYbo46bxIO96b32y+jV55OjpF3JGKg6XBo4TTcle/UhCUx/P+d5Q8KLt0 bqS+d/3EIwjTFQZiieuqp5t1ANE7o0DXw5gS2kwUh9nAK3ifTPQ3+A40uI8gg9lPOnAZnE kenh69Zfx+Jhi5Pkb3ZrevD3q93KqKo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1741708006; h=from:from:reply-to: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=p3oherzCMUXjtYIF1ejjUtJkcZvyvW/dxDTzBhXyNRQ=; b=fjOPsmIxa2oKzV/8IOob/bR1RN4azFo89M9K5mUHusbUxsNueDNrelb4XFI3/muKWbbNzI /eNJIrXZY7bPLEDw== 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 EB3A9134A0; Tue, 11 Mar 2025 15:46:45 +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 IbFwOOVa0GficgAAD6G6ig (envelope-from ); Tue, 11 Mar 2025 15:46:45 +0000 Message-ID: <4fc21641-e258-474b-9409-4949fe2fda2d@suse.de> Date: Tue, 11 Mar 2025 16:46:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: Decline to manipulate the refcount on a slab page To: Jakub Kicinski , "Matthew Wilcox (Oracle)" Cc: Andrew Morton , netdev@vger.kernel.org, Vlastimil Babka , linux-mm@kvack.org References: <20250310143544.1216127-1-willy@infradead.org> <20250311111511.2531b260@kernel.org> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20250311111511.2531b260@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Stat-Signature: gy4kahr49erkrc9de7wkods3wstjscei X-Rspam-User: X-Rspamd-Queue-Id: EC102100004 X-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C4S19opoJhvpePatHpw6ikDGfZkopoBpjw1tg5rPLTIjMuTB8RkYYNE46vVPnCalmG35LWMpoDd3+iNI1nqRohmFjn7YHI8Q8b3HT6n3yx3uh7dh1E+z3yqOxkdgmi2tgJMom5T2HW+bPf74mLvcjFBzZ8GDK+j2c17kSwJiRnDhXYEjZUm2euzEysWjpaf0Oqytbl0VGgfDj8vZFiGViMAO8gxE9Gl14rRdqrDB+P/ly3kf9O0seukrfjyK9ZqJrsO6ylas3rbXpMsOojjHDdB47B0dCogYXZ0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 3/11/25 11:15, Jakub Kicinski wrote: > On Mon, 10 Mar 2025 14:35:24 +0000 Matthew Wilcox (Oracle) wrote: >> Long-term, networking needs to stop taking a refcount on the pages that >> it uses and rely on the caller to hold whatever references are necessary >> to make the memory stable. > > TBH I'm not clear on who is going to fix this. > IIRC we already told NVMe people that sending slab memory over sendpage > is not well supported. Plus the bug is in BPF integration, judging by > the stack traces (skmsg is a BPF thing). Joy. Hmm. Did you? Seem to have missed it. We make sure to not do it via the 'sendpage_ok()' call; but other than that it's not much we can do. And BPF is probably not the culprit; issue here is that we have a kvec, package it into a bio (where it gets converted into a bvec), and then call an iov iterator in tls_sw to get to the pages. But at that stage we only see the bvec iterator, and the information that it was an kvec to start with has been lost. All wouldn't be so bad if we wouldn't call get_page/put_page (the caller holds the reference, after all), but iov iterators and the skmsg code insists upon. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich