Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4248470rwl; Tue, 28 Mar 2023 04:57:06 -0700 (PDT) X-Google-Smtp-Source: AKy350bG2vbKEQBQopeHwLKi5Q3PURveR9xeVdEojnsuBXhcfbQ5YYgsUJ2K1eWG05A3DG0zCrNF X-Received: by 2002:a17:90b:314c:b0:23f:9fac:6b31 with SMTP id ip12-20020a17090b314c00b0023f9fac6b31mr15325820pjb.25.1680004625824; Tue, 28 Mar 2023 04:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680004625; cv=none; d=google.com; s=arc-20160816; b=V/BRm4WONczUSt1hk4LWNMlQpR5dMPNSjo43laUP/szrq+T705FDpO82IO4CHbyam7 L0UyY43yJPGyQ6DJjxuBbHWBGyKSloQEQUwqSHRtPmruPY9DeV07ayJKnwpb57/7t0CK fJG39QYUO/IgtYJbDOQLbf7cx0RfQ9/EY+taqsAgD6OlcfwoNmlJ2QSU8PWjNd/iIKYg IjLvtiE9dDFh5WifG018V0TOmnxIhDsjq6M8P0PNEGOOl8IBviF+V+v+nZR9O3jtXMm9 k+SkZ4KhLkL7FN5rQPC7q2+HhowoxoxQKykG7D5pc7nLMxmWarIfOK2Phz1V3I7y6gm6 GF/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BrwzSYm4qlu0nTuyTngTlfOl4RIB2UxL2RuI4CuMcZE=; b=Q+4TDs6oQr3dAP/xbu5G4Kq9J3dHMVhKGgSAHcNc77GvVNUb60mNuGzK68F1mP3dOv HM9RvBhJ9OtdJOq2shUXYBI+BSCUu16AP1z7eRDqnzs71Qb7mfi6j/QMu6eDKppmipob v7ieCpnHXvSyE5NpUCyi2MF0K+NIywtqDQ8rQ9FvxHv4FfX1E9Anv7VURQB5VLn7zvUp qxVDfCWCFQ1v9TSmDRAcq/4QuOdtE7+ZtHTba4R90j07AvxTd0cRFHdKN5m5cyTUSW07 525Aum8ChJ69A8ItMYIiFgibCsq13cVolRcAZM4+GQW3L6X+fJI/T4Ry5ByaudgPbf2Z CAUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=kwH2Nwmc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a170903301500b001a18f77cfcesi27857267pla.561.2023.03.28.04.56.54; Tue, 28 Mar 2023 04:57:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=kwH2Nwmc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjC1LyF (ORCPT + 99 others); Tue, 28 Mar 2023 07:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbjC1LyD (ORCPT ); Tue, 28 Mar 2023 07:54:03 -0400 Received: from kylie.crudebyte.com (kylie.crudebyte.com [5.189.157.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D9E6A7F for ; Tue, 28 Mar 2023 04:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=BrwzSYm4qlu0nTuyTngTlfOl4RIB2UxL2RuI4CuMcZE=; b=kwH2NwmceG+zgIGou0R+M5KHeu KLYVZhG/+nbnPaOqSj3FDNNQchoJuthsHBPLQGJb/XHus3/KJXzhQQ9BFb8wGzwcg5UsxnfJfUMxD rfXVm//evWq2CC82XPADMyKtJ+pPpiufrUe9w6hBHdpULrxUhQqXEsGz9+fvg5M9tix6rr/9dzDuj NDY6rrBacOcmOSXYVskEbVcy3WmSr6FzF/bb7nyXFZgPnuAAJvE7SVzSVjxsWUsGEb4hIc/YiKSQx Y3bxlv+TJfK57oF4dMFQAgxdL+39SxXbsaxqX9FMpJjhqJlroQvB2dhEd4wf40XKwsbdlq6X+HseB gwj4RpG3K91d5Tf0Gxkegt/WT9s13hvp94n2p++1ZEllU9W5I8MYMyDWQQv2WhH/e4Hk3FXSidtVQ ktal5gQqYpOhgwcQov1dkheb+4avQFm3Ah25AXXduHDbnuxLbnJY31U8y8kERasuXU9SQepF/IJxi g4jYZ1T/tyBhM6fGIKgCIseJTdMKarTNUJqQfu8SEx90vGv7Ves32vRChg8PQOfNUu7iv7xMaaahb nUWC8pSNU3q0uvA/6OEuJkEUwmzO8dmCAOqq8Pf/4djs79jvej2ZszIM/s8xVyttI123sXEUr+hN5 4nshqzOYk4mtZTEdh3bNHXWNXMZ585VfxWHxfh1vE=; From: Christian Schoenebeck To: Luis Chamberlain , Dominique Martinet Cc: Eric Van Hensbergen , Josef Bacik , Jeff Layton , lucho@ionkov.net, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Amir Goldstein , Pankaj Raghav Subject: Re: 9p caching with cache=loose and cache=fscache Date: Tue, 28 Mar 2023 13:53:49 +0200 Message-ID: <2391219.DQnbcWml7j@silver> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, March 28, 2023 4:31:50 AM CEST Dominique Martinet wrote: > Luis Chamberlain wrote on Mon, Mar 27, 2023 at 10:39:54AM -0700: > > > I have fixed what > > > I hope to be my last bug with the new patch series so it should be > > > going into linux-next today. > > > > Nice, thanks, since kdevops relies on a host kernel though and we strive > > to have stability for that, I personally like to recommend distro > > kernels and so they're a few kernel releases out of date. So debian-testing > > is on 6.1 as of today for example. > > [...] > > - opts: "ro,trans=virtio,version=9p2000.L,posixacl,cache=loose" > > + opts: "ro,trans=virtio,version=9p2000.L,posixacl,cache=none" > > Yes, if you want something mostly coherent with the host, cache=none (or > cache=mmap if you need mmap, iirc linux build does for linking? if you > want to do that on guest...) is what you'll want to use on current > kernels. > > > BTW the qemu wiki seems to suggest cache=loose and its why I used it on > > kdevops as a default. What about the following so to avoid folks running > > into similar issues? I can go and update the wiki too. > > I've added Christian in Cc for this point, he's more active on the qemu > side > (thread started here: > https://lkml.kernel.org/r/ZA0FEyOtRBvpIXbi@bombadil.infradead.org > ) > > I have no opinion on the current wording, the default is there for a > reason and it's a safe default (none), and cache=loose is clearly > described with "no attempts are made at consistency, intended for > exclusive, read-only mounts" which I think ought to be clear enough > (exclusive means not shared with the host), but if you think it's not > clear enough it probably isn't. > > A word on the qemu wiki "if you want to share with host..." would > probably be good though. Hi Luis, not sure which QEMU wiki page you are referring to. AFAIK we currently have 3 QEMU wiki pages concerning 9p: 1. 9p documentation for users: https://wiki.qemu.org/Documentation/9psetup 2. 9p documentation for developers only: https://wiki.qemu.org/Documentation/9p 3. How to setup an entire guest on top of a 9p root filesystem: https://wiki.qemu.org/Documentation/9p_root_fs Only the latter wiki page mentions cache=loose at all: "To speedup things you can also consider to use e.g. cache=loose instead. That will deploy a filesystem cache on guest side and reduces the amount of 9p requests to hosts. As a consequence however guest might not immediately see file changes performed on host side. So choose wisely upon intended use case scenario. You can change between cache=mmap or e.g. cache=loose at any time." Which I now changed to: "To speedup things you can also consider to use e.g. cache=loose instead. That will deploy a filesystem cache on guest side and reduces the amount of 9p requests to hosts. As a consequence however guest might not see file changes performed on host side *at* *all* (as Linux kernel's 9p client currently does not revalidate for fs changes on host side at all, which is planned to be changed on Linux kernel side soon though). So choose wisely upon intended use case scenario. You can change between cache=mmap or e.g. cache=loose at any time." On the user page it was already clearly mentioned though: "Mount the shared folder on guest using mount -t 9p -o trans=virtio test_mount /tmp/shared/ -oversion=9p2000.L,posixacl,msize=104857600,cache=none In the above example the folder /home/guest/9p_setup/ shared of the host is shared with the folder /tmp/shared on the guest. We use no cache because current caching mechanisms need more work and the results are not what you would expect." Best regards, Christian Schoenebeck