linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] makedumpfile: hugepage filtering for vmcore dump
@ 2013-12-03  8:05 Atsushi Kumagai
  2013-12-03  9:05 ` HATAYAMA Daisuke
  0 siblings, 1 reply; 22+ messages in thread
From: Atsushi Kumagai @ 2013-12-03  8:05 UTC (permalink / raw)
  To: HATAYAMA Daisuke
  Cc: bhe, tom.vaden, kexec, jingbai.ma, ptesarik, linux-kernel,
	lisa.mitchell, anderson, ebiederm, vgoyal

On 2013/11/29 13:57:21, kexec <kexec-bounces@lists.infradead.org> wrote:
> (2013/11/29 13:23), Atsushi Kumagai wrote:
> > On 2013/11/29 12:24:45, kexec <kexec-bounces@lists.infradead.org> wrote:
> >> (2013/11/29 12:02), Atsushi Kumagai wrote:
> >>> On 2013/11/28 16:50:21, kexec <kexec-bounces@lists.infradead.org> wrote:
> >>>>>> ping, in case you overlooked this...
> >>>>>
> >>>>> Sorry for the delayed response, I prioritize the release of v1.5.5 now.
> >>>>>
> >>>>> Thanks for your advice, check_cyclic_buffer_overrun() should be fixed
> >>>>> as you said. In addition, I'm considering other way to address such case,
> >>>>> that is to bring the number of "overflowed pages" to the next cycle and
> >>>>> exclude them at the top of __exclude_unnecessary_pages() like below:
> >>>>>
> >>>>>                   /*
> >>>>>                    * The pages which should be excluded still remain.
> >>>>>                    */
> >>>>>                   if (remainder >= 1) {
> >>>>>                           int i;
> >>>>>                           unsigned long tmp;
> >>>>>                           for (i = 0; i < remainder; ++i) {
> >>>>>                                   if (clear_bit_on_2nd_bitmap_for_kernel(pfn + i)) {
> >>>>>                                           pfn_user++;
> >>>>>                                           tmp++;
> >>>>>                                   }
> >>>>>                           }
> >>>>>                           pfn += tmp;
> >>>>>                           remainder -= tmp;
> >>>>>                           mem_map += (tmp - 1) * SIZE(page);
> >>>>>                           continue;
> >>>>>                   }
> >>>>>
> >>>>> If this way works well, then aligning info->buf_size_cyclic will be
> >>>>> unnecessary.
> >>>>>
> >>>>
> >>>> I selected the current implementation of changing cyclic buffer size becuase
> >>>> I thought it was simpler than carrying over remaining filtered pages to next cycle
> >>>> in that there was no need to add extra code in filtering processing.
> >>>>
> >>>> I guess the reason why you think this is better now is how to detect maximum order of
> >>>> huge page is hard in some way, right?
> >>>
> >>> The maximum order will be gotten from HUGETLB_PAGE_ORDER or HPAGE_PMD_ORDER,
> >>> so I don't say it's hard. However, the carrying over method doesn't depend on
> >>> such kernel symbols, so I think it's robuster.
> >>>
> >>
> >> Then, it's better to remove check_cyclic_buffer_overrun() and rewrite part of free page
> >> filtering in __exclude_unnecessary_pages(). Could you do that too?
> >
> > Sure, I'll modify it too.
> >
>
> This is a suggestion from different point of view...
>
> In general, data on crash dump can be corrupted. Thus, order contained in a page
> descriptor can also be corrupted. For example, if the corrupted value were a huge
> number, wide range of pages after buddy page would be filtered falsely.
>
> So, actually we should sanity check data in crash dump before using them for application
> level feature. I've picked up order contained in page descriptor, so there would be other
> data used in makedumpfile that are not checked.

What you said is reasonable, but how will you do such sanity check ?
Certain standard values are necessary for sanity check, how will
you prepare such values ?
(Get them from kernel source and hard-code them in makedumpfile ?)

> Unlike diskdump, we no longer need to care about kernel/hardware level data integrity
> outside of user-land, but we still care about data its own integrity.
>
> On the other hand, if we do it, we might face some difficulty, for example, hardness of
> maintenance or performance bottleneck; it might be the reason why we don't see sanity
> check in makedumpfile now.

There are many values which should be checked, e.g. page.flags, page._count,
page.mapping, list_head.next and so on.
If we introduce sanity check for them, the issues you mentioned will be appear
distinctly.

So I think makedumpfile has to trust crash dump in practice.


Thanks
Atsushi Kumagai

> --
> Thanks.
> HATAYAMA, Daisuke
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH 0/3] makedumpfile: hugepage filtering for vmcore dump
@ 2013-11-29  3:02 Atsushi Kumagai
  2013-11-29  3:21 ` HATAYAMA Daisuke
  0 siblings, 1 reply; 22+ messages in thread
From: Atsushi Kumagai @ 2013-11-29  3:02 UTC (permalink / raw)
  To: HATAYAMA Daisuke
  Cc: bhe, tom.vaden, kexec, jingbai.ma, ptesarik, linux-kernel,
	lisa.mitchell, anderson, ebiederm, vgoyal

