On Thu, 2012-05-03 at 12:42 -0700, Roland Dreier wrote: > From: Steve Hodgson <steve@xxxxxxxxxxxxxxx> > > tcm_qla2xxx needs a map from 24-bit FC addresses to node ACL pointers to > look up incoming commands. Current code keeps this as a flat vmalloc()ed > array with 2^24 entries -- with 8-byte pointers, this consumes 128MB per > FC port! Occupancy of this array is at most on the order of hundreds of > entries (and even that would be a lot of initiators on an FC fabric), so > this wastes a huge amount of memory. > > Change this map to use the kernel's btree library; this reduces the memory > used to be O(number of entries) and has no measurable speed impact (in fact > since the data structure is now packed rather than sparse, the cache/TLB > effects may actually make this a net win). > > Signed-off-by: Steve Hodgson <steve@xxxxxxxxxxxxxxx> > Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx> > --- > drivers/scsi/qla2xxx/Kconfig | 1 + > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 195 ++++++++++++++++-------------------- > drivers/scsi/qla2xxx/tcm_qla2xxx.h | 22 +--- > 3 files changed, 90 insertions(+), 128 deletions(-) > I think this patch looks like a safe enough mechanical change in tcm_qla2xxx code for the benefit here, and definitely should be included for the initial 3.5 merge.. Applied to lio-core.git, and including the full series into this evenings for-next-merge re-spin. Excellent work here by Steve Hodgson to convert the FC address <-> node ACL pointer lookup logic to use the in-kernel btree library !! Thanks Roland! --nab -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html