[PATCH] libio: Always use _IO_BUFSIZE for stream buffers [BZ #4099]
Florian Weimer
fweimer@redhat.com
Thu May 19 15:02:00 GMT 2016
On 03/31/2016 12:14 PM, Florian Weimer wrote:
> On 03/18/2016 11:52 PM, Roland McGrath wrote:
>
>> Whatever the results, they would not IMHO be relevant here.
>>
>> POSIX specifies that st_blksize is the "preferred I/O block size for this
>> object". It's the kernel's responsibility to give userland good advice
>> through this channel. If there are common buggy kernels that give bad
>> advice, that is a reason to apply upper and lower limits to the advice from
>> the kernel. But the expectation should be that the kernel gets fixed to
>> give good advice, and the optimal thing to do with a good kernel is to
>> follow its advice.
>>
>> Since the recommended use of st_blksize in this way is a standard user
>> feature and not just what stdio's implementation happens to do, there is an
>> argument to be made that the limiting of the value should be done in the
>> *stat functions reported st_blksize values rather than in stdio's use of
>> them. (I'm ambivalent about this point.)
>
> That's a good point. I'll try to get feedback from kernel file system
> developers on this matter.
I wasn't able to get any feedback. Based on Rich's point about random
I/O and Roland's earlier suggestion, I'm just capping the reported
buffer size to 8192 in the attached patch.
Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bufsize.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160519/f66d956d/attachment.bin>
More information about the Libc-alpha
mailing list