From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3C62CE67D1FF8260C5450B3D0AE7AA1A@felloff.net> Date: Thu, 11 Oct 2018 01:58:15 +0200 From: cinap_lenrek@felloff.net To: 9fans@9fans.net In-Reply-To: CAGGHmKGVHKjxONB3NEOBd0kBvTuA1FcA9Zh10T2aRTMJVYbW8g@mail.gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] zero copy & 9p (was Re: PDP11 (Was: Re: what heavy negativity!) Topicbox-Message-UUID: eb9e2a78-ead9-11e9-9d60-3106f5b1d025 > Fundamentally zero-copy requires that the kernel and user process > share the same virtual address space mapped for the given operation. and it is. this doesnt make your point clear. the kernel is always mapped. (you ment 1:1 identity mapping *PHYSICAL* pages to make the lookup cheap?) the difference is that *USER* pages are (unless you use special segments) scattered randomly in physical memory or not even realized and you need to lookup the pages in the virtual page table to get to the physical addresses needed to hand them to the hardware for DMA. now the *INTERESTING* thing is what happens to the original virtual address space that covered the I/O when someone touches into it while the I/O is in flight. so do we cut it out of the TLB's of ALL processes *SHARING* the segment? and then have the pagefault handler wait until the I/O is finished? fuck your go routines... he wants the D. > This can't always be done and the kernel will be forced to perform a > copy anyway. explain *WHEN*, that would be an insight in what you'r trying to explain. > To wit, one of the things I added to the exynos kernel > early on was a 1:1 mapping of the virtual kernel address space such > that something like zero-copy could be possible in the future (it was > also very convenient to limit MMU swaps on the Cortex-A15). That said, > the problem gets harder when you're working on something more general > that can handle the entire address space. In the end, you trade the > complexity/performance hit of MMU management versus making a copy. don't forget the code complexity with dealing with these scattered pages in the *DRIVERS*. > Believe it or not, sometimes copies can be faster, especially on > larger NUMA systems. -- cinap