All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: reverse -c and -p if using snappy compression
@ 2013-08-28 22:08 Cliff Wickman
  2013-08-29  2:58 ` WANG Chao
  2013-08-30  3:34 ` Baoquan He
  0 siblings, 2 replies; 10+ messages in thread
From: Cliff Wickman @ 2013-08-28 22:08 UTC (permalink / raw)
  To: d.hatayama, kumagai-atsushi; +Cc: kexec

From: Cliff Wickman <cpw@sgi.com>

Reverse the meanings of -c (compression) and -p (snappy compression) if
USESNAPPY is defined.

The distro kdump scripts seem to only support -c for compression.
So make -c mean snappy compression if it is supported.

Diffed against makedumpfile-1.5.4
Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 makedumpfile.c |   10 ++++++++++
 print_info.c   |   13 +++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

Index: makedumpfile-1.5.4/makedumpfile.c
===================================================================
--- makedumpfile-1.5.4.orig/makedumpfile.c
+++ makedumpfile-1.5.4/makedumpfile.c
@@ -8607,7 +8607,12 @@ main(int argc, char *argv[])
 			info->name_filterconfig = optarg;
 			break;
 		case 'c':
+#ifdef USESNAPPY
+			/* if snappy is available make it the default */
+			info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
+#else
 			info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
+#endif
 			break;
 		case 'D':
 			flag_debug = TRUE;
@@ -8656,7 +8661,12 @@ main(int argc, char *argv[])
 			info->flag_dmesg = 1;
 			break;
 		case 'p':
+#ifdef USESNAPPY
+			/* is snappy is available only use zlib with -p */
+			info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
+#else
 			info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
+#endif
 			break;
 		case 'P':
 			info->xen_phys_start = strtoul(optarg, NULL, 0);
Index: makedumpfile-1.5.4/print_info.c
===================================================================
--- makedumpfile-1.5.4.orig/print_info.c
+++ makedumpfile-1.5.4/print_info.c
@@ -41,9 +41,9 @@ print_usage(void)
 #endif
 	MSG("snappy support:\n");
 #ifdef USESNAPPY
-	MSG("  enabled\n");
+	MSG("  enabled using -c\n");
 #else
-	MSG("  disabled ('-p' option will be ignored.)\n");
+	MSG("  disabled\n");
 #endif
 	MSG("\n");
 	MSG("Usage:\n");
@@ -90,8 +90,13 @@ print_usage(void)
 	MSG("\n");
 	MSG("Available options:\n");
 	MSG("  [-c|-l|-p]:\n");
-	MSG("      Compress dump data by each page using zlib for -c option, lzo for -l option\n");
-	MSG("      or snappy for -p option. A user cannot specify either of these options with\n");
+#ifdef USESNAPPY
+	MSG("      Compress dump data by each page using zlib for -p option, lzo for -l option\n");
+	MSG("      or snappy for -c option. A user cannot specify any of these options with\n");
+#else
+	MSG("      Compress dump data by each page using zlib for -c option or lzo for -l option\n");
+	MSG("      A user cannot specify either of these options with\n");
+#endif
 	MSG("      -E option, because the ELF format does not support compressed data.\n");
 	MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\n");
 	MSG("\n");

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-28 22:08 [PATCH] makedumpfile: reverse -c and -p if using snappy compression Cliff Wickman
@ 2013-08-29  2:58 ` WANG Chao
  2013-08-29 18:46   ` Cliff Wickman
  2013-08-30  3:34 ` Baoquan He
  1 sibling, 1 reply; 10+ messages in thread
From: WANG Chao @ 2013-08-29  2:58 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: kexec, d.hatayama, kumagai-atsushi

Hi, Cliff

On 08/28/13 at 05:08pm, Cliff Wickman wrote:
> From: Cliff Wickman <cpw@sgi.com>
> 
> Reverse the meanings of -c (compression) and -p (snappy compression) if
> USESNAPPY is defined.
> 
> The distro kdump scripts seem to only support -c for compression.
> So make -c mean snappy compression if it is supported.

It looks like more a distro issue to me. I'm wondering if that script
only support -c, why do that distro compile makedumpfile with USESNAPPY?

I don't think other distros would like to see this change. IMHO, the
right thing to do is fix that kdump script on that particular distro,
not reverse -c and -p.

Thanks
WANG Chao

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-29  2:58 ` WANG Chao
@ 2013-08-29 18:46   ` Cliff Wickman
  2013-08-30 10:33     ` WANG Chao
  0 siblings, 1 reply; 10+ messages in thread
