OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files
[PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files [message #21462] Tue, 09 October 2007 15:50 Go to previous message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Many (very many) seq files in net/ allocate some private data
to use it later (mostly for iteration state). All this code
was obviously get using copy-paste method, so move it into
one place.

Almost all of these places either set this private to 0, or
keep uninitialized. Some places, however, pre-initialize this
area, but there are few of them.

The seq_open_private() call just opens the seq file with
allocated and set to zero area. The __seq_open_private() call
makes the same, but returns the allocated memory to the called
to be initialized later.

I didn't measure how much of the .text section this saves,
but I suspect a lot of :) As far as the code is concerned,
this set saves ~450 lines.

Such thing may be useful for any subsystem, but I found this
mostly in the networking code and fixed only it (for a while).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC] [PATCH] memory controller statistics
Next Topic: [PATCH][NET-2.6.24] Remove double dev->flags checking when calling dev_close()
Goto Forum:
  


Current Time: Wed Feb 28 08:30:49 GMT 2024

Total time taken to generate the page: 0.02433 seconds