Re: 答复: [External Mail]Re: zram decompress support for gcore/crash-utility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> Hi,Dave
> 
> As per your suggestion, I updated the patch,and compiled successfully on
> arm64, x86,ppc64 architecture
> 

The patch does compile cleanly, although I haven't tried compiling it on an s390x, but
I'll do that soon.

A couple issues with the patch:

  +               if (!strncmp(name, "lzo", strlen("lzo"))) {
  +                       lzo_init();
  +                       decompressor = (void *)lzo1x_decompress_safe;
  +               } else {//todo,support more compressor
  +                       error(WARNING, "Only support lzo compressor\n");
  +                       return 0;
  +               }

lzo_init() will have already been called by is_diskdump() here during session
initialization if the dumpfile is a compressed kdump:

  #ifdef LZO
          if (lzo_init() == LZO_E_OK)
                  dd->flags |= LZO_SUPPORTED;
  #endif

So try_zram_decompress() should check if (dd->flags & LZO_SUPPORTED) has been set before
calling lzo_init() again.

And while I don't object to exporting swap_info_init(), I do have a problem with pfn_to_map():

  +void swap_info_init(void);
  +ulong pfn_to_map(ulong);

  ...

  +       obj >>= OBJ_TAG_BITS;
  +       page = pfn_to_map(obj >> OBJ_INDEX_BITS);
  +       obj_idx = (obj & OBJ_INDEX_MASK);

The pfn_to_map() function is only relevant if the kernel is configured with SPARSEMEM.
I don't see why the exported phys_to_page() function could not be used here?

Thanks,
  Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux