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

From: Aruna Balakrishnaiah
Date: Thu Aug 08 2013 - 00:30:15 EST


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@xxxxxxxxxxxxxxxx
https://lists.ozlabs.org/listinfo/linuxppc-dev


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/