)]}'
{
  "commit": "95b2f070fc4eb7b92d528f64395c5306dc993c50",
  "tree": "403f597ec694a9cc87b01cdf52dc9f7342394976",
  "parents": [
    "ca1f1fd884b7bba90a8136dd56f8918dd318b815"
  ],
  "author": {
    "name": "Mateusz Guzik",
    "email": "mjguzik@gmail.com",
    "time": "Mon May 20 09:14:07 2024 +0200"
  },
  "committer": {
    "name": "Vlastimil Babka",
    "email": "vbabka@suse.cz",
    "time": "Mon May 20 10:50:06 2024 +0200"
  },
  "message": "percpu_counter: add a cmpxchg-based _add_batch variant\n\nThis was \"percpu_counter: reimplement _add_batch with __this_cpu_cmpxchg\".\n\nI chatted with vbabka a little bit and he pointed me at mod_zone_state,\nwhich does the same thing I needed except dodges preemption -- turns out\ncmpxchg with a gs-prefixed argument is safe here.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d cut here \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nInterrupt disable/enable trips are quite expensive on x86-64 compared to\na mere cmpxchg (note: no lock prefix!) and percpu counters are used\nquite often.\n\nWith this change I get a bump of 1% ops/s for negative path lookups,\nplugged into will-it-scale:\n\nvoid testcase(unsigned long long *iterations, unsigned long nr)\n{\n        while (1) {\n                int fd \u003d open(\"/tmp/nonexistent\", O_RDONLY);\n                assert(fd \u003d\u003d -1);\n\n                (*iterations)++;\n        }\n}\n\nThe win would be higher if it was not for other slowdowns, but one has\nto start somewhere.\n\nv2:\n- dodge preemption\n- use this_cpu_try_cmpxchg\n- keep the old variant depending on CONFIG_HAVE_CMPXCHG_LOCAL\n\nSigned-off-by: Mateusz Guzik \u003cmjguzik@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "44dd133594d4d6a005321d27acbf76f9aa1d4c95",
      "old_mode": 33188,
      "old_path": "lib/percpu_counter.c",
      "new_id": "80ec2ffc981a56355f39e04873d3edebbe7e7645",
      "new_mode": 33188,
      "new_path": "lib/percpu_counter.c"
    }
  ]
}
