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 12206C282DE for ; Thu, 13 Mar 2025 08:52:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0D17280002; Thu, 13 Mar 2025 04:52:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBBF2280001; Thu, 13 Mar 2025 04:52:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3738280002; Thu, 13 Mar 2025 04:52:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 94CCE280001 for ; Thu, 13 Mar 2025 04:52:23 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AD129121C83 for ; Thu, 13 Mar 2025 08:52:23 +0000 (UTC) X-FDA: 83215911366.30.875775A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf17.hostedemail.com (Postfix) with ESMTP id 587FF40007 for ; Thu, 13 Mar 2025 08:52:21 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vDwo1wH5; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=sIxVTYRF; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vDwo1wH5; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=sIxVTYRF; spf=pass (imf17.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741855941; 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=Zy5BLDWhW5tuLfn5o9uPMUppzn8JjYggSaYxs0/2H10=; b=pQcazfbM8q6ZhDJWkspck6fCJPHnFe62c+xmdwNGlkCHob7GXgwReWaVqgkoAzWMsScOnH HX8XsyaOPfvmPGdbTUOSGQNIigzWRP5xtiJaE8D4CzSFj14LhMqA3GaHpK9IvTsKOpl13G gKm6aQrUxaK/OEijzxiqPZHbOC327gw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vDwo1wH5; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=sIxVTYRF; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vDwo1wH5; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=sIxVTYRF; spf=pass (imf17.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741855941; a=rsa-sha256; cv=none; b=alc+S+Sepk1WN8qDb+y8Of4N/3QZhBIs9oqhQYPfX0g/LEL4TGC9fiDND13uLX2kgaljMR Z5UP9N/iMQQNXCEjhXfkeQ6h44/Gubi5xMI6ZIZCjUQqAifGonHqmfgiWjfiWTdSTzrAMf +v10jpvKYn7cuWHnLcAA5CA5gW2YH0c= 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-out1.suse.de (Postfix) with ESMTPS id BCF4221192; Thu, 13 Mar 2025 08:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1741855939; 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=Zy5BLDWhW5tuLfn5o9uPMUppzn8JjYggSaYxs0/2H10=; b=vDwo1wH5sNx2LEe91tHBU7tx3tj7gx4jeCwXWal7Ga+SOqtw1Ph92bYT9m1n1J8GBL7dVw Q2IEvfCensqEtxU1PZ0mg/JHLQ9IYpSbDgICzPzlXx1SIhjjsn/Mz92PbCy8mv5crAgOBW 5aoGDwTAPRiY2zmLhJW9IU+uWO0b4DY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1741855939; 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=Zy5BLDWhW5tuLfn5o9uPMUppzn8JjYggSaYxs0/2H10=; b=sIxVTYRFgVIu7DkLYzXwvPJaVdCyD5Z98Q87Q1E4AomzIXpZD+xiDNaUMl9QjNuylqv9NM 1sg/DCaWRFoGz7CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1741855939; 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=Zy5BLDWhW5tuLfn5o9uPMUppzn8JjYggSaYxs0/2H10=; b=vDwo1wH5sNx2LEe91tHBU7tx3tj7gx4jeCwXWal7Ga+SOqtw1Ph92bYT9m1n1J8GBL7dVw Q2IEvfCensqEtxU1PZ0mg/JHLQ9IYpSbDgICzPzlXx1SIhjjsn/Mz92PbCy8mv5crAgOBW 5aoGDwTAPRiY2zmLhJW9IU+uWO0b4DY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1741855939; 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=Zy5BLDWhW5tuLfn5o9uPMUppzn8JjYggSaYxs0/2H10=; b=sIxVTYRFgVIu7DkLYzXwvPJaVdCyD5Z98Q87Q1E4AomzIXpZD+xiDNaUMl9QjNuylqv9NM 1sg/DCaWRFoGz7CQ== 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 6B9FC13797; Thu, 13 Mar 2025 08:52:19 +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 44qlF8Oc0mdlLQAAD6G6ig (envelope-from ); Thu, 13 Mar 2025 08:52:19 +0000 Message-ID: <5075cd03-0a4a-46d3-abac-3eda27b9ddcc@suse.de> Date: Thu, 13 Mar 2025 09:52:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: Decline to manipulate the refcount on a slab page To: Christoph Hellwig Cc: Matthew Wilcox , Jakub Kicinski , Andrew Morton , netdev@vger.kernel.org, Vlastimil Babka , linux-mm@kvack.org References: <20250310143544.1216127-1-willy@infradead.org> <20250311111511.2531b260@kernel.org> <4fc21641-e258-474b-9409-4949fe2fda2d@suse.de> <9af6dff3-adce-40f8-8649-282212acad9e@suse.de> <17f4795a-f6c8-4e6c-ba31-c65eab18efd1@suse.de> Content-Language: en-US From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: kh1b1c79cetixo5kmwac13t7eqnyzeoq X-Rspamd-Queue-Id: 587FF40007 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1741855941-167040 X-HE-Meta: U2FsdGVkX1+IGxASuPslUd1Dpd/tHYhDKU2FdrA6L8liT9wk88S5/J2QPmO/eYEorww+f/Vp4L6eYpno2yT5MT1v9mgiXmjtocQEiTdvMOfbPSvQjVjeJqn5NhRUQf+z2D0nrDeafiG4i+cu9VHTjqORThNNoWdO7Ps53rYcCdNG9yepsc64Ggi5rFFvic4lTuY0jayP3B+M7emOQbKtfTenw7Mss3Q4NB/YBOrloHfQS8PkQAsBQ9EIGlUeAm3/muW5TxKmpY3B77ETchusZjn62o5wgpt0cEkpWSSfYTUQ4XDTUpSkFwekTwUwj+DfUoaaU/BSWcnLqBBjY/2UiUDFkFOrn9oPwn0A+T/8BXDvxlyQr4I+YQV9N7BYBtA89qGgYBWTADFxwxy476eEBGkxZ0ldQc3m1KqMMHOnbCnuGKc0/kGOEh05JB1+c56/TM7wJKZVYPt53j4sm/fbEZientMHXUfyg6SS3JVUslIE70btA1JE0cLUP7u/Dq7T7kuSVly6P/dnmVZVtkqogYXzXSA1vfhCa/CVz84Aq29+x4vtzQs7nw8/UKU/EjR4s6QJCLB1RO6Xvryg1qlRpV/c7PP1iUfqWDPoAS1E/92trncQOp1B5wInX4aoQ+GNDUEiuT665fAouogbMBc7wvDSc3nptuZw32oPTshio3/LMuCYmErEgB7IO/ypQvlU3IbaNsh4u/tM/E84infQXJYqa0rcMAT882BiStL49vZMIAUzm0TLyK2W4KnVLFRNraNsbhp0zthvq4HZwYGkWT+uXwq5I9k6PbMbwOKnw3QYCIw9OgKvRun9EGbqbgTAXl5mpSlcAWb0wRd0sX7npiMZ/GGAcvLJx/EQbxtSBf6/RHJc05UfzIA9or368te8gta6VRXgiFn0krbnZ4nACuPpli2eECnDBoHLRzOaXpPQ6s1lfod01Q+4frGVjVHshEPZFOuGNyUk53CRXnL hjMZal18 ICq5mGFIzJSp0L9znrLxRdRDF/QBopVV2nVmwrYw4e+CpLJgYYjnbZstA+wgQucDp+SnMEVHgRC/MT0BqMrsiXEL20JueDg+Q1MSvbsM5NU5ZS3XTHf+rZ9se0dNr/dPZz5HPEAbqPsoC4+TLViBcN+Cnfke2oSODd8LU+8fvyH6dCd2Qol6c1aW2LhaEfY8PT9bO/Q36PLHDcQ5RN4bY4zSNkQx4qmj63JjVRmup1bmHiSkuAEQ7zDdX+dzq0e8rNHkk1qoRkFbrPysagNt7BXzDLM9UR73Rj7Y7Wym0s9g5cWSEdOaX4m892Fq3X4uAf1at/K9ox/rs1C8= 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/13/25 09:44, Christoph Hellwig wrote: > On Thu, Mar 13, 2025 at 09:34:39AM +0100, Hannes Reinecke wrote: >> nvmf_connect_command_prep() returns a kmalloced buffer. > > Yes. > >> That is stored in a bvec in _nvme_submit_sync_cmd() via >> blk_mq_rq_map_kern()->bio_map_kern(). >> And from that point on we are dealing with bvecs (iterators >> and all), and losing the information that the page referenced >> is a slab page. > > Yes. But so does every other consomer of the block layer that passes > slab memory, of which there are quite a few. Various internal scsi > and nvme command come to mind, as does the XFS buffer cache. > >> The argument is that the network layer expected a kvec iterator >> when slab pages are referred to, not a bvec iterator. > > It doesn't. It just doesn't want you to use ->sendpage. > But we don't; we call 'sendpage_ok()' and disabling the MSG_SPLICE_PAGES flag. Actual issue is that tls_sw() is calling iov_iter_alloc_pages(), which is taking a page reference. It probably should be calling iov_iter_extract_pages() (which does not take a reference), but then one would need to review the entire network stack as taking and releasing page references are littered throughout the stack. 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