Re: [PATCH 1/4] stringbuf: A string buffer implementation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matthew Wilcox
Date: Friday, October 26, 2007 - 4:57 am

On Fri, Oct 26, 2007 at 12:11:01PM +1000, Rusty Russell wrote:

That's a fair point, but I'm optimising for fewer trips into the
slab(/slub/slob) allocator, and thus having less of an impact on the
rest of the system.  Given that 'an alloc on every call' was one of the
complaints Matt had about my v1 stringbuf patch, I can't imagine he'll
be happy about this one either.


Some very cute tricks in there; I particularly like passing a
double-pointer to ...printf so that the caller doesn't have to check
the return value.

Ultimately, I don't particularly care what version of stringbuf gets
merged, I just want something to make my dmesg non-ugly.  The fact that
my stringbuf implementation looked so damn similar to half a dozen things
that people had already invented elsewhere in the kernel made me think
that this was a good interface because it could be used to replace their
complex code too.

If you want to see some really complex stringbuffer-esque code that needs
replacing, take a look at pnp_info_buffer in drivers/pnp/interface.c ...

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 12:58 pm)
[PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 12:59 pm)
[PATCH 2/4] isdn: Use stringbuf, Matthew Wilcox, (Wed Oct 24, 12:59 pm)
[PATCH 3/4] sound: Use stringbuf, Matthew Wilcox, (Wed Oct 24, 12:59 pm)
[PATCH 4/4] partitions: Fix non-atomic printk, Matthew Wilcox, (Wed Oct 24, 12:59 pm)
Re: Stringbuf, v2, Joe Perches, (Wed Oct 24, 1:51 pm)
Re: Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 1:57 pm)
Re: Stringbuf, v2, Joe Perches, (Wed Oct 24, 2:06 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 2:21 pm)
Re: Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 2:34 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 8:23 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Thu Oct 25, 7:11 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Fri Oct 26, 4:57 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Sat Oct 27, 3:09 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Sat Oct 27, 5:50 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Sat Oct 27, 9:48 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Sun Oct 28, 10:38 pm)