diff mbox

x86/mm: add temporary debugging code to get_page_from_gfn_p2m()

Message ID 590B0BDB0200007800156A92@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich May 4, 2017, 9:09 a.m. UTC
See the code comment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
x86/mm: add temporary debugging code to get_page_from_gfn_p2m()

See the code comment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -480,6 +480,22 @@ struct page_info *get_page_from_gfn_p2m(
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
+#ifndef NDEBUG
+    /*
+     * Temporary debugging code, added in the hope of finding the origin
+     * of calls to get_page(..., dom_cow) as observed during osstest
+     * migration failures (see
+     * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html).
+     */
+    static unsigned long cnt, thr;
+
+    if ( d->is_dying && ++cnt > thr )
+    {
+        thr |= cnt;
+        printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn);
+        dump_execution_state();
+    }
+#endif
 
     /* Allow t or a to be NULL */
     t = t ?: &_t;

Comments

Andrew Cooper May 4, 2017, 9:39 a.m. UTC | #1
On 04/05/17 10:09, Jan Beulich wrote:
> See the code comment.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -480,6 +480,22 @@ struct page_info *get_page_from_gfn_p2m(
>      p2m_access_t _a;
>      p2m_type_t _t;
>      mfn_t mfn;
> +#ifndef NDEBUG
> +    /*
> +     * Temporary debugging code, added in the hope of finding the origin
> +     * of calls to get_page(..., dom_cow) as observed during osstest
> +     * migration failures (see
> +     * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html).
> +     */
> +    static unsigned long cnt, thr;
> +
> +    if ( d->is_dying && ++cnt > thr )
> +    {
> +        thr |= cnt;
> +        printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn);
> +        dump_execution_state();
> +    }
> +#endif
>  
>      /* Allow t or a to be NULL */
>      t = t ?: &_t;
>
>
>
Julien Grall May 4, 2017, 9:42 a.m. UTC | #2
Hi,

On 04/05/17 10:39, Andrew Cooper wrote:
> On 04/05/17 10:09, Jan Beulich wrote:
>> See the code comment.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

>
>>
>> --- a/xen/arch/x86/mm/p2m.c
>> +++ b/xen/arch/x86/mm/p2m.c
>> @@ -480,6 +480,22 @@ struct page_info *get_page_from_gfn_p2m(
>>      p2m_access_t _a;
>>      p2m_type_t _t;
>>      mfn_t mfn;
>> +#ifndef NDEBUG
>> +    /*
>> +     * Temporary debugging code, added in the hope of finding the origin
>> +     * of calls to get_page(..., dom_cow) as observed during osstest
>> +     * migration failures (see
>> +     * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html).
>> +     */
>> +    static unsigned long cnt, thr;
>> +
>> +    if ( d->is_dying && ++cnt > thr )
>> +    {
>> +        thr |= cnt;
>> +        printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn);
>> +        dump_execution_state();
>> +    }
>> +#endif
>>
>>      /* Allow t or a to be NULL */
>>      t = t ?: &_t;
>>
>>
>>
>
Jan Beulich May 4, 2017, 12:07 p.m. UTC | #3
>>> On 04.05.17 at 11:42, <julien.grall@arm.com> wrote:
> On 04/05/17 10:39, Andrew Cooper wrote:
>> On 04/05/17 10:09, Jan Beulich wrote:
>>> See the code comment.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Release-acked-by: Julien Grall <julien.grall@arm.com>

Thanks, but what about the patch this one is the follow-up to
("x86/mm: silence a pointless warning")?

Jan
Julien Grall May 4, 2017, 12:49 p.m. UTC | #4
Hi Jan,

On 04/05/17 13:07, Jan Beulich wrote:
>>>> On 04.05.17 at 11:42, <julien.grall@arm.com> wrote:
>> On 04/05/17 10:39, Andrew Cooper wrote:
>>> On 04/05/17 10:09, Jan Beulich wrote:
>>>> See the code comment.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> Release-acked-by: Julien Grall <julien.grall@arm.com>
>
> Thanks, but what about the patch this one is the follow-up to
> ("x86/mm: silence a pointless warning")?

Sorry I missed that one:

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,
George Dunlap May 8, 2017, 3 p.m. UTC | #5
On 04/05/17 10:09, Jan Beulich wrote:
> See the code comment.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: George Dunlap <george.dunlap@citrix.com>

> 
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -480,6 +480,22 @@ struct page_info *get_page_from_gfn_p2m(
>      p2m_access_t _a;
>      p2m_type_t _t;
>      mfn_t mfn;
> +#ifndef NDEBUG
> +    /*
> +     * Temporary debugging code, added in the hope of finding the origin
> +     * of calls to get_page(..., dom_cow) as observed during osstest
> +     * migration failures (see
> +     * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html).
> +     */
> +    static unsigned long cnt, thr;
> +
> +    if ( d->is_dying && ++cnt > thr )
> +    {
> +        thr |= cnt;
> +        printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn);
> +        dump_execution_state();
> +    }
> +#endif
>  
>      /* Allow t or a to be NULL */
>      t = t ?: &_t;
> 
> 
>
diff mbox

Patch

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -480,6 +480,22 @@  struct page_info *get_page_from_gfn_p2m(
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
+#ifndef NDEBUG
+    /*
+     * Temporary debugging code, added in the hope of finding the origin
+     * of calls to get_page(..., dom_cow) as observed during osstest
+     * migration failures (see
+     * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html).
+     */
+    static unsigned long cnt, thr;
+
+    if ( d->is_dying && ++cnt > thr )
+    {
+        thr |= cnt;
+        printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn);
+        dump_execution_state();
+    }
+#endif
 
     /* Allow t or a to be NULL */
     t = t ?: &_t;