[PATCH 00/11] Add compression support to pstore

Aruna Balakrishnaiah aruna at linux.vnet.ibm.com
Thu Aug 8 14:29:34 EST 2013


On Wednesday 07 August 2013 11:00 PM, Tony Luck wrote:
> Oh - one more thing - and my apologies for not spotting this before:
>
>                  dst = allocate_buf_for_compression(big_buf_sz);
>
> No - you may not call kmalloc() in oops/panic context.  Please pre-allocate
> everything you need in some initialization code to make sure that we don't
> fail in the panic path because we can't get the memory we need.
>
> -Tony

Sure. I had this in mind. At the same time memory consumed for compression is 
quite high.
For the compression parameters used, workspace will be 30k and big_buf will be 17.5k
for the record size of 7896 that you have mentioned.

So total memory consumed for compression and decompression will close 47.5k.

When we preallocate, we can use the same big_buf for compression as well as 
decompression.
Also workspace will be one for both. By allocating max of inflate workspace size 
and deflate
workspace size. We can save memory here.

If pre-allocating close to 50k of buffer is not a issue. We can go ahead with 
this approach.

> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



More information about the Linuxppc-dev mailing list