cp uses the st_blksize field of the destination to determine 'optimal' block size:
from fileutils/src/copy.c line ~ 293:
if (fstat (dest_desc, &sb))
...
buf_size = ST_BLKSIZE (sb);
set it higher by hand, and cp will get faster with your USB key (and possibly your harddrive too).
The problem is that this would fix cp, but not other apps using st_blksize to determine such things.
the ioctl used by fstat to get this is BLKBSZGET, and is handled by drivers/block/ioctl.c.
Kernel hackers say it is not possible to set a logical block size higher than page_size (which is usually 4k).
# Problème non trivial
Posté par Colin Leroy (site web personnel) . En réponse au journal Benchmarkez votre clef USB !. Évalué à 3.
cp uses the st_blksize field of the destination to determine 'optimal' block size:
from fileutils/src/copy.c line ~ 293:
if (fstat (dest_desc, &sb))
...
buf_size = ST_BLKSIZE (sb);
set it higher by hand, and cp will get faster with your USB key (and possibly your harddrive too).
The problem is that this would fix cp, but not other apps using st_blksize to determine such things.
the ioctl used by fstat to get this is BLKBSZGET, and is handled by drivers/block/ioctl.c.
Kernel hackers say it is not possible to set a logical block size higher than page_size (which is usually 4k).