WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]Fix Trace Buffer Allocation Error

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH]Fix Trace Buffer Allocation Error
From: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>
Date: Tue, 23 May 2006 13:52:35 +0900
Delivery-date: Mon, 22 May 2006 21:53:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, All.

 This is a Patch for Trace Buffer allocation Error.
Currently, Trace Buffer Management uses two variables
(opt_tbuf_size & tb_init_done)

Variable "opt_tbuf_size" is  setting a tbuf_size and keeps the tbuf_size.
Variable "tb_init_done" is a flag to do trace buffer process.
This flag is set by tb_control() DOM0_TBUF_ENABLE with the condition of 
opt_tbuf_size > 0.

The trace buffer(tbuf_size) is allocated by is alloc_trace_bufs().
This function used by two functions(tb_set_size() and init_trace_bufs())
In tb_set_size(), the alloc_trace_bufs() failure is cared collectly by setting 
opt_tbuf_size=0.
But in init_trace_bufs(), the alloc_trace_bufs() failure is not cared collectry
(KEEP opt_tbuf_size = n ).
(init_trace_bufs() calls at x86/setup.c & ia64/xensetup.c)


This problem occured in following steps.
1)tbuf_size = n in xen boot option
2)tbuf_size is too large and memory allocation fails.
3)tbctl 1(TraceBuffer Enable tb_init_done set to 1.)
  (because opt_tbuf_size keeps n)
  (tbctl calls tb_control DOM0_TBUF_ENABLE)
  Current xen-unstable(CS10068), tbctl function is moved to get_tbuf(in 
xentrace & xenbaked)
  So 3) and 4) are occured at once.
  But Current xen-ia64-unstable(CS10029) still remain tbctl.

4)tracebuffer collection process start working
 (But trace buffer is not allocated)
5)tracebuffer collection process halted
  because no trace buffers,

To avoid this problem I changed the location of error collection code
opt_tbuf_size = 0;
from tb_set_size() to alloc_trace_bufs().
Because 1)allocation error is occured in alloc_trace_bufs() 
and     2)init_trace_bufs() mis-allocation is also cared.

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>



Hi, All.

 This is a Patch for Trace Buffer allocation Error.
Currently, Trace Buffer Management users two variables
(opt_tbuf_size & tb_init_done)
Variable "opt_tbuf_size" is setting tbuf_size and keeps tbuf_size.

Variable "tb_init_done" is a flag to doing trace buffer process.
This flag is set by tb_control() DOM0_TBUF_ENABLE with opt_tbuf_size > 0.

Setting tbuf_size in memory is alloc_trace_bufs().
In tb_set_size(), the alloc_trace_bufs() failure is cared collectly 
opt_tbuf_size=0.
But in init_trace_bufs(), the alloc_trace_bufs() failure is not cared collectry
(KEEP opt_tbuf_size = n ).
(init_trace_bufs calls at x86/setup.c & ia64/xensetup.c)


This problem occured in following steps.
1)tbuf_size = n in xen boot option
2)tbuf_size is too large and memory allocation fails.
3)tbctl 1(TraceBuffer Enable tb_init_done set to 1.)
  (because opt_tbuf_size keeps n)
  (tbctl calls tb_control DOM0_TBUF_ENABLE)
4)tracebuffer collection process start working
 (But trace buffer is not allocated)
5)tracebuffer collection process halted
  because no trace buffers,

To avoid this problem I changed the location of error collection code
opt_tbuf_size = 0;
from tb_set_size() to alloc_trace_bufs().
Because 1)allocation error is occured in alloc_trace_bufs() 
and     2)init_trace_bufs() mis-allocation is also cared.

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>