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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAB3ACFC29A for ; Fri, 21 Nov 2025 18:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:MIME-Version:References: Message-ID:To:Date:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=huuawjAbczwIq8wvGgeUO4lTZYCESJtW4UlqTnQW/Ws=; b=AMvoNWuJF3cQrY+uFzLGJ3NQ56 DPTAqKkxSnSFlOzBtfdgWdp0Pyphwa8cRDA5PAq1zCI0Z9Ex+smyWJ/arKGfydnCLfNq5z/n/jySc vO/dRajvN7rNZec/8Wg/Y135dbSNS/ONGsBXbmS26oxLjmHbw7k7vgeo4PVCX/8bvIeo=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vMVSm-0006QU-Kt; Fri, 21 Nov 2025 18:02:28 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vMVSl-0006QO-RQ for linux-f2fs-devel@lists.sourceforge.net; Fri, 21 Nov 2025 18:02:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QQvdXsUFsSgmgdlK4Hqgea3i/WHKlDRKsaXkhpCZRwQ=; b=R9gZlPc7y9Ywao/05jHFXSmXsw sXY4fryMqhbvVa1D1Nntgf08QJ1lPBaVmz+8V8x4ol1rrQ+IBqP1lL84V4sMBb+/7D6bwb4+fFMt6 Y533NRfOOGLww9dKP3yoDWrwg63UMBmN9Hify9WGbNQS0zlzJI9pusQDVIXRQ5+5X4bM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QQvdXsUFsSgmgdlK4Hqgea3i/WHKlDRKsaXkhpCZRwQ=; b=PXRqI7iV2Y56kmdx2jkGNe0dpq okhRp5xv3RKcYeUi5rkQHxwZ3IGZKD2Iogp54K/XRcMGH42b1/Ph404XCOXUtzBJcMTrQEERvbpcW SzQ7iCK3taIvjXhXijmdkX4wM/favZ6mSCz5ivhEtz6MklHSalN/23y/wOh/wLqHBMy8=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vMVSl-0007po-Dg for linux-f2fs-devel@lists.sourceforge.net; Fri, 21 Nov 2025 18:02:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C1F1B605D1; Fri, 21 Nov 2025 18:02:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C91C4CEF1; Fri, 21 Nov 2025 18:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763748141; bh=m2bA12FIv0pEMyLCbJ3EVa7rHjBb0FPrihVbgFol0Zk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ca83LyS2vXxHRwBX+pCIwfKeT5FOSeHOTW/Sb73MAOCujAHk/T3geekVlESRsenjK EABFED85pOzrFnKQj+oZOr9J8osuT8zlIM+VMe323bJGMyd1SWhyeyjmFhf0t3JH3A Ln6hXC1a2hPMkKXfow+Driqe5a/eiY4w8TpnhXwHqMrWTTAMEm8SWTbrfmkg6iDNNA Tf7K1938rTJHsU/4uMPgEENdk6qQVMLngkVWPk6N4aU8ereVIOOgtqMrJC2fqZlcsO tIM1eLiVvNMRqrn0cVbtpmpzF78rr8FdfpW3jiDOLTW28Ny5lqAqpEKOlxagZNE+Eq ESYaH9e+nvsow== Date: Fri, 21 Nov 2025 18:02:19 +0000 To: Matthew Wilcox Message-ID: References: <20251121032718.1993528-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1vMVSl-0007po-Dg Subject: Re: [f2fs-dev] [PATCH] [RFC] mm/fadvise: introduce POSIX_FADV_MLOCK X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: Christian Brauner , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 11/21, Matthew Wilcox wrote: > On Fri, Nov 21, 2025 at 04:46:14AM +0000, Jaegeuk Kim wrote: > > On 11/21, Matthew Wilcox wrote: > > > On Fri, Nov 21, 2025 at 03:27:18AM +0000, Jaegeuk Kim wrote: > > > > This patch introduces a new POSIX_FADV_MLOCK which 1) invalidates the range of > > > > cached pages, 2) sets the mapping as inaccessible, 3) POSIX_FADV_WILLNEED loads > > > > pages directly to the inaccessible mapping. > > > > > > ... what? > > > > > > This seems like something which is completely different from mlock(). > > > So it needs a different name. > > > > > > But I don't understand the point of this, whatever it's called. Need > > > more information. > > > > So, the sequence that I'd like to optimize is mmap(MAP_POPULATE) followed > > by mlock(). For example, mmap() takes 1 second to load 4GB data, and mlock() > > takes 330ms additionally in order to migrate all the pages into inaccessible > > map, IIUC. > > Oh, so the MLOCK part is right, but the inaccessible() part is wrong. > Inaccessible is special weird guest_memfd crap that has all kinds of > side-effects that you don't want. > > Wouldn't you get the same effect by calling mlock2(MLOCK_ONFAULT) and > then calling readahead() for the desired range? Oh, thank you. Let me try. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E2803546EF for ; Fri, 21 Nov 2025 18:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763748143; cv=none; b=Khk5fxcmm96MX02If5C1VNOWxPwg9eIvRC95algh/tRVNuzXoRdT9zttTb7H4HDY+U0x9wb2on8eZWWbSSRocR08dtP75vmYo48RRLuWfM32OHKhw1Gi+A2pB858B+Heetbn+Vm21F4uZCAZP1UNbQz2qCZpLik8G1pTvPO8Aak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763748143; c=relaxed/simple; bh=m2bA12FIv0pEMyLCbJ3EVa7rHjBb0FPrihVbgFol0Zk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Fs+Vy+G35Pt1xifyJH8WGjiWrXlto5cBuH8l/ntxfp7vkaQVXLp5yKppehU1v7QybweTxBDH5DjtAqImXy971bZKNcWKZqDyKzLiH+wHzApZaPNOOTirupcA3n3wQOJib3UHVdfd3fp79BdtKE0ZZJolri0YWTlpq/xg3xjT+xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ca83LyS2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ca83LyS2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C91C4CEF1; Fri, 21 Nov 2025 18:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763748141; bh=m2bA12FIv0pEMyLCbJ3EVa7rHjBb0FPrihVbgFol0Zk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ca83LyS2vXxHRwBX+pCIwfKeT5FOSeHOTW/Sb73MAOCujAHk/T3geekVlESRsenjK EABFED85pOzrFnKQj+oZOr9J8osuT8zlIM+VMe323bJGMyd1SWhyeyjmFhf0t3JH3A Ln6hXC1a2hPMkKXfow+Driqe5a/eiY4w8TpnhXwHqMrWTTAMEm8SWTbrfmkg6iDNNA Tf7K1938rTJHsU/4uMPgEENdk6qQVMLngkVWPk6N4aU8ereVIOOgtqMrJC2fqZlcsO tIM1eLiVvNMRqrn0cVbtpmpzF78rr8FdfpW3jiDOLTW28Ny5lqAqpEKOlxagZNE+Eq ESYaH9e+nvsow== Date: Fri, 21 Nov 2025 18:02:19 +0000 From: Jaegeuk Kim To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Christian Brauner Subject: Re: [PATCH] [RFC] mm/fadvise: introduce POSIX_FADV_MLOCK Message-ID: References: <20251121032718.1993528-1-jaegeuk@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: On 11/21, Matthew Wilcox wrote: > On Fri, Nov 21, 2025 at 04:46:14AM +0000, Jaegeuk Kim wrote: > > On 11/21, Matthew Wilcox wrote: > > > On Fri, Nov 21, 2025 at 03:27:18AM +0000, Jaegeuk Kim wrote: > > > > This patch introduces a new POSIX_FADV_MLOCK which 1) invalidates the range of > > > > cached pages, 2) sets the mapping as inaccessible, 3) POSIX_FADV_WILLNEED loads > > > > pages directly to the inaccessible mapping. > > > > > > ... what? > > > > > > This seems like something which is completely different from mlock(). > > > So it needs a different name. > > > > > > But I don't understand the point of this, whatever it's called. Need > > > more information. > > > > So, the sequence that I'd like to optimize is mmap(MAP_POPULATE) followed > > by mlock(). For example, mmap() takes 1 second to load 4GB data, and mlock() > > takes 330ms additionally in order to migrate all the pages into inaccessible > > map, IIUC. > > Oh, so the MLOCK part is right, but the inaccessible() part is wrong. > Inaccessible is special weird guest_memfd crap that has all kinds of > side-effects that you don't want. > > Wouldn't you get the same effect by calling mlock2(MLOCK_ONFAULT) and > then calling readahead() for the desired range? Oh, thank you. Let me try.