)]}'
{
  "commit": "271b72c7fa82c2c7a795bc16896149933110672d",
  "tree": "5634b95c04b4a7ac9babf2d8ac34cfb6c38a8f83",
  "parents": [
    "645ca708f936b2fbeb79e52d7823e3eb2c0905f8"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "dada1@cosmosbay.com",
    "time": "Wed Oct 29 02:11:14 2008 -0700"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Wed Oct 29 02:11:14 2008 -0700"
  },
  "message": "udp: RCU handling for Unicast packets.\n\nGoals are :\n\n1) Optimizing handling of incoming Unicast UDP frames, so that no memory\n writes should happen in the fast path.\n\n Note: Multicasts and broadcasts still will need to take a lock,\n because doing a full lockless lookup in this case is difficult.\n\n2) No expensive operations in the socket bind/unhash phases :\n  - No expensive synchronize_rcu() calls.\n\n  - No added rcu_head in socket structure, increasing memory needs,\n  but more important, forcing us to use call_rcu() calls,\n  that have the bad property of making sockets structure cold.\n  (rcu grace period between socket freeing and its potential reuse\n   make this socket being cold in CPU cache).\n  David did a previous patch using call_rcu() and noticed a 20%\n  impact on TCP connection rates.\n  Quoting Cristopher Lameter :\n   \"Right. That results in cacheline cooldown. You\u0027d want to recycle\n    the object as they are cache hot on a per cpu basis. That is screwed\n    up by the delayed regular rcu processing. We have seen multiple\n    regressions due to cacheline cooldown.\n    The only choice in cacheline hot sensitive areas is to deal with the\n    complexity that comes with SLAB_DESTROY_BY_RCU or give up on RCU.\"\n\n  - Because udp sockets are allocated from dedicated kmem_cache,\n  use of SLAB_DESTROY_BY_RCU can help here.\n\nTheory of operation :\n---------------------\n\nAs the lookup is lockfree (using rcu_read_lock()/rcu_read_unlock()),\nspecial attention must be taken by readers and writers.\n\nUse of SLAB_DESTROY_BY_RCU is tricky too, because a socket can be freed,\nreused, inserted in a different chain or in worst case in the same chain\nwhile readers could do lookups in the same time.\n\nIn order to avoid loops, a reader must check each socket found in a chain\nreally belongs to the chain the reader was traversing. If it finds a\nmismatch, lookup must start again at the begining. This *restart* loop\nis the reason we had to use rdlock for the multicast case, because\nwe dont want to send same message several times to the same socket.\n\nWe use RCU only for fast path.\nThus, /proc/net/udp still takes spinlocks.\n\nSigned-off-by: Eric Dumazet \u003cdada1@cosmosbay.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d200dfbe1ef668d42849e5f71f9a6a795492453f",
      "old_mode": 33188,
      "old_path": "include/net/sock.h",
      "new_id": "0bea25db5471212403145fab1a88a1cd30038576",
      "new_mode": 33188,
      "new_path": "include/net/sock.h"
    },
    {
      "type": "modify",
      "old_id": "5e2a3132a8c934d5aae50f8b359ebf28c6b65d8c",
      "old_mode": 33188,
      "old_path": "net/core/sock.c",
      "new_id": "ded1eb5d2fd44664eace3f26fa745f3c2b2584a2",
      "new_mode": 33188,
      "new_path": "net/core/sock.c"
    },
    {
      "type": "modify",
      "old_id": "2a6c491f97d7950babe6e1248f3b4866ecb9a840",
      "old_mode": 33188,
      "old_path": "net/ipv4/udp.c",
      "new_id": "0ea974bf7962756035153b0543c1b69a9fc9bed1",
      "new_mode": 33188,
      "new_path": "net/ipv4/udp.c"
    },
    {
      "type": "modify",
      "old_id": "d8ea8e5f5ea326663f8a90e84a6dd6855b811fbb",
      "old_mode": 33188,
      "old_path": "net/ipv4/udplite.c",
      "new_id": "c784891cb7e57b3f037b26f858c714bfc9614a33",
      "new_mode": 33188,
      "new_path": "net/ipv4/udplite.c"
    },
    {
      "type": "modify",
      "old_id": "ccee7244ca0ffe4c7429f22e12d52e0b262db77a",
      "old_mode": 33188,
      "old_path": "net/ipv6/udp.c",
      "new_id": "1d9790e43dfcb977bc28ec22093b62b64c5f52df",
      "new_mode": 33188,
      "new_path": "net/ipv6/udp.c"
    },
    {
      "type": "modify",
      "old_id": "f1e892a99e05365861ce8a6cef879747efd7d6d7",
      "old_mode": 33188,
      "old_path": "net/ipv6/udplite.c",
      "new_id": "ba162a824585b8fcecd2c1022c0c64d09faa68bc",
      "new_mode": 33188,
      "new_path": "net/ipv6/udplite.c"
    }
  ]
}