From: Cliff Wickman @ 2013-08-29 18:46 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, d.hatayama, kumagai-atsushi

On Thu, Aug 29, 2013 at 10:58:37AM +0800, WANG Chao wrote:
> Hi, Cliff
> 
> On 08/28/13 at 05:08pm, Cliff Wickman wrote:
> > From: Cliff Wickman <cpw@sgi.com>
> > 
> > Reverse the meanings of -c (compression) and -p (snappy compression) if
> > USESNAPPY is defined.
> > 
> > The distro kdump scripts seem to only support -c for compression.
> > So make -c mean snappy compression if it is supported.
> 
> It looks like more a distro issue to me. I'm wondering if that script
> only support -c, why do that distro compile makedumpfile with USESNAPPY?
> 
> I don't think other distros would like to see this change. IMHO, the
> right thing to do is fix that kdump script on that particular distro,
> not reverse -c and -p.
> 
> Thanks
> WANG Chao

I agree that some distros could easily change their default compression
choice, for example -c to -p in RHEL's /etc/kdump.conf.

But on the other hand SLES11 just uses KDUMP_DUMPFORMAT="compressed"
in /etc/sysconfig/kdump.  Translation to -c occurs somewhere under the
covers.
Makedumpfile could change the default meaning of "compressed" to snappy
compression on the grounds that we know snappy to be much faster than
zlib compression.  And so we default to it if available.
You would in that way make the intelligent choice without administrative
intervention.
(You would also have to assume that crash is also be built snappy-capable
for a system that supports snappy compression.)

I could see it either way.
I find this patch a convenient way to make the choice.

-Cliff
-- 
Cliff Wickman
SGI
cpw@sgi.com
(651) 683-3824

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-28 22:08 [PATCH] makedumpfile: reverse -c and -p if using snappy compression Cliff Wickman
  2013-08-29  2:58 ` WANG Chao
@ 2013-08-30  3:34 ` Baoquan He
  2013-08-30  9:52   ` Maxim Uvarov
  1 sibling, 1 reply; 10+ messages in thread
From: Baoquan He @ 2013-08-30  3:34 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: kexec, d.hatayama, kumagai-atsushi

USESNAPPY is a switch which the snappy support has been built into.
With this flag, it means snappy compression algorithm is available.
Which compression algorithm is taken need be decided by -c/-l/-p. 

If I make a build with USELZO and USESNAPPY, then I want to test
zlib/lzo/snappy separately, then this patch will confuse me very
much. Current action and configuration are enough for me. So it's
better to leave the current action alone.

Baoquan
Thanks

On 08/28/13 at 05:08pm, Cliff Wickman wrote:
> From: Cliff Wickman <cpw@sgi.com>
> 
> Reverse the meanings of -c (compression) and -p (snappy compression) if
> USESNAPPY is defined.
> 
> The distro kdump scripts seem to only support -c for compression.
> So make -c mean snappy compression if it is supported.
> 
> Diffed against makedumpfile-1.5.4
> Signed-off-by: Cliff Wickman <cpw@sgi.com>
> ---
>  makedumpfile.c |   10 ++++++++++
>  print_info.c   |   13 +++++++++----
>  2 files changed, 19 insertions(+), 4 deletions(-)
> 
> Index: makedumpfile-1.5.4/makedumpfile.c
> ===================================================================
> --- makedumpfile-1.5.4.orig/makedumpfile.c
> +++ makedumpfile-1.5.4/makedumpfile.c
> @@ -8607,7 +8607,12 @@ main(int argc, char *argv[])
>  			info->name_filterconfig = optarg;
>  			break;
>  		case 'c':
> +#ifdef USESNAPPY
> +			/* if snappy is available make it the default */
> +			info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
> +#else
>  			info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
> +#endif
>  			break;
>  		case 'D':
>  			flag_debug = TRUE;
> @@ -8656,7 +8661,12 @@ main(int argc, char *argv[])
>  			info->flag_dmesg = 1;
>  			break;
>  		case 'p':
> +#ifdef USESNAPPY
> +			/* is snappy is available only use zlib with -p */
> +			info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
> +#else
>  			info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
> +#endif
>  			break;
>  		case 'P':
>  			info->xen_phys_start = strtoul(optarg, NULL, 0);
> Index: makedumpfile-1.5.4/print_info.c
> ===================================================================
> --- makedumpfile-1.5.4.orig/print_info.c
> +++ makedumpfile-1.5.4/print_info.c
> @@ -41,9 +41,9 @@ print_usage(void)
>  #endif
>  	MSG("snappy support:\n");
>  #ifdef USESNAPPY
> -	MSG("  enabled\n");
> +	MSG("  enabled using -c\n");
>  #else
> -	MSG("  disabled ('-p' option will be ignored.)\n");
> +	MSG("  disabled\n");
>  #endif
>  	MSG("\n");
>  	MSG("Usage:\n");
> @@ -90,8 +90,13 @@ print_usage(void)
>  	MSG("\n");
>  	MSG("Available options:\n");
>  	MSG("  [-c|-l|-p]:\n");
> -	MSG("      Compress dump data by each page using zlib for -c option, lzo for -l option\n");
> -	MSG("      or snappy for -p option. A user cannot specify either of these options with\n");
> +#ifdef USESNAPPY
> +	MSG("      Compress dump data by each page using zlib for -p option, lzo for -l option\n");
> +	MSG("      or snappy for -c option. A user cannot specify any of these options with\n");
> +#else
> +	MSG("      Compress dump data by each page using zlib for -c option or lzo for -l option\n");
> +	MSG("      A user cannot specify either of these options with\n");
> +#endif
>  	MSG("      -E option, because the ELF format does not support compressed data.\n");
>  	MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\n");
>  	MSG("\n");
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-30  3:34 ` Baoquan He
@ 2013-08-30  9:52   ` Maxim Uvarov
  2013-09-10  7:29     ` Atsushi Kumagai
  0 siblings, 1 reply; 10+ messages in thread
