From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31294 invoked from network); 6 Feb 2021 00:04:09 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 6 Feb 2021 00:04:09 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 64C2A9C221; Sat, 6 Feb 2021 10:04:05 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id D68109BA45; Sat, 6 Feb 2021 10:03:29 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20150623.gappssmtp.com header.i=@iitbombay-org.20150623.gappssmtp.com header.b="dbwUTijG"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 3EBC19BA45; Sat, 6 Feb 2021 10:03:26 +1000 (AEST) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by minnie.tuhs.org (Postfix) with ESMTPS id 27A2B9BA3F for ; Sat, 6 Feb 2021 10:03:25 +1000 (AEST) Received: by mail-ot1-f45.google.com with SMTP id i20so8614655otl.7 for ; Fri, 05 Feb 2021 16:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8bd8kSvkNyZDUhqU6aqJ408cI05tN3ENCLbqMiUw5Uo=; b=dbwUTijGjwdHqoGjer0CgV0nfzAp4njqE+QcmGozP+zpmwmUewdqrauY5/0sXJUm0B kC3na9JPzBmUustp2jKO9dUKMKwfr3tQ8D6Q0L3/KnyLIvB+PePVMEuPpHmcgrwjgUtV YeTkDCltevB4xhvHSW9p6J9pxGQvYXRqnHGgDtZqkYrV+dMobVz/ms2BVO/l68OELdzy jDeP4Q2y2xIdp36fsuToCi4VFrSzWhlM2oKV5+SgvsxHQUG/QOcfKgeY8t6ar6xZyIfL DOuy/sp1vJfXlUTKZ2S10nfRzLDHMnfjwq1D7VGec/C9iWHPbMQjLtMvOi61uPVnj3V7 jkuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8bd8kSvkNyZDUhqU6aqJ408cI05tN3ENCLbqMiUw5Uo=; b=c/JvJQaJ8rhdnGN+hOz0H0dwd0QphRKAyTDEvGjLGD4R2dSpoX0zSubPaDlo4JdHYJ /Kp3EO6JJNCJy4MLb8awTRCZk09sKhG6pyd4yUtfzSpsn3++USGx02w2LScC+HH32pcX 2aa1btGuJT14AIfiTNUxLI9H7av4F3qkvs9kve8RvcdoeEgl1DBRTzlEEm0V/sMX4o+y oU4aaBEOsfQD8Ao0SqQRZeRur61jZDkhaLD8Ixf0smft3sykE9OnMS3j6SwYHRBHkOn6 zoGXBVRBUFD4T0RMXo4Qs3UlYS8tNdRxO3oCtKmLliOqnzPz2LJSZkXDLPxLRWaecLKF rvrA== X-Gm-Message-State: AOAM531ll+FuLK9QxAtJ4gYf+77ReI5KzOkbu7EV1JBv1YNFmGgvIJcO 73aZEntooRuz33B2WZAfKcqHolkTGry/sp9M5wo= X-Google-Smtp-Source: ABdhPJyZ6eELO/FZp7yxMcN1XiICsYZ265QRNrZmf6G1SC+9AiOInEwrTnccoSZ6O2cIA2Ajn8LYkA== X-Received: by 2002:a9d:862:: with SMTP id 89mr5288562oty.294.1612569804201; Fri, 05 Feb 2021 16:03:24 -0800 (PST) Received: from unknowna45e60f0be01.attlocal.net (172-125-77-130.lightspeed.sntcca.sbcglobal.net. [172.125.77.130]) by smtp.gmail.com with ESMTPSA id o20sm55278otp.20.2021.02.05.16.03.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2021 16:03:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) From: Bakul Shah In-Reply-To: <20210205141820.GO13701@mcvoy.com> Date: Fri, 5 Feb 2021 16:03:21 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <0253BE0F-94CB-41BB-921D-6BD09A188601@iitbombay.org> References: <20210205003315.GK13701@mcvoy.com> <26D923CF-5319-4207-BA28-6EFA0E3BB1F8@iitbombay.org> <20210205141820.GO13701@mcvoy.com> To: Larry McVoy X-Mailer: Apple Mail (2.3654.40.0.2.32) Subject: Re: [TUHS] FreeBSD behind the times? (was: Favorite unix design principles?) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Feb 5, 2021, at 6:18 AM, Larry McVoy wrote: >=20 > On Thu, Feb 04, 2021 at 09:17:54PM -0800, Bakul Shah wrote: >> On Feb 4, 2021, at 4:33 PM, Larry McVoy wrote: >>>=20 >>> Ignoring the page cache and make their own cache has big problems. >>> You can mmap() ZFS files and doing so means that when a page is = referenced >>> it is copied from the ZFS cache to the page cache. That creates a >>> coherency problem, I can write via the mapping and I can write via >>> write(2) and now you have two copies of the data that don't match, >>> that's pretty much OS no-no #1. >>=20 >> Write(2)ing to a mapped page sounds pretty dodgy. Likely to get you >> in trouble in any case. Similarly read(2)ing.=20 >=20 > The entire point of the SunOS 4.0 VM system was that the page you > saw via mmap(2) is the exact same page you saw via read(2). It's > the page cache, it has page sized chunks of memory that cache=20 > file,offset pairs. >=20 > There is one, and only one, copy of the truth. Doesn't matter how > you get at it, there is only one "it". >=20 > ZFS broke that contract and that was a step backwards in terms of > OS design. Let me repeat a part of my response you cut out: And you can keep track of mapped pages and read/write from them if necessary even if you have a separate cache for any compressed = pages. In essence you pass the ownership of a page's data from a compressed page cache to the mapped page. Just like in processor cache coherence algorithms there is one source of truth: the current owner of a cached unit (line or page or whatever). In other words, the you see via mmap(2) will be the exact same page you will see via read(2). Not having = actually tried this I may have missed corner cases + any practical considerations complicating things but *conceptually* this doesn't seem hard. Warner mentions not using ZFS for its double copying. May be omething like the above can a step in the direction of integrating the caches? As Ron says, I too would like to hear what the authors of ZFS have to = say....