lkml.org 
[lkml]   [2009]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] net: add dataref destructor to sk_buff
On Fri, 13 Nov 2009 21:27:57 -0500
Gregory Haskins <gregory.haskins@gmail.com> wrote:

> Herbert Xu wrote:
> > On Fri, Nov 13, 2009 at 08:33:35PM -0500, Gregory Haskins wrote:
> >> Well, not with respect to the overall protocol, of course not. But with
> >> respect to the buffer in question, it _has_ to be. Or am I missing
> >> something?
> >
> > sendfile() has never guaranteed that the kernel is finished with
> > the underlying pages when it returns.
> >
> > Cheers,
>
> Clearly there must be _some_ mechanism to synchronize (e.g.
> flush/barrier) though, right? Otherwise, that interface would seem to
> be quite prone to races and would likely be unusable. So what does
> said flush use to know when the buffer is free?

No all the interfaces require a copy. Actually, sendfile makes no guarantee about synchronization
because the receiver of said file could be arbitrarily slow, and any attempt at locking down
current contents of file is a denial of service exposure.

People have tried doing copy-less send by page flipping, but the overhead of the IPI to
invalidate the TLB exceeded the overhead of the copy. There was an Intel paper on this in
at Linux Symposium (Ottawa) several years ago.


\
 
 \ /
  Last update: 2009-11-14 03:47    [W:0.093 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site