From: Maxim Uvarov @ 2013-08-30  9:52 UTC (permalink / raw)
  To: Baoquan He; +Cc: Atsushi Kumagai, HATAYAMA Daisuke, kexec, Cliff Wickman

I think that better is to have:

-cz zlib
-cs snappy
-cl zlo
-ca - automatic selection of compression. Snappy if compiled in, then
lzo. And if no snappy and lzo then zlib.

this will make options more readable.

Best regards.
Maxim.


2013/8/30 Baoquan He <bhe@redhat.com>:
> USESNAPPY is a switch which the snappy support has been built into.
> With this flag, it means snappy compression algorithm is available.
> Which compression algorithm is taken need be decided by -c/-l/-p.
>
> If I make a build with USELZO and USESNAPPY, then I want to test
> zlib/lzo/snappy separately, then this patch will confuse me very
> much. Current action and configuration are enough for me. So it's
> better to leave the current action alone.
>
> Baoquan
> Thanks
>
> On 08/28/13 at 05:08pm, Cliff Wickman wrote:
>> From: Cliff Wickman <cpw@sgi.com>
>>
>> Reverse the meanings of -c (compression) and -p (snappy compression) if
>> USESNAPPY is defined.
>>
>> The distro kdump scripts seem to only support -c for compression.
>> So make -c mean snappy compression if it is supported.
>>
>> Diffed against makedumpfile-1.5.4
>> Signed-off-by: Cliff Wickman <cpw@sgi.com>
>> ---
>>  makedumpfile.c |   10 ++++++++++
>>  print_info.c   |   13 +++++++++----
>>  2 files changed, 19 insertions(+), 4 deletions(-)
>>
>> Index: makedumpfile-1.5.4/makedumpfile.c
>> ===================================================================
>> --- makedumpfile-1.5.4.orig/makedumpfile.c
>> +++ makedumpfile-1.5.4/makedumpfile.c
>> @@ -8607,7 +8607,12 @@ main(int argc, char *argv[])
>>                       info->name_filterconfig = optarg;
>>                       break;
>>               case 'c':
>> +#ifdef USESNAPPY
>> +                     /* if snappy is available make it the default */
>> +                     info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>> +#else
>>                       info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>> +#endif
>>                       break;
>>               case 'D':
>>                       flag_debug = TRUE;
>> @@ -8656,7 +8661,12 @@ main(int argc, char *argv[])
>>                       info->flag_dmesg = 1;
>>                       break;
>>               case 'p':
>> +#ifdef USESNAPPY
>> +                     /* is snappy is available only use zlib with -p */
>> +                     info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>> +#else
>>                       info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>> +#endif
>>                       break;
>>               case 'P':
>>                       info->xen_phys_start = strtoul(optarg, NULL, 0);
>> Index: makedumpfile-1.5.4/print_info.c
>> ===================================================================
>> --- makedumpfile-1.5.4.orig/print_info.c
>> +++ makedumpfile-1.5.4/print_info.c
>> @@ -41,9 +41,9 @@ print_usage(void)
>>  #endif
>>       MSG("snappy support:\n");
>>  #ifdef USESNAPPY
>> -     MSG("  enabled\n");
>> +     MSG("  enabled using -c\n");
>>  #else
>> -     MSG("  disabled ('-p' option will be ignored.)\n");
>> +     MSG("  disabled\n");
>>  #endif
>>       MSG("\n");
>>       MSG("Usage:\n");
>> @@ -90,8 +90,13 @@ print_usage(void)
>>       MSG("\n");
>>       MSG("Available options:\n");
>>       MSG("  [-c|-l|-p]:\n");
>> -     MSG("      Compress dump data by each page using zlib for -c option, lzo for -l option\n");
>> -     MSG("      or snappy for -p option. A user cannot specify either of these options with\n");
>> +#ifdef USESNAPPY
>> +     MSG("      Compress dump data by each page using zlib for -p option, lzo for -l option\n");
>> +     MSG("      or snappy for -c option. A user cannot specify any of these options with\n");
>> +#else
>> +     MSG("      Compress dump data by each page using zlib for -c option or lzo for -l option\n");
>> +     MSG("      A user cannot specify either of these options with\n");
>> +#endif
>>       MSG("      -E option, because the ELF format does not support compressed data.\n");
>>       MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\n");
>>       MSG("\n");
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec



