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 222BAC35FFC for ; Wed, 19 Mar 2025 15:11:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2310280003; Wed, 19 Mar 2025 11:11:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD2CD280001; Wed, 19 Mar 2025 11:11:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A73B3280003; Wed, 19 Mar 2025 11:11:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 89280280001 for ; Wed, 19 Mar 2025 11:11:50 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1AA021C778D for ; Wed, 19 Mar 2025 15:11:50 +0000 (UTC) X-FDA: 83238640380.11.872CAD1 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf21.hostedemail.com (Postfix) with ESMTP id AB5241C002D for ; Wed, 19 Mar 2025 15:11:42 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vEW2cCu6; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rC1yq8Xl; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vEW2cCu6; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rC1yq8Xl; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742397103; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=YcHjYImoZ4zMa+3sgvJp80GEtUicvPgGPbO5RgLH6Lw=; b=qkQ97B7a5q8wwTaOgZwheNop5YxZyCVyL8MWjmUgGbBXLEEsUIkRX+HjonBl+B5QukU8jr xFm2NY2fWuJ68rfmE5+jE+vH0/9Huc+4Bm7n56LSBYRqC7aVSL8xAdgUYsnI/syi8M3gH7 +0gEHYuqyXgCBtNEemCeLK7uWgM/T/o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742397103; a=rsa-sha256; cv=none; b=OOCfe5/RmUjLv4DEPPN8vuOTfStqS8oqIH+OWTT9VTvaFD+WnJpisfYstCdv0dHN4mzJ59 moqccfRg9XmfXQRYlzO9FpwFHzGwTVuDBWVj+6B0cTO/CCyT69ad7Rw8O8LFN4oYqTIaot xT5BVVvZa4/cguOUefRjRaqgrX/XsiA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vEW2cCu6; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rC1yq8Xl; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vEW2cCu6; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rC1yq8Xl; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none 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 2FA3721FD0; Wed, 19 Mar 2025 15:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1742397100; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcHjYImoZ4zMa+3sgvJp80GEtUicvPgGPbO5RgLH6Lw=; b=vEW2cCu6nmkMkQalYI82l9s2ig557qlzONbrgTUzLWKmlIsnjt47imaXWm8DIBtCSS7jd3 mQs1UiC/cS6/HmmhoroxLcO9cPjsNpLBAY2pRy8iQddDSxxRFnEXygE//EuC6q2pxNf51P 2kdw2NDMXz59RZsgctiAXCTPH6PQei0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1742397100; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcHjYImoZ4zMa+3sgvJp80GEtUicvPgGPbO5RgLH6Lw=; b=rC1yq8XlOg9YwLjr7aO3eYN+Wfb9CLfhAX+z5otOF7wG6WBI0q09dOmQ2VUmqVNdH4JVcX 7VbXU2MIwVnOGVDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1742397100; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcHjYImoZ4zMa+3sgvJp80GEtUicvPgGPbO5RgLH6Lw=; b=vEW2cCu6nmkMkQalYI82l9s2ig557qlzONbrgTUzLWKmlIsnjt47imaXWm8DIBtCSS7jd3 mQs1UiC/cS6/HmmhoroxLcO9cPjsNpLBAY2pRy8iQddDSxxRFnEXygE//EuC6q2pxNf51P 2kdw2NDMXz59RZsgctiAXCTPH6PQei0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1742397100; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcHjYImoZ4zMa+3sgvJp80GEtUicvPgGPbO5RgLH6Lw=; b=rC1yq8XlOg9YwLjr7aO3eYN+Wfb9CLfhAX+z5otOF7wG6WBI0q09dOmQ2VUmqVNdH4JVcX 7VbXU2MIwVnOGVDQ== 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 1C36113A2C; Wed, 19 Mar 2025 15:11:40 +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 cyRQBqze2md4QwAAD6G6ig (envelope-from ); Wed, 19 Mar 2025 15:11:40 +0000 Message-ID: <6c5bfc10-f5ad-4a80-b0ca-772ac06a37f1@suse.cz> Date: Wed, 19 Mar 2025 16:11:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [LSF/MM BPF Topic] Warming up to frozen pages Content-Language: en-US To: Hannes Reinecke , Matthew Wilcox , lsf-pc@lists.linuxfoundation.org, linux-mm@kvack.org, "linux-block@vger.kernel.org" References: <2a2e5822-d8a6-4460-b92a-01d113e18ead@suse.de> From: Vlastimil Babka In-Reply-To: <2a2e5822-d8a6-4460-b92a-01d113e18ead@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AB5241C002D X-Stat-Signature: m787qgrgbqn8gaixjk7331udqwcijkm7 X-HE-Tag: 1742397102-216396 X-HE-Meta: U2FsdGVkX1+jH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rPuMqGF1or+elAn3WFB+iSwOcjJ7G7qe5xJET7uKgF4lpyLg+RM6x9S2+XQChwiaouo07Y1kUa4nl3yu8c/I0nh6fJN9vBkqH6xLPHsibJMVRcHGU12H382BZI3eTADtEqVpYOHqU+yur+z94v+RJlptPlcoew8O8mO+mgKgXyWUL8D/M97pKu6aAeXId9W43TM2pgn3cRcGwpTX/sax8w+D3Grcn7/YmLqL4B1Gz/8fy0saEPnSyoEpI= 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/18/25 15:47, Hannes Reinecke wrote: > Hey all, > > (Thanks, Jon, for the title :-) > the recent discussion around frozen pages and when to do a > get_page()/put_page() and when not resulted in quite some unresolved issues. > So I would like to propose a session at LSF/MM: > > 'Warming up to frozen pages' > With the frozen pages patchset from Willy slab pages don't need > (and, in fact, can have) a page reference anymore. While this easy BTW, my hope is that large kmalloc folios would also drop the refcount. That means anything obtained by kmalloc(N) where N is over 8k (order-1 folio on 4k PAGE_SIZE). That 8k is an implementation detail of SLUB (SLAB used to have more) and thus all kmalloc() buffers should better behave the same to avoid surprises when some particular allocation size changes, or the thing becomes used on an architecture with larger than 4k page size and thus becomes a "small" kmalloc() there. Willy already added a page type for large kmalloc. Given we can expect possible troubles after the small kmalloc() ones already hit us, I'd first just add get_page()/put_page() warnings for that large kmalloc page type in addition to the slab page type ones and expose that to -next (after the 6.15 merge window) to see if something needs fixing. > to state, and to implement when using iov iterators, problems > arise when these iov iterators get mangled eg when being passed > via the various layers in the kernel. > Case in point: 'recvmsg()', when called from userspace, is being > passed an iov, and the iterator type defines if a page reference > need to be taken. However, when called from other kernel subsystems > (eg from nvme-tcp or iscsi), the iov is filled from a bvec which > in itself is filled from an iov iter from userspace, so the iov > iterator will assume it's a 'normal' bvec, and get a reference for > all entries as it wouldn't know which entry is a 'normal' and which > is a 'slab' page. > As Christoph indicated this is _not_ how things should be, so > a discussion on how to disentangle this would be good. > Maybe we even manage to lay down some rules when a page reference > should be taken and when not. > > Cheers, > > Hannes