about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-03-02 10:56:17 +0000
committerEric Wong <normalperson@yhbt.net>2013-03-02 11:18:27 +0000
commitf128eea752d51a566996043fd159da9be8d83597 (patch)
treeddc988d53fc76ad88f0251512fa65818245c0f78
parent20bcb2ccc3d3d38b0fc2f16c25cad74d8404d5bb (diff)
downloadcmogstored-f128eea752d51a566996043fd159da9be8d83597.tar.gz
tls_rbuf allows us to avoid nearly all dynamic allocation
for common HTTP requests.  However, the mog_rbuf structure
may be detached from TLS as necessary (and another one
allocated in its place) when the need arises.
-rw-r--r--alloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/alloc.c b/alloc.c
index ea2e846..04bc789 100644
--- a/alloc.c
+++ b/alloc.c
@@ -1,6 +1,12 @@
 /*
  * Copyright (C) 2012-2013, Eric Wong <normalperson@yhbt.net>
  * License: GPLv3 or later (see COPYING for details)
+ *
+ * We use thread-local buffers as much as possible.  mog_rbuf may
+ * be detached from the thread-local pointer (and grown) if we have
+ * requests trickled to us or large requests.  This is unlikely with
+ * MogileFS (which only deals with internal LAN traffic), and unlikely
+ * even with normal, untrusted HTTP traffic.
  */
 #include "cmogstored.h"
 #define L1_CACHE_LINE_MAX 128 /* largest I've seen (Pentium 4) */