)]}'
{
  "commit": "7378a744fb2dbe1b9557a85cc31c2881fc034fc3",
  "tree": "8cd504e0771ad5b492e96d621c5063d39386f0e5",
  "parents": [
    "4ebc996b5d8d64d7e24341f14434c9afb55b5322"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "edumazet@google.com",
    "time": "Wed Jan 13 08:18:19 2021 -0800"
  },
  "committer": {
    "name": "Roy Yang",
    "email": "royyang@google.com",
    "time": "Tue Feb 02 02:29:57 2021 +0000"
  },
  "message": "net: avoid 32 x truesize under-estimation for tiny skbs\n\n[ Upstream commit 3226b158e67cfaa677fd180152bfb28989cb2fac ]\n\nBoth virtio net and napi_get_frags() allocate skbs\nwith a very small skb-\u003ehead\n\nWhile using page fragments instead of a kmalloc backed skb-\u003ehead might give\na small performance improvement in some cases, there is a huge risk of\nunder estimating memory usage.\n\nFor both GOOD_COPY_LEN and GRO_MAX_HEAD, we can fit at least 32 allocations\nper page (order-3 page in x86), or even 64 on PowerPC\n\nWe have been tracking OOM issues on GKE hosts hitting tcp_mem limits\nbut consuming far more memory for TCP buffers than instructed in tcp_mem[2]\n\nEven if we force napi_alloc_skb() to only use order-0 pages, the issue\nwould still be there on arches with PAGE_SIZE \u003e\u003d 32768\n\nThis patch makes sure that small skb head are kmalloc backed, so that\nother objects in the slab page can be reused instead of being held as long\nas skbs are sitting in socket queues.\n\nNote that we might in the future use the sk_buff napi cache,\ninstead of going through a more expensive __alloc_skb()\n\nAnother idea would be to use separate page sizes depending\non the allocated length (to never have more than 4 frags per page)\n\nI would like to thank Greg Thelen for his precious help on this matter,\nanalysing crash dumps is always a time consuming task.\n\nBUG\u003db/176037804\nTEST\u003dpresubmit\nSOURCE\u003dUPSTREAM(5c466480d7d4bbf1c9eaade9201febab3adc70b0)\nRELEASE_NOTE\u003dFixed 32 x truesize under-estimation for tiny skbs\n\ncos-patch: bug\nFixes: fd11a83dd363 (\"net: Pull out core bits of __netdev_alloc_skb and add __napi_alloc_skb\")\nSigned-off-by: Eric Dumazet \u003cedumazet@google.com\u003e\nCc: Paolo Abeni \u003cpabeni@redhat.com\u003e\nCc: Greg Thelen \u003cgthelen@google.com\u003e\nReviewed-by: Alexander Duyck \u003calexanderduyck@fb.com\u003e\nAcked-by: Michael S. Tsirkin \u003cmst@redhat.com\u003e\nLink: https://lore.kernel.org/r/20210113161819.1155526-1-eric.dumazet@gmail.com\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\nChange-Id: Iac7abccfdd6fb450b06c39e62b3037bcf941713f\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/11710\nReviewed-by: Vaibhav Rustagi \u003cvaibhavrustagi@google.com\u003e\nReviewed-by: Roy Yang \u003croyyang@google.com\u003e\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a0486dcf5425b7a1ca37498ff353988bef302295",
      "old_mode": 33188,
      "old_path": "net/core/skbuff.c",
      "new_id": "b52d46b9b7554ec911f0f9f13c671812eea0b21c",
      "new_mode": 33188,
      "new_path": "net/core/skbuff.c"
    }
  ]
}
