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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 502BDC4338F for ; Tue, 3 Aug 2021 01:40:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B4136100A for ; Tue, 3 Aug 2021 01:40:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9B4136100A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 59FBA6B0033; Mon, 2 Aug 2021 21:40:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54FC06B0036; Mon, 2 Aug 2021 21:40:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43E756B005D; Mon, 2 Aug 2021 21:40:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 2B02E6B0033 for ; Mon, 2 Aug 2021 21:40:40 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D09BB1B046 for ; Tue, 3 Aug 2021 01:40:39 +0000 (UTC) X-FDA: 78432064998.07.ADB55BA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id EA578F009AC5 for ; Tue, 3 Aug 2021 01:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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; bh=VyFA1z5ngZ0mjADNv8+t6fHk/i7xgEzisFeVDdSHspo=; b=rz7Z7Ai+DJR4jVHuhbK7W5UQqk 4uU26mPOXb3JxjtGC7q9KtfilWl4bAckJod73v+82rcyDeffua5z3/TXWNYET/rHHx/zDI9FQWIcJ YhRr1nh6ZKH8jHFAT34+YKd+ufT787Cjv0XzQPCrmlgD24BEbraiMF0Gbjb8uPTkvw5kDVfMPomwX cYnNVrIP8U0P7UMqQC45ydrL8KV30eKMH400ev4x0TzoJtvrB/k8qlZWlygTv5TvY+IEg9dI/PzyS uex1LisXBNRhzZSCPnqRG6HzaPMrry4QXM0dHWrtVzo3BE/Ptg+mm9UKDCeMYLWd6YarB1RPVItxE WRz32YLg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAjOA-0045lA-3i; Tue, 03 Aug 2021 01:38:46 +0000 Date: Tue, 3 Aug 2021 02:38:38 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , Shakeel Butt , "Kirill A. Shutemov" , Yang Shi , Miaohe Lin , Mike Kravetz , Michal Hocko , Rik van Riel , Christoph Hellwig , "Eric W. Biederman" , Alexey Gladkov , Chris Wilson , Matthew Auld , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 10/16] tmpfs: fcntl(fd, F_MEM_LOCK) to memlock a tmpfs file Message-ID: References: <2862852d-badd-7486-3a8e-c5ea9666d6fb@google.com> <54e03798-d836-ae64-f41-4a1d46bc115b@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54e03798-d836-ae64-f41-4a1d46bc115b@google.com> Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=rz7Z7Ai+; dmarc=none; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: bwif66gioq6jwhx5u1m796ds7pf91446 X-Rspamd-Queue-Id: EA578F009AC5 X-Rspamd-Server: rspam01 X-HE-Tag: 1627954838-839072 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: On Fri, Jul 30, 2021 at 12:55:22AM -0700, Hugh Dickins wrote: > A new uapi to lock the files on tmpfs in memory, to protect against swap > without mapping the files. This commit introduces two new commands to > fcntl and shmem: F_MEM_LOCK and F_MEM_UNLOCK. The locking will be > charged against RLIMIT_MEMLOCK of uid in namespace of the caller. It's not clear to me why this is limited to shmfs. Would it not also make sense for traditional filesystems, eg to force chrome's text pages to stay in the page cache, no matter how much memory the tabs allocate?