-- 
Best regards,
Maxim Uvarov

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-29 18:46   ` Cliff Wickman
@ 2013-08-30 10:33     ` WANG Chao
  2013-09-10  7:29       ` Atsushi Kumagai
  0 siblings, 1 reply; 10+ messages in thread
From: WANG Chao @ 2013-08-30 10:33 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: kexec, d.hatayama, kumagai-atsushi

On 08/29/13 at 01:46pm, Cliff Wickman wrote:
> On Thu, Aug 29, 2013 at 10:58:37AM +0800, WANG Chao wrote:
> > Hi, Cliff
> > 
> > On 08/28/13 at 05:08pm, Cliff Wickman wrote:
> > > From: Cliff Wickman <cpw@sgi.com>
> > > 
> > > Reverse the meanings of -c (compression) and -p (snappy compression) if
> > > USESNAPPY is defined.
> > > 
> > > The distro kdump scripts seem to only support -c for compression.
> > > So make -c mean snappy compression if it is supported.
> > 
> > It looks like more a distro issue to me. I'm wondering if that script
> > only support -c, why do that distro compile makedumpfile with USESNAPPY?
> > 
> > I don't think other distros would like to see this change. IMHO, the
> > right thing to do is fix that kdump script on that particular distro,
> > not reverse -c and -p.
> > 
> > Thanks
> > WANG Chao
> 
> I agree that some distros could easily change their default compression
> choice, for example -c to -p in RHEL's /etc/kdump.conf.
> 
> But on the other hand SLES11 just uses KDUMP_DUMPFORMAT="compressed"
> in /etc/sysconfig/kdump.  Translation to -c occurs somewhere under the
> covers.

Instead, it's reasonable to patch SLES11 kdump utility, not upstream.

-c means using zlib and -p means using snappy. That's already established
and has been widely used.

> Makedumpfile could change the default meaning of "compressed" to snappy
> compression on the grounds that we know snappy to be much faster than
> zlib compression.  And so we default to it if available.

IMO, makedumpfile doesn't have default compression format. c/p/l means
zlib/snappy/lzo by each. If you don't specify one of them, makedumpfile
wouldn't do compression work.

You could assume -c means default compression format, but I see it means
compress with zlib.

> You would in that way make the intelligent choice without administrative
> intervention.

The intelligent choice can be made within distro specific kdump script
rather than makedumpfile.

> (You would also have to assume that crash is also be built snappy-capable
> for a system that supports snappy compression.)
> 
> I could see it either way.
> I find this patch a convenient way to make the choice.

This patch could cause regression and break current existing kdump
scripts. I wouldn't worry much about the -c (zlib) user though.

As for the people using -p to snappy compression, after upgrading their
makedumpfile, they would get zlib format dump if their kdump conf remain
untouched.

Thanks
WANG Chao

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-30 10:33     ` WANG Chao
@ 2013-09-10  7:29       ` Atsushi Kumagai
  0 siblings, 0 replies; 10+ messages in thread
From: Atsushi Kumagai @ 2013-09-10  7:29 UTC (permalink / raw)
  To: chaowang; +Cc: d.hatayama, kexec, cpw

(2013/08/30 19:33), WANG Chao wrote:
> On 08/29/13 at 01:46pm, Cliff Wickman wrote:
>> On Thu, Aug 29, 2013 at 10:58:37AM +0800, WANG Chao wrote:
>>> Hi, Cliff
>>>
>>> On 08/28/13 at 05:08pm, Cliff Wickman wrote:
>>>> From: Cliff Wickman <cpw@sgi.com>
>>>>
>>>> Reverse the meanings of -c (compression) and -p (snappy compression) if
>>>> USESNAPPY is defined.
>>>>
>>>> The distro kdump scripts seem to only support -c for compression.
>>>> So make -c mean snappy compression if it is supported.
>>>
>>> It looks like more a distro issue to me. I'm wondering if that script
>>> only support -c, why do that distro compile makedumpfile with USESNAPPY?
>>>
>>> I don't think other distros would like to see this change. IMHO, the
>>> right thing to do is fix that kdump script on that particular distro,
>>> not reverse -c and -p.
>>>
>>> Thanks
>>> WANG Chao
>>
>> I agree that some distros could easily change their default compression
>> choice, for example -c to -p in RHEL's /etc/kdump.conf.
>>
>> But on the other hand SLES11 just uses KDUMP_DUMPFORMAT="compressed"
>> in /etc/sysconfig/kdump.  Translation to -c occurs somewhere under the
>> covers.
>
> Instead, it's reasonable to patch SLES11 kdump utility, not upstream.

Yes, it should be resolved in distro side.

> -c means using zlib and -p means using snappy. That's already established
> and has been widely used.
>
>> Makedumpfile could change the default meaning of "compressed" to snappy
>> compression on the grounds that we know snappy to be much faster than
>> zlib compression.  And so we default to it if available.
>
> IMO, makedumpfile doesn't have default compression format. c/p/l means
> zlib/snappy/lzo by each. If you don't specify one of them, makedumpfile
> wouldn't do compression work.
>
> You could assume -c means default compression format, but I see it means
> compress with zlib.

I agree to WANG. -c just means to compress with zlib.
There is no mention of default format also in the man page.

    -c,-l,-p
         Compress  dump  data  by each page using zlib for -c option, lzo
         for -l option  or  snappy  for  -p  option.   (-l  option  needs
         USELZO=on and -p option needs USESNAPPY=on when building)


Thanks
Atsushi Kumagai

>> You would in that way make the intelligent choice without administrative
>> intervention.
>
> The intelligent choice can be made within distro specific kdump script
> rather than makedumpfile.
>
>> (You would also have to assume that crash is also be built snappy-capable
>> for a system that supports snappy compression.)
>>
>> I could see it either way.
>> I find this patch a convenient way to make the choice.
>
> This patch could cause regression and break current existing kdump
> scripts. I wouldn't worry much about the -c (zlib) user though.
>
> As for the people using -p to snappy compression, after upgrading their
> makedumpfile, they would get zlib format dump if their kdump conf remain
> untouched.
>
> Thanks
> WANG Chao
>
>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-08-30  9:52   ` Maxim Uvarov
@ 2013-09-10  7:29     ` Atsushi Kumagai
  2013-09-10  8:25       ` Maxim Uvarov
  0 siblings, 1 reply; 10+ messages in thread
