On Wed, 17 Mar 2021, Tiezhu Yang wrote: > > > The code produced by GCC remains the same between (1), (3) and (4), > > > the last changes looks like better (with less changes based on commit > > > 198688edbf77), so I will send v3 later. > > Aren't those all the same - apart from register selection. I did a quick size check with my MIPS64 config between (1) and (2): text data bss total filename - 6129704 2997475 215280 9342459 vmlinux + 6129752 2997475 215280 9342507 vmlinux so obviously there's more to that and the code snippets quoted did not show the full picture. The size difference is in `tcp_v4_send_reset' AFAICT, maybe elsewhere as well. FAOD the former binary is as at 198688edbf77^ and the latter is as at 198688edbf77, and the command used was `size --format=gnu' to prevent `.rodata' from interfering with the text size. > > Not that I grok the mips opcodes. > > But that code has horridness on its side. It's a 32-bit one's-complement addition. The use of 64-bit operations reduces the number of calculations as any 32-bit carries accumulate in the high 32-bit word allowing one instruction to be saved total compared to the 32-bit variant. Nothing particularly unusual for me here; I've seen worse stuff with x86. > Is this patch necessary? If no, we can ignore it. > If yes, I will send v3 with the above (4) changes. I have also verified this patch directly on top of 198688edbf77 and it does not bring the old `vmlinux' size back (there's no difference in code produced at all here actually), so you need to investigate this further. This is with an older checkout of GCC 11. I've attached a stripped version of my .config that you can use for reference. Maciej