Re: [PATCH] Support single byte reads from integers published inprocfs by kernel/sysctl.c

From: Earl Chew
Date: Mon Jan 23 2012 - 11:48:21 EST


On 23/01/2012 8:35 AM, Eric W. Biederman wrote:
> read X < file seems like a reasonable case to support.
> Bash doesn't have that problem so presumably BusyBox is simply
> inefficient.

I think you are correct. In BusyBox, I believe there is a conscious
design decision to favour minimum size over maximum speed where it makes sense.

> If you are interested in fixing this properly with a tiny buffer
> reachable from struct file I think this can be worth fixing. I think
> this is doable by using seq_file in proc_sys_read.

I did think about using seq_file, but my initial thoughts were that it
would end up being a much bigger change and I was reluctant to take that
on without some indication that it would be a more acceptable approach.

> Rereading different bytes of the integer multiple times when the integer
> may be changing does not seem like a reasonable implementation.

Yes. I agree with you. I shall re-work the patch as per your suggestion.

Earl

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/