From: Atsushi Kumagai @ 2013-09-10  7:29 UTC (permalink / raw)
  To: muvarov; +Cc: d.hatayama, kexec, cpw, bhe

Hello Maxim,

(2013/08/30 18:52), Maxim Uvarov wrote:
> I think that better is to have:
>
> -cz zlib
> -cs snappy
> -cl zlo

They are main options for most users, so I don't want to change
them without any important reason.

> -ca - automatic selection of compression. Snappy if compiled in, then
> lzo. And if no snappy and lzo then zlib.

What is the selection standard ? Compression Speed ?
If some users prefer compression ratio to compression speed,
snappy isn't suitable for them.

Each compression format has both good points and bad points,
so each user should select the format manually based on the
purpose in any case.


Thanks
Atsushi Kumagai

> this will make options more readable.
>
> Best regards.
> Maxim.
>
>
> 2013/8/30 Baoquan He <bhe@redhat.com>:
>> USESNAPPY is a switch which the snappy support has been built into.
>> With this flag, it means snappy compression algorithm is available.
>> Which compression algorithm is taken need be decided by -c/-l/-p.
>>
>> If I make a build with USELZO and USESNAPPY, then I want to test
>> zlib/lzo/snappy separately, then this patch will confuse me very
>> much. Current action and configuration are enough for me. So it's
>> better to leave the current action alone.
>>
>> Baoquan
>> Thanks
>>
>> On 08/28/13 at 05:08pm, Cliff Wickman wrote:
>>> From: Cliff Wickman <cpw@sgi.com>
>>>
>>> Reverse the meanings of -c (compression) and -p (snappy compression) if
>>> USESNAPPY is defined.
>>>
>>> The distro kdump scripts seem to only support -c for compression.
>>> So make -c mean snappy compression if it is supported.
>>>
>>> Diffed against makedumpfile-1.5.4
>>> Signed-off-by: Cliff Wickman <cpw@sgi.com>
>>> ---
>>>   makedumpfile.c |   10 ++++++++++
>>>   print_info.c   |   13 +++++++++----
>>>   2 files changed, 19 insertions(+), 4 deletions(-)
>>>
>>> Index: makedumpfile-1.5.4/makedumpfile.c
>>> ===================================================================
>>> --- makedumpfile-1.5.4.orig/makedumpfile.c
>>> +++ makedumpfile-1.5.4/makedumpfile.c
>>> @@ -8607,7 +8607,12 @@ main(int argc, char *argv[])
>>>                        info->name_filterconfig = optarg;
>>>                        break;
>>>                case 'c':
>>> +#ifdef USESNAPPY
>>> +                     /* if snappy is available make it the default */
>>> +                     info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>>> +#else
>>>                        info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>>> +#endif
>>>                        break;
>>>                case 'D':
>>>                        flag_debug = TRUE;
>>> @@ -8656,7 +8661,12 @@ main(int argc, char *argv[])
>>>                        info->flag_dmesg = 1;
>>>                        break;
>>>                case 'p':
>>> +#ifdef USESNAPPY
>>> +                     /* is snappy is available only use zlib with -p */
>>> +                     info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>>> +#else
>>>                        info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>>> +#endif
>>>                        break;
>>>                case 'P':
>>>                        info->xen_phys_start = strtoul(optarg, NULL, 0);
>>> Index: makedumpfile-1.5.4/print_info.c
>>> ===================================================================
>>> --- makedumpfile-1.5.4.orig/print_info.c
>>> +++ makedumpfile-1.5.4/print_info.c
>>> @@ -41,9 +41,9 @@ print_usage(void)
>>>   #endif
>>>        MSG("snappy support:\n");
>>>   #ifdef USESNAPPY
>>> -     MSG("  enabled\n");
>>> +     MSG("  enabled using -c\n");
>>>   #else
>>> -     MSG("  disabled ('-p' option will be ignored.)\n");
>>> +     MSG("  disabled\n");
>>>   #endif
>>>        MSG("\n");
>>>        MSG("Usage:\n");
>>> @@ -90,8 +90,13 @@ print_usage(void)
>>>        MSG("\n");
>>>        MSG("Available options:\n");
>>>        MSG("  [-c|-l|-p]:\n");
>>> -     MSG("      Compress dump data by each page using zlib for -c option, lzo for -l option\n");
>>> -     MSG("      or snappy for -p option. A user cannot specify either of these options with\n");
>>> +#ifdef USESNAPPY
>>> +     MSG("      Compress dump data by each page using zlib for -p option, lzo for -l option\n");
>>> +     MSG("      or snappy for -c option. A user cannot specify any of these options with\n");
>>> +#else
>>> +     MSG("      Compress dump data by each page using zlib for -c option or lzo for -l option\n");
>>> +     MSG("      A user cannot specify either of these options with\n");
>>> +#endif
>>>        MSG("      -E option, because the ELF format does not support compressed data.\n");
>>>        MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\n");
>>>        MSG("\n");
>>>
>>> _______________________________________________
>>> kexec mailing list
>>> kexec@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/kexec
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
>
>
>


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-09-10  7:29     ` Atsushi Kumagai
@ 2013-09-10  8:25       ` Maxim Uvarov
  2013-09-10  9:57         ` HATAYAMA Daisuke
  0 siblings, 1 reply; 10+ messages in thread
From: Maxim Uvarov @ 2013-09-10  8:25 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: HATAYAMA Daisuke, kexec, Cliff Wickman, Baoquan He

2013/9/10 Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>:
> Hello Maxim,
>
>
> (2013/08/30 18:52), Maxim Uvarov wrote:
>>
>> I think that better is to have:
>>
>> -cz zlib
>> -cs snappy
>> -cl zlo
>
>
> They are main options for most users, so I don't want to change
> them without any important reason.
>
>
>> -ca - automatic selection of compression. Snappy if compiled in, then
>> lzo. And if no snappy and lzo then zlib.
>
>
> What is the selection standard ? Compression Speed ?
> If some users prefer compression ratio to compression speed,
> snappy isn't suitable for them.
>
> Each compression format has both good points and bad points,
> so

>each user should select the format manually based on the
> purpose in any case.
>

That definitely does not work in real life. Nobody wants to set up
something, read manual and understand all options.  More than that -
if  you somehow updated configs and set up wrong option you will not
receive any dump instead of receiving dump with different compression.

BR,
Maxim.
>
> Thanks
> Atsushi Kumagai
>
>
>> this will make options more readable.
>>
>> Best regards.
>> Maxim.
>>
>>
>> 2013/8/30 Baoquan He <bhe@redhat.com>:
>>>
>>> USESNAPPY is a switch which the snappy support has been built into.
>>> With this flag, it means snappy compression algorithm is available.
>>> Which compression algorithm is taken need be decided by -c/-l/-p.
>>>
>>> If I make a build with USELZO and USESNAPPY, then I want to test
>>> zlib/lzo/snappy separately, then this patch will confuse me very
>>> much. Current action and configuration are enough for me. So it's
>>> better to leave the current action alone.
>>>
>>> Baoquan
>>> Thanks
>>>
>>> On 08/28/13 at 05:08pm, Cliff Wickman wrote:
>>>>
>>>> From: Cliff Wickman <cpw@sgi.com>
>>>>
>>>> Reverse the meanings of -c (compression) and -p (snappy compression) if
>>>> USESNAPPY is defined.
>>>>
>>>> The distro kdump scripts seem to only support -c for compression.
>>>> So make -c mean snappy compression if it is supported.
>>>>
>>>> Diffed against makedumpfile-1.5.4
>>>> Signed-off-by: Cliff Wickman <cpw@sgi.com>
>>>> ---
>>>>   makedumpfile.c |   10 ++++++++++
>>>>   print_info.c   |   13 +++++++++----
>>>>   2 files changed, 19 insertions(+), 4 deletions(-)
>>>>
>>>> Index: makedumpfile-1.5.4/makedumpfile.c
>>>> ===================================================================
>>>> --- makedumpfile-1.5.4.orig/makedumpfile.c
>>>> +++ makedumpfile-1.5.4/makedumpfile.c
>>>> @@ -8607,7 +8607,12 @@ main(int argc, char *argv[])
>>>>                        info->name_filterconfig = optarg;
>>>>                        break;
>>>>                case 'c':
>>>> +#ifdef USESNAPPY
>>>> +                     /* if snappy is available make it the default */
>>>> +                     info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>>>> +#else
>>>>                        info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>>>> +#endif
>>>>                        break;
>>>>                case 'D':
>>>>                        flag_debug = TRUE;
>>>> @@ -8656,7 +8661,12 @@ main(int argc, char *argv[])
>>>>                        info->flag_dmesg = 1;
>>>>                        break;
>>>>                case 'p':
>>>> +#ifdef USESNAPPY
>>>> +                     /* is snappy is available only use zlib with -p */
>>>> +                     info->flag_compress = DUMP_DH_COMPRESSED_ZLIB;
>>>> +#else
>>>>                        info->flag_compress = DUMP_DH_COMPRESSED_SNAPPY;
>>>> +#endif
>>>>                        break;
>>>>                case 'P':
>>>>                        info->xen_phys_start = strtoul(optarg, NULL, 0);
>>>> Index: makedumpfile-1.5.4/print_info.c
>>>> ===================================================================
>>>> --- makedumpfile-1.5.4.orig/print_info.c
>>>> +++ makedumpfile-1.5.4/print_info.c
>>>> @@ -41,9 +41,9 @@ print_usage(void)
>>>>   #endif
>>>>        MSG("snappy support:\n");
>>>>   #ifdef USESNAPPY
>>>> -     MSG("  enabled\n");
>>>> +     MSG("  enabled using -c\n");
>>>>   #else
>>>> -     MSG("  disabled ('-p' option will be ignored.)\n");
>>>> +     MSG("  disabled\n");
>>>>   #endif
>>>>        MSG("\n");
>>>>        MSG("Usage:\n");
>>>> @@ -90,8 +90,13 @@ print_usage(void)
>>>>        MSG("\n");
>>>>        MSG("Available options:\n");
>>>>        MSG("  [-c|-l|-p]:\n");
>>>> -     MSG("      Compress dump data by each page using zlib for -c
>>>> option, lzo for -l option\n");
>>>> -     MSG("      or snappy for -p option. A user cannot specify either
>>>> of these options with\n");
>>>> +#ifdef USESNAPPY
>>>> +     MSG("      Compress dump data by each page using zlib for -p
>>>> option, lzo for -l option\n");
>>>> +     MSG("      or snappy for -c option. A user cannot specify any of
>>>> these options with\n");
>>>> +#else
>>>> +     MSG("      Compress dump data by each page using zlib for -c
>>>> option or lzo for -l option\n");
>>>> +     MSG("      A user cannot specify either of these options with\n");
>>>> +#endif
>>>>        MSG("      -E option, because the ELF format does not support
>>>> compressed data.\n");
>>>>        MSG("      THIS IS ONLY FOR THE CRASH UTILITY.\n");
>>>>        MSG("\n");
>>>>
>>>> _______________________________________________
>>>> kexec mailing list
>>>> kexec@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/kexec
>>>
>>>
>>> _______________________________________________
>>> kexec mailing list
>>> kexec@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/kexec
>>
>>
>>
>>
>



-- 
Best regards,
Maxim Uvarov

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] makedumpfile: reverse -c and -p if using snappy compression
  2013-09-10  8:25       ` Maxim Uvarov
