[lkml]   [2015]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2] vfs: avoid recopying file names in getname_flags
On Tue, Apr 07, 2015 at 04:38:26PM +0800, Boqun Feng wrote:
> Ping again...

What exactly does it buy us? You need a pathname just a bit under 4Kb, which,
with all due respect, is an extremely rare case. Resulting code is more
complicated, we _still_ copy twice (sure, the second time is for 16 bytes or
so, but...), instead of "compare with the address of embedded array" we get
the loveliness like
> > > + if (name->name != ((char *)name - EMBEDDED_NAME_MAX)) {
this... _And_, on top of everything else, we get name and name->name
guaranteed to hit different cachelines, in all cases, including the common

What for? It's not as if userland memory had been communicated with by
IP over carrier pigeons, after all, and the cost of 4Kb worth of
(essentially) memcpy() is going to be
a) incurred in extremely rare case
b) be dwarfed by the work we need to _do_ with what we'd copied.
After all, that pathname is going to be parsed and traversed - all 4Kb
worth of it.

So what's the point?

 \ /
  Last update: 2015-04-12 02:21    [W:0.124 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site