From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Tue Mar 10 21:03:55 EDT 2020 Received: from stockyard.bk.recurse-network.net (gateway.bk.recurse-network.net [185.230.222.2]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 849d60e8 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Tue, 10 Mar 2020 18:03:44 -0700 (PDT) Message-ID: <9FAB3D9B768738E59305FAA3FBD02A19@eigenstate.org> To: plan9fullfrontal@qs.co.nz, 9front@9front.org Subject: Re: [9front] How is smp handled in file services? Date: Tue, 10 Mar 2020 18:03:43 -0700 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: JSON over ORM persistence component polling backend > Just trying ti understand the data flow through the kernel (as compared > to *nix). > > Given the following easy to understand example: > > Assume that three processes are writing to /dev/audio through the mixfs > file server. Given that all processes are on the same terminal server, > and that there are ample idle cpu cores (ignore locking and other side > effects), what is the data flow path in mixfs: > > 1. All three procs sleep while some proc processes the write > requests sequentially, returning the results sequentially. > > 2. All three procs enter the file service and process one request > concurrently and return result directly to own process. > > I am assuming that unless designed specifically in the file server, that > the answer is 1. If you're in userspace, the file server is just reading from an FD. it's up to you if you want to add concurrency around those reads. If you're in the kernel, it's concurrent. a process enters the kernel from sysfile.c:/^sysread, which pretty much just calls sysfile.c:/^read. There aren't any locks held up to: nnn = nn = devtab[c->type]->read(c, p, n, off); Smokey the bear says: Only you can prevent corrupted data structures.