News for hackers. Stuff that matters.
Re:50 Years in Filesystems: 1974 Unix V7 by senectus1 on Wednesday May 10, 2023 @10:21PM (#35896545)
oi! steady on.. I was born in 1974 and I'm not 50 YET!
Re:50 Years in Filesystems: 1974 Unix V7 by iohead on Wednesday May 10, 2023 @10:46PM (#35896701)
Well, V7 UNIX is rather arbitrary as a reference point for comparison. There was what we now call as V1 UNIX, which would be circa 1971/72, so that's certainly 50+ years old. Compared to what's shown in the article, some of the data structure fields and constants would be different and/or missing in the still earlier versions. DIRSIZ would be 8, for example.
Re:50 Years in Filesystems: 1974 Unix V7 by musicale on Thursday May 11, 2023 @02:10AM (#35898307)
Well the author refers to Bach's book (though I thought that was System V?) Another option would be V6 with Lions' commentary.
Re:50 Years in Filesystems: 1974 Unix V7 by musicale on Wednesday May 10, 2023 @11:35PM (#35897061)
> There can be only one writer active per file, which kills concurrency

Multiple writers contending over a single resource is what kills concurrency. Single writer is a good design.

It's also helpful for distributed implementations.

Re:50 Years in Filesystems: 1974 Unix V7 by monocasa on Thursday May 11, 2023 @01:54AM (#35898186)
A file is arguably N resources, where N is the number of granular elements of your file. Probably pages, but could be blocks or bytes too depending on where in storage it's canonical copy lives.
Re:50 Years in Filesystems: 1974 Unix V7 by musicale on Thursday May 11, 2023 @02:06AM (#35898280)
Point taken. In any case, single-writer helps with concurrency and consistency. For V7 Unix, I think one solution could be to split the file into blocks, each with a single writer. Admittedly this makes reads of the whole file more costly, so one has to be careful about the block size.
Re:50 Years in Filesystems: 1974 Unix V7 by monocasa on Thursday May 11, 2023 @02:50AM (#35898636)
> Admittedly this makes reads of the whole file more costly, so one has to be careful about the block size.

Maybe? You're probably locking each block at a time in the buffer cache during reads anyway.

Re:50 Years in Filesystems: 1974 Unix V7 by jasomill on Thursday May 11, 2023 @03:41AM (#35899040)
N.B.: in V7 (and 32V), inodes are locked identically for both writes and reads[1],

    if((ip->i_mode&(IFCHR&IFBLK)) == 0)
      plock(ip);
    if(mode == FREAD)
      readi(ip);
    else
      writei(ip);
    if((ip->i_mode&(IFCHR&IFBLK)) == 0)
      prele(ip);
I imagine a more serious bottleneck to random read/write concurrency would have been disk performance.

Average seek time / rotational latency (years by manual copyright, so estimated):

RL02 (1978): 55 ms / 12.5 ms RK07 (1978): 36.5 ms / 12.5 ms RA81 (1982): 28 ms / 8.3 ms RA92 (1989): 16 ms / 8.3 ms.

Note that the RL02 (and V7) and RA92 mentioned in the article are separated by about a decade.

[1] https://github.com/dspinellis/unix-history-repo/blob/Researc...

Re:50 Years in Filesystems: 1974 Unix V7 by tremon on Thursday May 11, 2023 @09:26AM (#35901689)
But those N resources are not independent, which is why it makes sense to think of them as one singular resource. For example, if you were to remove the first byte from the file, or prepend a byte, all the other bytes' addresses would change. And arguably, we already have an interface to logically group different filesystem objects together yet retain the ability to address them individually: it's called a directory.

I'm sure you could define a more granular format to address all elements within a file individually (for example, a lot of files in a typical Unix /etc directory have rows and fields), but people would call that interface an object store rather than a filesystem.

Re:50 Years in Filesystems: 1974 Unix V7 by monocasa on Thursday May 11, 2023 @12:53PM (#35904862)
They are independent, just their assignment to addresses is not. That's why databases still gain from having multiple writers with the exception of SQLite.
Re:50 Years in Filesystems: 1974 Unix V7 by ElectricalUnion on Thursday May 11, 2023 @10:42AM (#35902846)
But those interfaces [to allocate bytes/pages before other bytes/pages, allocate bytes/pages in the middle of bytes/pages, to prune bytes/pages before other bytes/pages] to manipulate said parts are non-portable between *NIX implementations, usually limited to certain filesystems with specific implementation-specific minimum byte sizes.

So like how the OS pretends filesystems are in a tape, the filesystem pretends that the files are in a tape.

And tape splicer is optional with a not-standard interface (logical volume management, fallocate, etc).

Re:50 Years in Filesystems: 1974 Unix V7 by monocasa on Thursday May 11, 2023 @12:55PM (#35904894)
Then don't do that part, allocate at the end and only rewrite existing blocks rather than deleting them. It's like how just because you can't easily sbrk(2) new memory before at the beginning of a heap doesn't mean you can't have multiple threads despite that being the resource you're contending.
Re:50 Years in Filesystems: 1974 Unix V7 by aap_ on Thursday May 11, 2023 @03:23AM (#35898895)
A bit strange to talk about 1974 but look at code from v7 (1979).
Re:50 Years in Filesystems: 1974 Unix V7 by rahen on Thursday May 11, 2023 @07:48AM (#35900823)
Indeed. 1974 was the release year of V6, not V7.