@ 2013-09-10  9:57         ` HATAYAMA Daisuke
  0 siblings, 0 replies; 10+ messages in thread
From: HATAYAMA Daisuke @ 2013-09-10  9:57 UTC (permalink / raw)
  To: Maxim Uvarov; +Cc: kexec, Atsushi Kumagai, Cliff Wickman, Baoquan He

(2013/09/10 17:25), Maxim Uvarov wrote:
> 2013/9/10 Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>:
>> Hello Maxim,
>>
>>
>> (2013/08/30 18:52), Maxim Uvarov wrote:
>>>
>>> I think that better is to have:
>>>
>>> -cz zlib
>>> -cs snappy
>>> -cl zlo
>>
>>
>> They are main options for most users, so I don't want to change
>> them without any important reason.
>>
>>
>>> -ca - automatic selection of compression. Snappy if compiled in, then
>>> lzo. And if no snappy and lzo then zlib.
>>
>>
>> What is the selection standard ? Compression Speed ?
>> If some users prefer compression ratio to compression speed,
>> snappy isn't suitable for them.
>>
>> Each compression format has both good points and bad points,
>> so
>
>> each user should select the format manually based on the
>> purpose in any case.
>>
>
> That definitely does not work in real life. Nobody wants to set up
> something, read manual and understand all options.  More than that -
> if  you somehow updated configs and set up wrong option you will not
> receive any dump instead of receiving dump with different compression.
>
> BR,
> Maxim.

It's extreme logic. System administrator should configurate own system
with sufficient understanding, in particular on large mission critical
system. If he failed to get any dump due to wrong configuration,
it's his fault. For most systems with typical memory size, zlib still
works enough.

Also, snappy is not always better than lzo. For example, although lzo 2.0.3
is slower than snappy, lzo 2.0.6 is almost as quick as snappy, since recent
lzo is optimized enough for x86 use. Then, some distribution has lzo 2.0.3
while another lzo 2.0.6. Hence, in general, the quickest compression varies
on each systems. It's difficult for makedumpfile to choose quickest one
in general. Futhermore, makedumpfile might support more formats in the future,
the difficulty would get bigger. I don't think automation is good idea.

-- 
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-09-10  9:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28 22:08 [PATCH] makedumpfile: reverse -c and -p if using snappy compression Cliff Wickman
2013-08-29  2:58 ` WANG Chao
2013-08-29 18:46   ` Cliff Wickman
2013-08-30 10:33     ` WANG Chao
2013-09-10  7:29       ` Atsushi Kumagai
2013-08-30  3:34 ` Baoquan He
2013-08-30  9:52   ` Maxim Uvarov
2013-09-10  7:29     ` Atsushi Kumagai
2013-09-10  8:25       ` Maxim Uvarov
2013-09-10  9:57         ` HATAYAMA Daisuke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.