]> git.baikalelectronics.ru Git - kernel.git/commit
xen/blkfront: limit allocated memory size to actual use case
authorJuergen Gross <jgross@suse.com>
Fri, 17 Jan 2020 14:39:55 +0000 (15:39 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 30 Jan 2020 04:13:18 +0000 (21:13 -0700)
commit45b1a97cb6e49d099ab9064d2a5102a5e0ec4b08
treea27d225fd5515133506325e6dd758ebce6ad07f8
parent0d2224ee216929e4955ff0de45041c41f8d68a2a
xen/blkfront: limit allocated memory size to actual use case

Today the Xen blkfront driver allocates memory for one struct
blkfront_ring_info for each communication ring. This structure is
statically sized for the maximum supported configuration resulting
in a size of more than 90 kB.

As the main size contributor is one array inside the struct, the
memory allocation can easily be limited by moving this array to be
the last structure element and to allocate only the memory for the
actually needed array size.

Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/xen-blkfront.c