Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-31 Thread Andrey Abramov
30.03.2019, 23:17, "George Spelvin" : > On Sat, 30 Mar 2019 at 19:38:26 +0100 greh k-h wrote; >>  On Sat, Mar 30, 2019 at 07:43:53PM +0300, Andrey Abramov wrote: >>>  Replace int type with size_t type of the size argument >>>  in the swap function, also affect all its dependencies. >> >>  This says

Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-31 Thread gre...@linuxfoundation.org
On Sun, Mar 31, 2019 at 10:00:18AM +0300, Andrey Abramov wrote: > 30.03.2019, 23:17, "George Spelvin" : > > On Sat, 30 Mar 2019 at 19:38:26 +0100 greh k-h wrote; > >>  On Sat, Mar 30, 2019 at 07:43:53PM +0300, Andrey Abramov wrote: > >>>  Replace int type with size_t type of the size argument > >>>

[PATCH v2 0/5] simple sort swap function improvements

2019-03-31 Thread Andrey Abramov
This is the logical continuation of the "lib/sort & lib/list_sort: faster and smaller" series by George Spelvin (added to linux-next recently). Since Spectre mitigations have made indirect function calls more expensive, and the previous patch series implements the default simple byte copies withou

[PATCH v2 1/5] arch/arc: unwind.c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
Replace swap_eh_frame_hdr_table_entries with built-in one, because swap_eh_frame_hdr_table_entries does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom

[PATCH v2 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
Replace relaswap with built-in one, because relaswap does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is now a waste of time as well

[PATCH v2 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one

2019-03-31 Thread Andrey Abramov
Replace dx_leaf_sort_swap, swap_refcount_rec and swap_xe functions with built-in one, because they do only a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" cus

[PATCH v2 4/5] ubifs: find.c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
Replace swap_dirty_idx function with built-in one, because swap_dirty_idx does only a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is no

[PATCH v2 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-31 Thread Andrey Abramov
Replace int type with size_t type of the size argument in the swap function, also affect all its dependencies. It's always been weird that sort() takes a size_t element size, but passes an int size to (*swap)(). Not a bug because we don't sort objects >2GB large, but it's ugly. Signed-off-by: And