)]}'
{
  "commit": "91ff28ae6d050e0ca01ac13eb8ba31d744cf672f",
  "tree": "6a0bd86ab9a5a9e666879032ccfc1ca712b23a56",
  "parents": [
    "4cc5373f2e749a6c96e8b9fa971931a4dd852860"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "edumazet@google.com",
    "time": "Fri Dec 19 11:20:07 2025 +0000"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sat Dec 20 14:47:12 2025 -0800"
  },
  "message": "x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()\n\nclang is generating very inefficient code for native_save_fl() which is\nused for local_irq_save() in critical spots.\n\nAllowing the \"pop %0\" to use memory:\n\n 1) forces the compiler to add annoying stack canaries when\n    CONFIG_STACKPROTECTOR_STRONG\u003dy in many places.\n\n 2) Almost always is followed by an immediate \"move memory,register\"\n\nOne good example is _raw_spin_lock_irqsave, with 8 extra instructions\n\n  ffffffff82067a30 \u003c_raw_spin_lock_irqsave\u003e:\n  ffffffff82067a30:\t\t...\n  ffffffff82067a39:\t\t53\t\t\t\t\t\tpush   %rbx\n\n  // Three instructions to ajust the stack, read the per-cpu canary\n  // and copy it to 8(%rsp)\n  ffffffff82067a3a:\t\t48 83 ec 10 \t\t\tsub    $0x10,%rsp\n  ffffffff82067a3e:\t\t65 48 8b 05 da 15 45 02 mov    %gs:0x24515da(%rip),%rax \t   # \u003c__stack_chk_guard\u003e\n  ffffffff82067a46:\t\t48 89 44 24 08\t\t\tmov    %rax,0x8(%rsp)\n\n  ffffffff82067a4b:\t\t9c\t\t\t\t\t\tpushf\n\n  // instead of pop %rbx, compiler uses 2 instructions.\n  ffffffff82067a4c:\t\t8f 04 24\t\t\t\tpop    (%rsp)\n  ffffffff82067a4f:\t\t48 8b 1c 24 \t\t\tmov    (%rsp),%rbx\n\n  ffffffff82067a53:\t\tfa\t\t\t\t\t\tcli\n  ffffffff82067a54:\t\tb9 01 00 00 00\t\t\tmov    $0x1,%ecx\n  ffffffff82067a59:\t\t31 c0\t\t\t\t\txor    %eax,%eax\n  ffffffff82067a5b:\t\tf0 0f b1 0f \t\t\tlock cmpxchg %ecx,(%rdi)\n  ffffffff82067a5f:\t\t75 1d\t\t\t\t\tjne    ffffffff82067a7e \u003c_raw_spin_lock_irqsave+0x4e\u003e\n\n  // three instructions to check the stack canary\n  ffffffff82067a61:\t\t65 48 8b 05 b7 15 45 02 mov    %gs:0x24515b7(%rip),%rax \t   # \u003c__stack_chk_guard\u003e\n  ffffffff82067a69:\t\t48 3b 44 24 08\t\t\tcmp    0x8(%rsp),%rax\n  ffffffff82067a6e:\t\t75 17\t\t\t\t\tjne    ffffffff82067a87\n\n  ...\n\n  // One extra instruction to adjust the stack.\n  ffffffff82067a73:\t\t48 83 c4 10 \t\t\tadd    $0x10,%rsp\n  ...\n\n  // One more instruction in case the stack was mangled.\n  ffffffff82067a87:\t\te8 a4 35 ff ff\t\t\tcall   ffffffff8205b030 \u003c__stack_chk_fail\u003e\n\nThis patch changes nothing for gcc, but for clang saves ~20000 bytes of text\neven though more functions are inlined.\n\n  $ size vmlinux.gcc.before vmlinux.gcc.after vmlinux.clang.before vmlinux.clang.after\n     text\t   data\t\tbss\t\tdec\t\thex\tfilename\n  45565821\t25005462\t4704800\t75276083\t47c9f33\tvmlinux.gcc.before\n  45565821\t25005462\t4704800\t75276083\t47c9f33\tvmlinux.gcc.after\n  45121072\t24638617\t5533040\t75292729\t47ce039\tvmlinux.clang.before\n  45093887\t24638633\t5536808\t75269328\t47c84d0\tvmlinux.clang.after\n\n  $ scripts/bloat-o-meter -t vmlinux.clang.before vmlinux.clang.after\n  add/remove: 1/2 grow/shrink: 21/533 up/down: 2250/-22112 (-19862)\n\nSigned-off-by: Eric Dumazet \u003cedumazet@google.com\u003e\nCc: Uros Bizjak \u003cubizjak@gmail.com\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b30e5474c18e1be63b7c69354c26ae6a6cb02731",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/irqflags.h",
      "new_id": "a1193e9d65f2000d6de88468bee58f2dae9c6cd5",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/irqflags.h"
    }
  ]
}
