)]}'
{
  "log": [
    {
      "commit": "6a2d7a955d8de6cb19ed9cd194b3c83008a22c32",
      "tree": "dc440341412a45a7c1f363dcaa1505fe711eadec",
      "parents": [
        "02a0e53d8227aff5e62e0433f82c12c1c2805fd6"
      ],
      "author": {
        "name": "Eric Dumazet",
        "email": "dada1@cosmosbay.com",
        "time": "Wed Dec 13 00:34:27 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.osdl.org",
        "time": "Wed Dec 13 09:05:49 2006 -0800"
      },
      "message": "[PATCH] SLAB: use a multiply instead of a divide in obj_to_index()\n\nWhen some objects are allocated by one CPU but freed by another CPU we can\nconsume lot of cycles doing divides in obj_to_index().\n\n(Typical load on a dual processor machine where network interrupts are\nhandled by one particular CPU (allocating skbufs), and the other CPU is\nrunning the application (consuming and freeing skbufs))\n\nHere on one production server (dual-core AMD Opteron 285), I noticed this\ndivide took 1.20 % of CPU_CLK_UNHALTED events in kernel.  But Opteron are\nquite modern cpus and the divide is much more expensive on oldest\narchitectures :\n\nOn a 200 MHz sparcv9 machine, the division takes 64 cycles instead of 1\ncycle for a multiply.\n\nDoing some math, we can use a reciprocal multiplication instead of a divide.\n\nIf we want to compute V \u003d (A / B)  (A and B being u32 quantities)\nwe can instead use :\n\nV \u003d ((u64)A * RECIPROCAL(B)) \u003e\u003e 32 ;\n\nwhere RECIPROCAL(B) is precalculated to ((1LL \u003c\u003c 32) + (B - 1)) / B\n\nNote :\n\nI wrote pure C code for clarity. gcc output for i386 is not optimal but\nacceptable :\n\nmull   0x14(%ebx)\nmov    %edx,%eax // part of the \u003e\u003e 32\nxor     %edx,%edx // useless\nmov    %eax,(%esp) // could be avoided\nmov    %edx,0x4(%esp) // useless\nmov    (%esp),%ebx\n\n[akpm@osdl.org: small cleanups]\nSigned-off-by: Eric Dumazet \u003cdada1@cosmosbay.com\u003e\nCc: Christoph Lameter \u003cclameter@sgi.com\u003e\nCc: David Miller \u003cdavem@davemloft.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    }
  ]
}
