The kernel has almost nothing to do with it! The problem is in the drive and the fact that writing part of a 4KiB physical sector requires reading that sector, modifying its contents, and writing it back out again. Between the read and the write, the sector will have spun out from under the read-write head, so the disk will have to rotate at least once before the write can occur. This process will inevitably take longer than writing a whole physical sector, which requires no read operation. Partition alignment matters because most filesystems include data structures that are 4KiB in size, or multiples of that amount, aligned on multiples of 4KiB relative to the start of the filesystem, which in turn is normally the start of the partition. Thus, if the partition is aligned properly, most disk reads and writes will be of 4KiB or larger amounts on physical-sector boundaries. If not, many disk reads and writes will span physical sector boundaries, resulting in the need for that extra read and delay when writing data.
The only thing the kernel has to do with it is that the kernel includes calls to return the logical and physical sector size. Unfortunately, with every Advanced Format drive I've used (admittedly only about four or five of them), either the drives lie about this detail or the kernel doesn't report it accurately. Furthermore, the partitioning software must use the data, making it
at least as important as the kernel.
That said, as a practical matter, most Linux partitioning software today uses 1MiB (2048-sector) alignment by default. (I hear that cfdisk is a fossil on this score and still uses cylinder alignment, but I've not checked it myself.) Thus, if you use modern partitioning software, you should be OK; however, it's a good idea to double-check the matter yourself by obtaining a sector-precise listing of your partitions' start points and checking that all the numbers are divisible by 8. (The extended partition, if you have one, is an exception; its alignment is irrelevant.)
BTW, I'm the author of the GPT fdisk
partitioning software, so I've studied this issue pretty closely.