From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (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 71FAF391E7A for ; Fri, 22 May 2026 22:41:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.9.28.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779489723; cv=none; b=G18SGCugrtuXeVO9GOPOjQOVh4bokjvYzprsfIr+wzPLY3Vs3Co6XJ9g7Se3bVYV9k5IDZO+wtZ8vi9rpzslYl/XyI6LbSaQAYkqGf+jc9Cv/FzO0qMT+QcyJIzZsz1yx8+53pYqplD8Td3eA8OmpWVxDnYnVd28woUgvKKoN3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779489723; c=relaxed/simple; bh=jTrxt8pBQmnSCCuuYFcho0dAfhL+nI+Z9OqeP4ZdnG0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tCh1lBtKiR0iX1vJXQXnDVNOscNKM6Y7J51l4U9TMKyz7bvR+c5SNTOD4DEMbRz2NyXzcx6Wp2cl53c1e/YqBQkTGW/VC2MXAZA6v7UokAs7wT7iZ90WmXvf3iio/TP2e8ycrR+VEx7df4NYumvq+DsA8ay+t58tMCuXzUbrlPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu; spf=pass smtp.mailfrom=mit.edu; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b=fzGRFuDb; arc=none smtp.client-ip=18.9.28.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="fzGRFuDb" Received: from macsyma.thunk.org (pool-173-48-115-85.bstnma.fios.verizon.net [173.48.115.85]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 64MMf9rW014755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 May 2026 18:41:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1779489673; bh=mKk+R/Gk87+i0eU1luqUgLxjRP4P7rgGxNJYbCK1vPs=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=fzGRFuDbzkUMu0uEQK2H4c1RfcgnLM3RfKHwG4javJ75OC9qF6AhAaDCLYfTMwPlz of/InxBIn2Z19QZdFO9Lfn35k3wShr53V1AkPLqBH3y926x31L8yIiX5Ft+VhXuzZj u6QWzugSykkNUHT2ZVgG3qguLUAzpDtoZQDbXZTjVM2bX8O4fdSlNwy/eEePJkgPbH xkPsLmfmndIESLSSXVVw5gUV1IIehEFz4Ze8ZLr5XDmXaN6ar/CferRPBKhzJ1xyA5 xOcBMHr5C2Y9tZn++wyEJ2rpZjhv/cRPVTE2PhDddfmQdZgYpBQseZeb0sjiF8InMO Oiul1xSVQJQJA== Received: by macsyma.thunk.org (Postfix, from userid 15806) id DB24469EAC01; Fri, 22 May 2026 18:41:08 -0400 (EDT) Date: Fri, 22 May 2026 18:41:08 -0400 From: "Theodore Tso" To: Jaegeuk Kim Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Wilcox , linux-f2fs-devel@lists.sourceforge.net, Christoph Hellwig , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Akilesh Kailash , Christian Brauner Subject: Re: [f2fs-dev] [PATCH v2] f2fs: another way to set large folio by remembering inode number Message-ID: <20260522224108.GA18663@macsyma-wired.lan> References: <20260409134538.3692605-1-jaegeuk@kernel.org> <20260521155748.GA79343@macsyma-wired.lan> <20260522141115.GA8258@macsyma-wired.lan> Precedence: bulk X-Mailing-List: linux-api@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 Fri, May 22, 2026 at 05:08:41PM +0000, Jaegeuk Kim wrote: > > Thank you for the explanation. It seems I made a wrong assumption on the > usage of "user." prefix where each filesystem can support in different > ways. The "user." prefix is used by all userspace applications that wish to store extended attributes. For example, user.mime_type, user.xdg.origin_url, user.charset, user.appache_handler, etc For more information, see: https://www.freedesktop.org/wiki/CommonExtendedAttribute https://wiki.archlinux.org/title/Extended_attributes I certainly assumed this was common knowledge across all file system maintainers, but this was apparently not true in your case. I don't know how this could be the case given that f2fs implements extended attributes, and I would have thought you would have known that when testing that feature. > I shared some motivation when replying to Darrick's feedback [1], but yes, > it was not enough for all heads-up. The problem started that some speicific > application needs as many high-order pages as possible mostly for reads. So, > I thought we can turn on large folio on the specific files per hints. One way > for the hints was using immutable bit, but it turned out it's very hard to > manage disabling the bit whenever deleting the files. Along with limited > ioctl() and requiring inode eviction to manage large folio activation, I had > to implement this path. > > [1] https://lore.kernel.org/lkml/aeA5C8byIpXWla7f@google.com/ Actually, you still haven't explained your use case, at least, not well enough for me to understand what you are trying to do. So an application wants a particular file to use as many high-order pages as possible. Why? What sort of guarantees do you need to provide? What happens if they can't be provided? What happens if a possibly malicious, or at least gready, application uses this interface to grab a lot of high-order pages? >From your patch: 1. setxattr(file, "user.fadvise", &value, sizeof(unsigned int), 0) -> register the inode number for large folio 2. chmod(0400, file) -> make Read-Only 3. open() -> f2fs_iget() with large folio 4. open(WRITE), mkwrite on mmap, chmod(WRITE) -> return error 5. iput() and open() -> goto #3 6. unlink -> deregister the inode number Why should making the file read-only matter? And when you say "derigster the inode number", why should this be related to deleting the inode? This is an interface which seems to be very specific to your use case. What if those requirements change over time? What if you want pull in a file without making it be read-only? And what if you want to release the large-order pages without deleting the file? - Ted