On 2013/11/28 16:50:21, kexec <kexec-bounces@lists.infradead.org> wrote:
> >> ping, in case you overlooked this...
> >
> > Sorry for the delayed response, I prioritize the release of v1.5.5 now.
> >
> > Thanks for your advice, check_cyclic_buffer_overrun() should be fixed
> > as you said. In addition, I'm considering other way to address such case,
> > that is to bring the number of "overflowed pages" to the next cycle and
> > exclude them at the top of __exclude_unnecessary_pages() like below:
> >
> >                 /*
> >                  * The pages which should be excluded still remain.
> >                  */
> >                 if (remainder >= 1) {
> >                         int i;
> >                         unsigned long tmp;
> >                         for (i = 0; i < remainder; ++i) {
> >                                 if (clear_bit_on_2nd_bitmap_for_kernel(pfn + i)) {
> >                                         pfn_user++;
> >                                         tmp++;
> >                                 }
> >                         }
> >                         pfn += tmp;
> >                         remainder -= tmp;
> >                         mem_map += (tmp - 1) * SIZE(page);
> >                         continue;
> >                 }
> >
> > If this way works well, then aligning info->buf_size_cyclic will be
> > unnecessary.
> >
>
> I selected the current implementation of changing cyclic buffer size becuase
> I thought it was simpler than carrying over remaining filtered pages to next cycle
> in that there was no need to add extra code in filtering processing.
>
> I guess the reason why you think this is better now is how to detect maximum order of
> huge page is hard in some way, right?

The maximum order will be gotten from HUGETLB_PAGE_ORDER or HPAGE_PMD_ORDER,
so I don't say it's hard. However, the carrying over method doesn't depend on
such kernel symbols, so I think it's robuster.


Thanks
Atsushi Kumagai

> --
> Thanks.
> HATAYAMA, Daisuke
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH 0/3] makedumpfile: hugepage filtering for vmcore dump
@ 2013-11-05 13:45 Jingbai Ma
  2013-11-05 20:26 ` Vivek Goyal
  0 siblings, 1 reply; 22+ messages in thread
From: Jingbai Ma @ 2013-11-05 13:45 UTC (permalink / raw)
  To: ptesarik, d.hatayama, kumagai-atsushi
  Cc: bhe, tom.vaden, kexec, linux-kernel, lisa.mitchell, anderson,
	ebiederm, vgoyal

This patch set intend to exclude unnecessary hugepages from vmcore dump file.

This patch requires the kernel patch to export necessary data structures into
vmcore: "kexec: export hugepage data structure into vmcoreinfo"
http://lists.infradead.org/pipermail/kexec/2013-November/009997.html

This patch introduce two new dump levels 32 and 64 to exclude all unused and
active hugepages. The level to exclude all unnecessary pages will be 127 now.

            |         cache    cache                    free    active
      Dump  |  zero   without  with     user    free    huge    huge
      Level |  page   private  private  data    page    page    page
     -------+----------------------------------------------------------
         0  |
         1  |   X
         2  |           X
         4  |           X        X
         8  |                            X
        16  |                                    X
        32  |                                            X
        64  |                                            X       X
       127  |   X       X        X       X       X       X       X

example:
To exclude all unnecessary pages:
makedumpfile -c --message-level 23 -d 127 /proc/vmcore /var/crash/kdump

To exclude all unnecessary pages but keep active hugepages:
makedumpfile -c --message-level 23 -d 63 /proc/vmcore /var/crash/kdump

---

Jingbai Ma (3):
      makedumpfile: hugepage filtering: add hugepage filtering functions
      makedumpfile: hugepage filtering: add excluding hugepage messages
      makedumpfile: hugepage filtering: add new dump levels for manual page


 makedumpfile.8 |  170 +++++++++++++++++++++++++++--------
 makedumpfile.c |  272 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 makedumpfile.h |   19 ++++
 print_info.c   |   12 +-
 print_info.h   |    2 
 5 files changed, 431 insertions(+), 44 deletions(-)

--


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

end of thread, other threads:[~2013-12-04  6:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-03  8:05 [PATCH 0/3] makedumpfile: hugepage filtering for vmcore dump Atsushi Kumagai
2013-12-03  9:05 ` HATAYAMA Daisuke
2013-12-04  6:08   ` Atsushi Kumagai
  -- strict thread matches above, loose matches on Subject: below --
2013-11-29  3:02 Atsushi Kumagai
2013-11-29  3:21 ` HATAYAMA Daisuke
2013-11-29  4:23   ` Atsushi Kumagai
2013-11-29  4:56     ` HATAYAMA Daisuke
2013-11-05 13:45 Jingbai Ma
2013-11-05 20:26 ` Vivek Goyal
2013-11-06  1:47   ` Jingbai Ma
2013-11-06  1:53     ` Vivek Goyal
2013-11-06  2:21   ` Atsushi Kumagai
2013-11-06 14:23     ` Vivek Goyal
2013-11-07  8:57       ` Jingbai Ma
2013-11-08  5:12         ` Atsushi Kumagai
2013-11-08  5:21           ` HATAYAMA Daisuke
2013-11-08  5:27             ` Jingbai Ma
2013-11-11  9:06               ` Petr Tesarik
2013-11-07  0:54     ` HATAYAMA Daisuke
2013-11-22  7:16       ` HATAYAMA Daisuke
2013-11-28  7:08         ` Atsushi Kumagai
2013-11-28  7:48           ` HATAYAMA Daisuke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).