lkml.org 
[lkml]   [2000]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: zero-copy TCP
Alan Cox wrote:
> > struct page of course). Note that it doesn't matter if another thread,
> > and this includes truncate/write in another thread, clobbers the page
> > data. That's just the normal effect of two concurrent writers to the
> > same memory.
>
> Oh it does matter. You might send out a page of kernel data by mistake, or
> one some machines take a fault

Of course you still have to lock the page (bump the reference count) and
write-fault if it needs unsharing.

What I mean is it doesn't matter if another thread writes to the page,
even from kernel space, as long as it's still the same user space page.
You don't have to prevent _other_ writers from accessing the page, so
you don't need to modify page tables or do any TLB flushes.

(This applies on x86 at least. I'm not so sure how DMA cache coherency
works on other architectures.)

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.103 / U:3.688 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site