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 4DF0AC369DC for ; Tue, 29 Apr 2025 17:47:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3CA56B000C; Tue, 29 Apr 2025 13:47:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BEB566B000D; Tue, 29 Apr 2025 13:47:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8CF46B000E; Tue, 29 Apr 2025 13:47:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8AD136B000C for ; Tue, 29 Apr 2025 13:47:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3C8B7BA4DD for ; Tue, 29 Apr 2025 17:47:15 +0000 (UTC) X-FDA: 83387812830.04.5212EF9 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf28.hostedemail.com (Postfix) with ESMTP id 18245C000D for ; Tue, 29 Apr 2025 17:47:12 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DZpbKQHI; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wV7ytHRp; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DZpbKQHI; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wV7ytHRp; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf28.hostedemail.com: domain of pfalcato@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=pfalcato@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745948833; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L+Om/2yyVlzIC8pM2MuKpNu5aVo4/a/X0+JQIku2ilU=; b=wtpatBDCTBbTfymgvyFx20xdIuPtCCzC+f6ZV2kZDTmZsQ0OYfK3nmu4m6zCP7cSyepONo Uau5u6xBmZWZHeXLEXabhq/CQ0FDofLUbNgIxnN0NK2H8gtx10NR60SXhbfSMCbCbVr4JZ OhXi4+Pa6Ynl0xM1pk6Rep5hHnaL0BY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745948833; a=rsa-sha256; cv=none; b=HZHDLvq2UCinoiUC5h4j6GP/hYYMTFLY8AE2K49CLU8eZsOh08CZpQ4fwB2rMiDznHHrY7 F53/7/rPw9Evfmb1lEpPkvJ30mydVNlJwyncUnX/q8UI8SNvo1osdU34623qgsLjG0GL4k zKlo3CWhOg2eEfmOJ6rjwfDcxnGpno0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DZpbKQHI; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wV7ytHRp; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DZpbKQHI; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wV7ytHRp; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf28.hostedemail.com: domain of pfalcato@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=pfalcato@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 3E9CE211F5; Tue, 29 Apr 2025 17:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1745948831; 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=L+Om/2yyVlzIC8pM2MuKpNu5aVo4/a/X0+JQIku2ilU=; b=DZpbKQHITozUhLgxkVSgGpSaezGeuWPjXHt6eLxJZwDXjg8QfZ3AYWG01ZU4CgrEJwZH4V Hfth/J4TJIVSVLFHj7Iun5m9q+cgQUKGqiR8Gq1HXMSHhTmMswWj9yJ1cWOCk5y9wkgEQ/ AzWa2wOprwarpPUzH/JUdd3s7uFVzEw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1745948831; 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=L+Om/2yyVlzIC8pM2MuKpNu5aVo4/a/X0+JQIku2ilU=; b=wV7ytHRpM4jKkrlHatQ01JRYGx0Ii04wSMPJR3OBfkooyYEcoMMBgZJ1XD4JqkbGYQCRba YNs/FswGbDHoZHAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1745948831; 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=L+Om/2yyVlzIC8pM2MuKpNu5aVo4/a/X0+JQIku2ilU=; b=DZpbKQHITozUhLgxkVSgGpSaezGeuWPjXHt6eLxJZwDXjg8QfZ3AYWG01ZU4CgrEJwZH4V Hfth/J4TJIVSVLFHj7Iun5m9q+cgQUKGqiR8Gq1HXMSHhTmMswWj9yJ1cWOCk5y9wkgEQ/ AzWa2wOprwarpPUzH/JUdd3s7uFVzEw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1745948831; 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=L+Om/2yyVlzIC8pM2MuKpNu5aVo4/a/X0+JQIku2ilU=; b=wV7ytHRpM4jKkrlHatQ01JRYGx0Ii04wSMPJR3OBfkooyYEcoMMBgZJ1XD4JqkbGYQCRba YNs/FswGbDHoZHAw== 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 55BF11340C; Tue, 29 Apr 2025 17:47:10 +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 5JyuEZ4QEWjkNQAAD6G6ig (envelope-from ); Tue, 29 Apr 2025 17:47:10 +0000 Date: Tue, 29 Apr 2025 18:47:08 +0100 From: Pedro Falcato To: Lorenzo Stoakes Cc: Andrew Morton , "Liam R . Howlett" , Vlastimil Babka , Jann Horn , David Hildenbrand , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , Suren Baghdasaryan , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/4] mm: perform VMA allocation, freeing, duplication in mm Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 18245C000D X-Rspam-User: X-Stat-Signature: uuzwueazrg99p9bhigtwbycc14k5mwoi X-HE-Tag: 1745948832-907924 X-HE-Meta: U2FsdGVkX18K+95GG5p1FIBDiGlytvBM+VQ8winiMrVhZ83BbZz0UlkyxGmKySjIOEM+bof0JBCZ22UppkkAPam7yNKy9jh6gSsucCOcbQG9a9WESr+bt94vvATzzX/Gy3GVqkPaU7AxBUJ3pCcPUhPUvZyjSs9kc87QociBlkYBDCZzKgkReZxaU2bnVINx52PrV2t+hXxEPfc0M4IyLj7WZPwAUOs5YLzZuOYZ6mgxe/ESVFz65xKPyG8O5cUcy6/gSxoudilHmpUvKvQofHb/vq82Z9wQj/Zems1vjERdsVi0dl7OhC1R7f+na0ld0f8hErpBNphTpQLT3TTF/+lnZIJLutCi0cq0Xm5TH5pSQ28nRcjapsDrOnTzUIgfWxw4FczK0LnN7u0KlvHU3S3KePy19Y9cHBQnmbGMH5zw+pvgwIdUbPIQxgMSJ/eaWmep7G0wGZHNXI+Ni8+topYTiy1j3gAYvT2+rholCtq+wLooGYJTmeyMQRZ4heO2XIcmQAh8rJUAz5wvpJ+BWOz8WLgEXzkzx5s9lqAcd42TS0fG/8RRfjo9lCGTBI+MOKERuWP4dM2+5eLs//vW5V6HZl2MHyZwgvrHrgAnjANKp0RcOQ9418UvFppsuhA/kyckVKMKRyACZyQ7uOjLaOTz2yjuU03eg0b/E0PnBht4taOXW0BgNb6EGw8GFVijteik2ubrQsMeBv4fTvQTyauMX2rQVxYaZeHWUj0cFdHXnq/Jy1b047lSQzv93tDrSUfNWt4y0aLoebB+anKVQKT3WeBFeDAj01TlJqRNQK/iFD3yFsaFImlVoeGTZkv87mDHUL44Lyg0DtxSQnS+qqB3In7U/SXAsRsbO4zoDvuonmeGINXIQeYt9H3FFBJbdyw8Cd6DUMN6PhHLQXt9e2xBtv8QSwaGlILRY/5/IwhJJM1B8FXAIAtH6hUT060Zxbd59js8XYw= 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 Mon, Apr 28, 2025 at 04:28:17PM +0100, Lorenzo Stoakes wrote: > Right now these are performed in kernel/fork.c which is odd and a violation > of separation of concerns, as well as preventing us from integrating this > and related logic into userland VMA testing going forward, and perhaps more > importantly - enabling us to, in a subsequent commit, make VMA > allocation/freeing a purely internal mm operation. > > There is a fly in the ointment - nommu - mmap.c is not compiled if > CONFIG_MMU not set, and neither is vma.c. > > To square the circle, let's add a new file - vma_init.c. This will be > compiled for both CONFIG_MMU and nommu builds, and will also form part of > the VMA userland testing. > > This allows us to de-duplicate code, while maintaining separation of > concerns and the ability for us to userland test this logic. > > Update the VMA userland tests accordingly, additionally adding a > detach_free_vma() helper function to correctly detach VMAs before freeing > them in test code, as this change was triggering the assert for this. > > Signed-off-by: Lorenzo Stoakes Reviewed-by: Pedro Falcato -- Pedro