Having found the sg_alloc_table_from_pages_segment function is in the scatterlist.c source file, on looking at the blame for the source file found was last modified by commit 90e7a6d which shows in the tags:
v6.14-rc5 ... v5.15-rc1
Looking at Elixir Cross Referencer:
- v5.14.21/source/lib/scatterlist.c doesn't have
sg_alloc_table_from_pages_segment. - v5.15-rc1/source/lib/scatterlist.c does have
sg_alloc_table_from_pages_segment.
This confirms that mainline Kernel v5.15-rc1 was the first to introduce the function.
Looking at an AlmaLinux 8.10 installation with the Kernel source installed, can see the sg_alloc_table_from_pages_segment has been backported to the RHEL based linux-4.18.0-553.33.1.el8_10.x86_64 Kernel.