[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A5ED84D3BB3A384992CBB9C77DEDA4D443EC3AC9@USINDEM103.corp.hds.com>
Date: Thu, 12 Sep 2013 16:22:46 +0000
From: Seiji Aguchi <seiji.aguchi@....com>
To: Aruna Balakrishnaiah <aruna@...ux.vnet.ibm.com>,
"linuxppc-dev@...abs.org" <linuxppc-dev@...abs.org>,
"tony.luck@...el.com" <tony.luck@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"keescook@...omium.org" <keescook@...omium.org>
CC: "jkenisto@...ux.vnet.ibm.com" <jkenisto@...ux.vnet.ibm.com>,
"mahesh@...ux.vnet.ibm.com" <mahesh@...ux.vnet.ibm.com>,
"cbouatmailru@...il.com" <cbouatmailru@...il.com>,
"ananth@...ibm.com" <ananth@...ibm.com>,
"ccross@...roid.com" <ccross@...roid.com>
Subject: RE: [PATCH v2] pstore: Adjust buffer size for compression for
smaller registered buffers
efivars works fine with this v2 patch.
Tested-by: Seiji Aguchi <seiji.aguchi@....com>
> -----Original Message-----
> From: Aruna Balakrishnaiah [mailto:aruna@...ux.vnet.ibm.com]
> Sent: Thursday, September 12, 2013 2:51 AM
> To: linuxppc-dev@...abs.org; tony.luck@...el.com; Seiji Aguchi; linux-kernel@...r.kernel.org; keescook@...omium.org
> Cc: jkenisto@...ux.vnet.ibm.com; mahesh@...ux.vnet.ibm.com; cbouatmailru@...il.com; ananth@...ibm.com; ccross@...roid.com
> Subject: [PATCH v2] pstore: Adjust buffer size for compression for smaller registered buffers
>
> When backends (ex: efivars) have smaller registered buffers, the big_oops_buf
> is quite too big for them as number of repeated occurences in the text captured
> will be less. Patch takes care of adjusting the buffer size based on the
> registered buffer size. cmpr values has been arrived after doing experiments with
> plain text for buffers of size 1k - 4k (Smaller the buffer size repeated occurence
> will be less) and with sample crash log for buffers ranging from 4k - 10k.
>
> Reported-by: Seiji Aguchi <seiji.aguchi@....com>
> Signed-off-by: Aruna Balakrishnaiah <aruna@...ux.vnet.ibm.com>
> ---
> Changes from v1:
> Retain the cmpr = 45 for buffers ranging of size 4k - 10k. 45 seems to work.
> I added an additional headroom of 3%. Revert it back to 45.
>
> fs/pstore/platform.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 4ffb7ab..57b4219 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -195,8 +195,29 @@ error:
> static void allocate_buf_for_compression(void)
> {
> size_t size;
> + size_t cmpr;
> +
> + switch (psinfo->bufsize) {
> + /* buffer range for efivars */
> + case 1000 ... 2000:
> + cmpr = 56;
> + break;
> + case 2001 ... 3000:
> + cmpr = 54;
> + break;
> + case 3001 ... 3999:
> + cmpr = 52;
> + break;
> + /* buffer range for nvram, erst */
> + case 4000 ... 10000:
> + cmpr = 45;
> + break;
> + default:
> + cmpr = 60;
> + break;
> + }
>
> - big_oops_buf_sz = (psinfo->bufsize * 100) / 45;
> + big_oops_buf_sz = (psinfo->bufsize * 100) / cmpr;
> big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL);
> if (big_oops_buf) {
> size = max(zlib_deflate_workspacesize(WINDOW_BITS, MEM_LEVEL),
Powered by blists - more mailing lists