Subject: Re: [PATCH 00/11] Add compression support to pstore

From: Aruna Balakrishnaiah <[email-masked]>
Date: Thu, 08 Aug 2013 09:59:34 +0530

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
> [email-masked]
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>