DragonFly - I/O Device Operations ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ New I/O Device Model 新しい I/O デバイスの形 I/O is considerably easier to fix than VFS owing to the fact that most devices operate asynchronously already, despite having a semi-synchronous API. The I/O model being contemplated consists of three major pieces of work: 大部分のデバイスが非同期的な API を持っているにも関わらず非同期的に動作す るおかげで、 I/O は VFS より調整することが簡単になっています。予定されてい る I/O モデルは 3つの主要な作業から成っています: 1. I/O Data will be represented by ranges of VM Objects instead of ranges of system or user addresses. This allows I/O devices to operate entirely independently of the originating user process. 2. Device I/O will be handled through a port/messaging system. (See 'messaging' goal.) 3. Device I/O will typically be serialized through one or more threads. Each device will typically be managed by its own thread but certain high performance devices might be managed by multiple threads (up to one per cpu). Multithreaded devices would not necessarily compete for resources. For example, the TCP stack could be multithreaded with work split up by target port number mod N, and thus run on multiple threads (and thus multiple cpus) without contention. 1. I/O データはシステムの範囲あるいはユーザアドレスの代わりに、VM オブジェ クトの範囲によって示されることになるでしょう。 2. デバイスへの I/O は port/messaging システムを通して扱われるようになりま す。('messaging' を見てください) 3. 通常、デバイスへの I/O はひとつかもっと多くのスレッドを通してシリアライ ズされるようになります。各々のデバイスは、通常は独自のスレッドによって管理 されることになりますが、ある特定の高性能なデバイスは多数のスレッド(CPU 1つ につき 1本追加)によって管理されるかもしれません。マルチスレッドデバイスは 必ずしもリソースの奪い合いをするわけではありません。例えば、TCP スタックは 対象ポート数の剰余 N で分割した作業に対してマルチスレッドになりますが、そ れゆえに競合なしに多数のスレッドで(多数の CPU 上で)走ることになります。 As part of this work I/O messages will utilize a flat 64 bit byte-offset rather than block numbers. この作業の一部として、I/O メッセージはブロックナンバーよりもむしろフラット な 64-bit バイトオフセットを利用することになるでしょう。 Note that device messages can be acted upon synchronously by the device. Do not make the mistake of assuming that messages are unconditionally serialized to the device thread because they aren't. See the messaging section for more information. デバイスメッセージはデバイスによって同期的に振舞うことができるということに 注意してください。それらがないという理由で、メッセージがデバイススレッドと して無条件にシリアライズされるという想定をする間違いをしないでください。よ り詳しい情報はメッセージングセクションを見てください。 It should also be noted that the device interface is being designed with the flexibility to allow devices to operate as user processes rather then as kernel-only threads. Though we probably will not achieve this capability for some time, the intention is to eventually be able to do it. There are innumerable advantages to being able to transparently pull things like virtual block devices and even whole filesystems into userspace. デバイスがカーネルスレッドよりもむしろユーザプロセスとして動作することを許 すために、デバイスインターフェースは柔軟性を持つようにデザインされているこ ともまた注意すべきことです。私達は多分しばらくの間はこの機能を得ることはで きないでしょうが、この概念はいずれ実現するでしょう。そこには仮想的なブロッ クデバイスやユーザ空間の中の統一的なファイルシステムのようなものでさえ透過 的に扱うことができるために、数え切れない程の利点があります。