From nobody Wed Dec 24 01:33:15 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 9D6945FBBE for ; Mon, 29 Jan 2024 11:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529328; cv=none; b=qpxp8jsfEmxra76bYv8x0ifTNEhJ0K1KU7zavEkjuZ6VQLwfG2TGwDHjPj24OfQVV8VZHQtvbzXhG4pqwlFuplD4NJ0kdimXUi/slxS22odqb61dKUJdElGLlhinlA+4IpwWzirgNQ4nNyYVz/dch1WVEnGWny6KYFrdDCru5Os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529328; c=relaxed/simple; bh=AnzxcJj9wjtJkMYs3W/gQlln1rYbehXjbzJ6iBM9txw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GkPzn1dvef5HHnpabgUr8JzVAOv5019JxIYLGekume+9PB7iiigLzpzC4a/4kBOtPNbmEKs4DbEXwiOK8XAXakoAEKTw9ExkpCZw3jkcoVnu00+cuA3W2NeZoVPNNn71gX3Ki+pKXxWezjKIuhoWfry513qY+O7CbzdrIC36BDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=So3bh3vq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="So3bh3vq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706529325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kFEwBUvtYUzBE87TzSBBZpD+94Lt4ih08V10OQ70ATs=; b=So3bh3vqnUgd1pGptXc5gkM4++Io5cbXKaW6EQAFkCc5mWMkOOfx52fhMxnAgN6XFBN+dD TZnGZmIfD7t+xp7OHJBJu1LwonGr/ayHGZ1vpO2C/xTfJU8kqFEqNc/569yMki/nhIBryN pS86i2mu7xlQ4aueKB9GA+WbTa4S6ow= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-3fM3ZQmaN2O0NeesbjZpxw-1; Mon, 29 Jan 2024 06:55:21 -0500 X-MC-Unique: 3fM3ZQmaN2O0NeesbjZpxw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3FC87185A780; Mon, 29 Jan 2024 11:55:20 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id C99E4492BC6; Mon, 29 Jan 2024 11:55:18 +0000 (UTC) From: David Howells To: Eric Van Hensbergen , Dominique Martinet , Latchesar Ionkov Cc: David Howells , Christian Schoenebeck , Matthew Wilcox , Jeff Layton , Christian Brauner , netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] 9p: Enable large folio support Date: Mon, 29 Jan 2024 11:54:35 +0000 Message-ID: <20240129115512.1281624-2-dhowells@redhat.com> In-Reply-To: <20240129115512.1281624-1-dhowells@redhat.com> References: <20240129115512.1281624-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Content-Type: text/plain; charset="utf-8" From: Dominique Martinet Enable large folio support in 9P now that the VM/VFS data I/O interface is handled through netfslib. Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Dominique Martinet cc: Christian Schoenebeck cc: Matthew Wilcox cc: v9fs@lists.linux.dev cc: netfs@lists.linux.dev --- fs/9p/vfs_inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 32572982f72e..ca9f504b9daf 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -262,6 +262,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, inode->i_rdev =3D rdev; simple_inode_init_ts(inode); inode->i_mapping->a_ops =3D &v9fs_addr_operations; + mapping_set_large_folios(inode->i_mapping); inode->i_private =3D NULL; =20 switch (mode & S_IFMT) { From nobody Wed Dec 24 01:33:15 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 49BEB5FDCB for ; Mon, 29 Jan 2024 11:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529328; cv=none; b=EenRjo+gdj6uF5EkAeKsYjQrYWZPd5i+60HXXk3GXzDUCKApAgJ0kOij55r0T74q/XJ7+N79Gy0T8vuyo7VnVwyX7klWNU9Gop6G5+r+f8FT1ap5eeTLkl6NZnFpt8seKlXf1flm+VDev7TwU25W+7Ui6zj4cdwxP0BTx0XlLmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529328; c=relaxed/simple; bh=8IPI0i4AIUbrhnIiq1QZ8oL6smmFsdTdPo6Or4XKuYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kLFLvjXReJrwG/1ph2TK0x0XWp9vleDTNGz6IPgF4nlULOUJbPaZOCLuyZnxpDxo+qmkHCUlsIDmXBV3CLcbdmxWqjbEPkpUwQKphXwB1MHh7Vbsnp/HQpaVH24vh6BJjWgIqm8HXiqfiZgqetsNBU6BPFUMlO/67moVptw9QeI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hNJ6OpF8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hNJ6OpF8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706529326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dSmN7QyWcycaQv80GOOzAGn7oioEgCdIaauNWX6x3RI=; b=hNJ6OpF8Njs6A+lNUzIVtugcDWUPUHYbz1rXVqt5cIBmq1NU6QDmOp/+9u4nNKhZmgANkv Zcu56mukASmSQQy33CEx7VvwFZV2xmcnte4oglTPUcbAknwYoHoL1Kcx03SFR9oCSMf3hf GWnm0iJhwX4XfSvQa7u07ooPpAZi4qg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-J2RsO0QYPT-EtJNyg6lBzA-1; Mon, 29 Jan 2024 06:55:22 -0500 X-MC-Unique: J2RsO0QYPT-EtJNyg6lBzA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4919785A58E; Mon, 29 Jan 2024 11:55:22 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id D36022166B31; Mon, 29 Jan 2024 11:55:20 +0000 (UTC) From: David Howells To: Eric Van Hensbergen , Dominique Martinet , Latchesar Ionkov Cc: David Howells , Christian Schoenebeck , Matthew Wilcox , Jeff Layton , Christian Brauner , netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/3] 9p: Make better use of netfslib's writethrough caching Date: Mon, 29 Jan 2024 11:54:36 +0000 Message-ID: <20240129115512.1281624-3-dhowells@redhat.com> In-Reply-To: <20240129115512.1281624-1-dhowells@redhat.com> References: <20240129115512.1281624-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Content-Type: text/plain; charset="utf-8" netfslib offers the opportunity to do a form of writethrough caching on the pagecache, whereby netfs_perform_write() will set up and dispatch writes to the network as it copies data into the cache, falling back to the ordinary writeback path for the dirty data if this fails. This is selected if the user sets O_DSYNC, O_SYNC, RWF_DSYNC or RWF_SYNC or if the filesystem sets NETFS_ICTX_WRITETHROUGH. Change v9fs_fid_add_modes() to use this if O_DSYNC is set - and assuming that CACHE_WRITEBACK is set and V9FS_SYNC is not set. [?] Does it make sense to add an additional caching mode that uses write-through for all non-DIO writes? Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Dominique Martinet cc: Christian Schoenebeck cc: Jeff Layton cc: v9fs@lists.linux.dev cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/9p/fid.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/9p/fid.h b/fs/9p/fid.h index 29281b7c3887..0b25b4c9781d 100644 --- a/fs/9p/fid.h +++ b/fs/9p/fid.h @@ -56,8 +56,7 @@ static inline void v9fs_fid_add_modes(struct p9_fid *fid,= unsigned int s_flags, ((fid->qid.version =3D=3D 0) && !(s_flags & V9FS_IGNORE_QV)) || (s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) { fid->mode |=3D P9L_DIRECT; /* no read or write cache */ - } else if ((!(s_cache & CACHE_WRITEBACK)) || - (f_flags & O_DSYNC) || (s_flags & V9FS_SYNC)) { + } else if ((!(s_cache & CACHE_WRITEBACK)) || (s_flags & V9FS_SYNC)) { fid->mode |=3D P9L_NOWRITECACHE; } } From nobody Wed Dec 24 01:33:15 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 8C916604C4 for ; Mon, 29 Jan 2024 11:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529334; cv=none; b=NsGbXIbXT/7vXDXOmTDPQsJ5JqI4oUY5GZjPqTTB9AM/cQJJwi4rncfGpwSGdycRh2wwT+vc1kaOaJ2jeveXF43hEzGzuKsR2rRxd3foQBD+qg4pReYi0JuYoXmauXMyKPQ7ycZFUr7BbTpd6TAiy26nJooOdZvNevre5nRITbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706529334; c=relaxed/simple; bh=1byjLmjT6ZOpcnDHKbSQxLlzmYce9B40FvFh6bkgVOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mguKpIacKRlNSO5xVpslsfQzOughJQlMZ0kZ/OS/TQkNzGbqCkV4OHz2EIY+si23isTCk+FXAWEnNjfWQpBlu8EjE3t1BoBjVglhtImhdBQrL6kQcwdq/0a8tojInDpt0U/2+1tFpIRl8AqZjK7eMBao5FMYMeUY1OyrltnMw00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PoQLYHBC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PoQLYHBC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706529328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; b=PoQLYHBCBwd7orH+JsGCpdf27fqQp8Wm9CKFvAKkbC2ggvoPAK/oemBi5pdtEJ2evyukQD yMEE9C+71o+fNc9LHhHwmB8sHdRkvwwprRsRsLxo1ng6d5vaHVSVveHNqB4PHLB6qSLFef D0eXgMr/fC/IAnXkNYhmSJKabztPi1M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-d1lzjPdMMbCmhQXLAPqJfA-1; Mon, 29 Jan 2024 06:55:25 -0500 X-MC-Unique: d1lzjPdMMbCmhQXLAPqJfA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ADC73185A782; Mon, 29 Jan 2024 11:55:24 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id 013882166B31; Mon, 29 Jan 2024 11:55:22 +0000 (UTC) From: David Howells To: Eric Van Hensbergen , Dominique Martinet , Latchesar Ionkov Cc: David Howells , Christian Schoenebeck , Matthew Wilcox , Jeff Layton , Christian Brauner , netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com Subject: [RFC PATCH 3/3] 9p: Always update remote_i_size in stat2inode Date: Mon, 29 Jan 2024 11:54:37 +0000 Message-ID: <20240129115512.1281624-4-dhowells@redhat.com> In-Reply-To: <20240129115512.1281624-1-dhowells@redhat.com> References: <20240129115512.1281624-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Content-Type: text/plain; charset="utf-8" Always update remote_i_size in v9fs_stat2inode*() if the size is available, even if we are asked not to update i_isize Suggested-by: Dominique Martinet Link: https://lore.kernel.org/r/ZZVctju5TEjS218p@codewreck.org/ Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org --- fs/9p/vfs_inode_dotl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 3505227e1704..aa3a77bb5e86 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -684,10 +684,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struc= t inode *inode, mode |=3D inode->i_mode & ~S_IALLUGO; inode->i_mode =3D mode; } - if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) && - stat->st_result_mask & P9_STATS_SIZE) { + if (stat->st_result_mask & P9_STATS_SIZE) { v9inode->netfs.remote_i_size =3D stat->st_size; - v9fs_i_size_write(inode, stat->st_size); + if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE)) + v9fs_i_size_write(inode, stat->st_size); } if (stat->st_result_mask & P9_STATS_BLOCKS) inode->i_blocks =3D stat->st_blocks;