Bugzilla – Attachment 331975 Details for
Bug 559047
XEN system hangs with high I/O load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
debugging patch (kernel, v2)
553690.patch (text/plain), 6.40 KB, created by
Jan Beulich
on 2009-12-10 14:18:54 UTC
(
hide
)
Description:
debugging patch (kernel, v2)
Filename:
MIME Type:
Creator:
Jan Beulich
Created:
2009-12-10 14:18:54 UTC
Size:
6.40 KB
patch
obsolete
>--- 11.2-2009-11-12.orig/drivers/xen/balloon/balloon.c 2009-06-26 14:48:31.000000000 +0200 >+++ 11.2-2009-11-12/drivers/xen/balloon/balloon.c 2009-12-10 09:22:32.000000000 +0100 >@@ -623,6 +623,7 @@ static int dealloc_pte_fn( > } > #endif > >+#include <linux/kallsyms.h>//temp > struct page **alloc_empty_pages_and_pagevec(int nr_pages) > { > unsigned long flags; >@@ -630,6 +631,7 @@ struct page **alloc_empty_pages_and_page > struct page *page, **pagevec; > int i, ret; > >+print_symbol("aep&p: %s\n", _RET_IP_);//temp > pagevec = kmalloc(sizeof(page) * nr_pages, GFP_KERNEL); > if (pagevec == NULL) > return NULL; >@@ -642,6 +644,7 @@ struct page **alloc_empty_pages_and_page > v = page_address(page); > scrub_pages(v, 1); > >+printk("aep&p: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp > balloon_lock(flags); > > if (xen_feature(XENFEAT_auto_translated_physmap)) { >@@ -707,6 +710,9 @@ static void _free_empty_pages_and_pageve > if (pagevec == NULL) > return; > >+print_symbol("fep&p: %s\n", _RET_IP_);//temp >+for(i = 0; i < nr_pages; ++i)//temp >+ printk("fep&p: %lx(%lx)\n", page_to_pfn(pagevec[i]), pagevec[i]->flags);//temp > balloon_lock(flags); > for (i = 0; i < nr_pages; i++) { > BUG_ON(page_count(pagevec[i]) != 1); >@@ -736,6 +742,8 @@ void balloon_release_driver_page(struct > { > unsigned long flags; > >+print_symbol("brdp: %s\n", _RET_IP_);//temp >+printk("brdp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp > balloon_lock(flags); > balloon_append(page, 1); > bs.driver_pages--; >--- 11.2-2009-11-12.orig/drivers/xen/core/gnttab.c 2009-07-13 15:19:23.000000000 +0200 >+++ 11.2-2009-11-12/drivers/xen/core/gnttab.c 2009-12-10 09:17:05.000000000 +0100 >@@ -511,6 +511,7 @@ static int gnttab_map(unsigned int start > static void gnttab_page_free(struct page *page, unsigned int order) > { > BUG_ON(order); >+printk("gpf: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp > ClearPageForeign(page); > gnttab_reset_grant_page(page); > put_page(page); >@@ -577,6 +578,9 @@ int gnttab_copy_grant_page(grant_ref_t r > BUG_ON(unmap.status); > > write_sequnlock(&gnttab_dma_lock); >+printk("gcgp: %lx/%lx(%lx) -> %lx/%lx\n", >+ (unsigned long)pfn, (unsigned long)mfn, page->flags, >+ page_to_pfn(new_page), (unsigned long)new_mfn);//temp > > if (!xen_feature(XENFEAT_auto_translated_physmap)) { > set_phys_to_machine(page_to_pfn(new_page), INVALID_P2M_ENTRY); >--- 11.2-2009-11-12.orig/lib/swiotlb-xen.c 2009-10-20 16:44:56.000000000 +0200 >+++ 11.2-2009-11-12/lib/swiotlb-xen.c 2009-12-10 09:20:50.000000000 +0100 >@@ -450,6 +450,9 @@ do_unmap_single(struct device *hwdev, ch > int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; > phys_addr_t phys = io_tlb_orig_addr[index]; > >+for(i = 1; i < nslots; ++i) {//temp >+ BUG_ON((phys ^ io_tlb_orig_addr[index + i]) & ((1 << IO_TLB_SHIFT) - 1)); >+} > /* > * First, sync the memory before unmapping the entry > */ >@@ -543,7 +546,18 @@ dma_addr_t swiotlb_map_page(struct devic > */ > if (!address_needs_mapping(dev, dev_addr, size) && > !range_needs_mapping(phys, size)) >+{//temp >+ int f = 0; >+ for(size += offset; size > PAGE_SIZE; size -= PAGE_SIZE) { >+ ++page; >+ if(PageForeign(page)) { >+ printk("smp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp >+ ++f; >+ } >+ } >+ WARN_ON(f); > return dev_addr; >+} > > /* > * Oh well, have to allocate and map a bounce buffer. >@@ -676,6 +690,16 @@ swiotlb_map_sg_attrs(struct device *hwde > phys_addr_t paddr = page_to_pseudophys(sg_page(sg)) > + sg->offset; > >+if(dir != DMA_TO_DEVICE && sg->offset + sg->length > PAGE_SIZE) {//temp >+ u8*p = page_address(sg_page(sg)); >+ long offs = sg->offset + sg->length - 1; >+ WARN((sg->offset | sg->length) & 0x1ff, >+ "sg%d@%p[%d/%d] v=%p+%x:%x\n", dir, sgl, i, nelems, p, sg->offset, sg->length); >+ do { >+ __asm__ __volatile__("lock orb $0, %0" : : "m" (p[offs])); >+ offs -= PAGE_SIZE; >+ } while(offs >= (long)sg->offset); >+} > if (range_needs_mapping(paddr, sg->length) > || address_needs_mapping(hwdev, dev_addr, sg->length)) { > void *map; >@@ -694,7 +718,20 @@ swiotlb_map_sg_attrs(struct device *hwde > } > sg->dma_address = swiotlb_virt_to_bus(hwdev, map); > } else >+{//temp >+ int f = 0; >+ size_t size = sg->offset + sg->length; >+ struct page *page = sg_page(sg); >+ for(; size > PAGE_SIZE; size -= PAGE_SIZE) { >+ ++page; >+ if(PageForeign(page)) { >+ printk("smp: %lx(%lx)\n", page_to_pfn(page), page->flags);//temp >+ ++f; >+ } >+ } >+ WARN_ON(f); > sg->dma_address = dev_addr; >+} > sg->dma_length = sg->length; > } > return nelems; >--- 11.2-2009-11-12.orig/mm/page_alloc.c 2009-10-20 16:33:40.000000000 +0200 >+++ 11.2-2009-11-12/mm/page_alloc.c 2009-12-10 10:17:14.000000000 +0100 >@@ -256,6 +256,12 @@ static void bad_page(struct page *page) > > printk(KERN_ALERT "BUG: Bad page state in process %s pfn:%05lx\n", > current->comm, page_to_pfn(page)); >+#ifdef CONFIG_XEN//temp >+{ >+ unsigned long mfn = pfn_to_mfn(page_to_pfn(page)); >+ printk(KERN_ALERT "mfn:%lx pfn:%lx/%lx\n", mfn, mfn_to_pfn(mfn), mfn_to_local_pfn(mfn)); >+} >+#endif > printk(KERN_ALERT > "page:%p flags:%p count:%d mapcount:%d mapping:%p index:%lx\n", > page, (void *)page->flags, page_count(page), >@@ -311,6 +317,17 @@ static int destroy_compound_page(struct > int bad = 0; > > if (unlikely(compound_order(page) != order) || >+#ifdef CONFIG_XEN//temp >+({//temp >+ int f = 0, x = 0; >+ unsigned long pfn = page_to_pfn(page); >+ for(i = 0; i < nr_pages; ++i, ++pfn) { >+ f += WARN(PageForeign(page + i), "dcp: %lx(%lx)\n", pfn, page[i].flags); >+ x += (pfn != mfn_to_pfn(pfn_to_mfn(pfn)) || pfn != mfn_to_local_pfn(pfn_to_mfn(pfn))); >+ } >+ f | x; >+}) || >+#endif > unlikely(!PageHead(page))) { > bad_page(page); > bad++; >@@ -500,6 +517,13 @@ static inline int free_pages_check(struc > if (unlikely(page_mapcount(page) | > (page->mapping != NULL) | > (atomic_read(&page->_count) != 0) | >+#ifdef CONFIG_XEN//temp >+({ >+ unsigned long pfn = page_to_pfn(page); >+ unsigned long mfn = pfn_to_mfn(pfn); >+ (pfn ^ mfn_to_pfn(mfn)) | (pfn ^ mfn_to_local_pfn(mfn)); >+}) | >+#endif > (page->flags & PAGE_FLAGS_CHECK_AT_FREE))) { > bad_page(page); > return 1; >@@ -659,6 +683,13 @@ static int prep_new_page(struct page *pa > if (unlikely(page_mapcount(page) | > (page->mapping != NULL) | > (atomic_read(&page->_count) != 0) | >+#ifdef CONFIG_XEN//temp >+({ >+ unsigned long pfn = page_to_pfn(page); >+ unsigned long mfn = pfn_to_mfn(pfn); >+ (pfn ^ mfn_to_pfn(mfn)) | (pfn ^ mfn_to_local_pfn(mfn)); >+}) | >+#endif > (page->flags & PAGE_FLAGS_CHECK_AT_PREP))) { > bad_page(page); > return 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 559047
:
329906
|
329913
|
329916
|
330154
|
331234
|
331975
|
332116
|
332174
|
332189
|
332248
|
332341
|
332342
|
332343
|
332450