)]}'
{
  "commit": "b178bb3dfc30d9555bdd2401e95af98e23e83e10",
  "tree": "ec52d739015de589ceca1d31c5802305d94c9f6d",
  "parents": [
    "c31504dc0d1dc853dcee509d9999169a9097a717"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "eric.dumazet@gmail.com",
    "time": "Tue Nov 16 05:56:04 2010 +0000"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Tue Nov 16 11:17:43 2010 -0800"
  },
  "message": "net: reorder struct sock fields\n\nRight now, fields in struct sock are not optimally ordered, because each\npath (RX softirq, TX completion, RX user,  TX user) has to touch fields\nthat are contained in many different cache lines.\n\nThe really critical thing is to shrink number of cache lines that are\nused at RX softirq time : CPU handling softirqs for a device can receive\nmany frames per second for many sockets. If load is too big, we can drop\nframes at NIC level. RPS or multiqueue cards can help, but better reduce\nlatency if possible.\n\nThis patch starts with UDP protocol, then additional patches will try to\nreduce latencies of other ones as well.\n\nAt RX softirq time, fields of interest for UDP protocol are :\n(not counting ones in inet struct for the lookup)\n\nRead/Written:\nsk_refcnt   (atomic increment/decrement)\nsk_rmem_alloc \u0026 sk_backlog.len (to check if there is room in queues)\nsk_receive_queue\nsk_backlog (if socket locked by user program)\nsk_rxhash\nsk_forward_alloc\nsk_drops\n\nRead only:\nsk_rcvbuf (sk_rcvqueues_full())\nsk_filter\nsk_wq\nsk_policy[0]\nsk_flags\n\nAdditional notes :\n\n- sk_backlog has one hole on 64bit arches. We can fill it to save 8\nbytes.\n- sk_backlog is used only if RX sofirq handler finds the socket while\nlocked by user.\n- sk_rxhash is written only once per flow.\n- sk_drops is written only if queues are full\n\nFinal layout :\n\n[1] One section grouping all read/write fields, but placing rxhash and\nsk_backlog at the end of this section.\n\n[2] One section grouping all read fields in RX handler\n   (sk_filter, sk_rcv_buf, sk_wq)\n\n[3] Section used by other paths\n\nI\u0027ll post a patch on its own to put sk_refcnt at the end of struct\nsock_common so that it shares same cache line than section [1]\n\nNew offsets on 64bit arch :\n\nsizeof(struct sock)\u003d0x268\noffsetof(struct sock, sk_refcnt)  \u003d0x10\noffsetof(struct sock, sk_lock)    \u003d0x48\noffsetof(struct sock, sk_receive_queue)\u003d0x68\noffsetof(struct sock, sk_backlog)\u003d0x80\noffsetof(struct sock, sk_rmem_alloc)\u003d0x80\noffsetof(struct sock, sk_forward_alloc)\u003d0x98\noffsetof(struct sock, sk_rxhash)\u003d0x9c\noffsetof(struct sock, sk_rcvbuf)\u003d0xa4\noffsetof(struct sock, sk_drops) \u003d0xa0\noffsetof(struct sock, sk_filter)\u003d0xa8\noffsetof(struct sock, sk_wq)\u003d0xb0\noffsetof(struct sock, sk_policy)\u003d0xd0\noffsetof(struct sock, sk_flags) \u003d0xe0\n\nInstead of :\n\nsizeof(struct sock)\u003d0x270\noffsetof(struct sock, sk_refcnt)  \u003d0x10\noffsetof(struct sock, sk_lock)    \u003d0x50\noffsetof(struct sock, sk_receive_queue)\u003d0xc0\noffsetof(struct sock, sk_backlog)\u003d0x70\noffsetof(struct sock, sk_rmem_alloc)\u003d0xac\noffsetof(struct sock, sk_forward_alloc)\u003d0x10c\noffsetof(struct sock, sk_rxhash)\u003d0x128\noffsetof(struct sock, sk_rcvbuf)\u003d0x4c\noffsetof(struct sock, sk_drops) \u003d0x16c\noffsetof(struct sock, sk_filter)\u003d0x198\noffsetof(struct sock, sk_wq)\u003d0x88\noffsetof(struct sock, sk_policy)\u003d0x98\noffsetof(struct sock, sk_flags) \u003d0x130\n\nSigned-off-by: Eric Dumazet \u003ceric.dumazet@gmail.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eb0c1f5046784e8819ec8e4fccc09c7f02f92288",
      "old_mode": 33188,
      "old_path": "include/net/sock.h",
      "new_id": "5557dfb3dd68056575156009ec7220db51514627",
      "new_mode": 33188,
      "new_path": "include/net/sock.h"
    }
  ]
}
