[Xen-ia64-devel] Xen/IA64 Healthiness Report -Cset#10927

2006-08-04 Thread You, Yongkang
Xen/IA64 Healthiness Report

10927 doesn’t find new bugs compared with 10922

Testing Environment:

Platform: Tiger4
Processor: Itanium 2 Processor
Logic Processors number: 4
PAL version: 8.15
Service OS: RHEL4u3 IA64
VTI Guest OS: RHEL4u2  RHEL4u3
XenU Guest OS: RHEL4u2
Xen IA64 Unstable tree: 10927:3d6c1af609bf
Xen Schedule: bvt
VTI Guest Firmware MD5: 5a1260ce76dee63de2a81725a686686d

Summary Test Report:
-
  Total cases: 13
  Passed:11
  Failed: 2

Detailed test cases info:
-
One_VTI_without_vifpass
One_VTI   pass
One_XenU pass
Two_VTI_Coexist   __fail__(Note 1)
One_VTI_and_One_XenU   pass
Two_XenU_Coexist pass
One_VTI_4096M   __fail__ (Note 2)
VTI_Network   pass
XenU_Network pass
One_SMP_XenU   pass
One_SMP_VTI pass
UP_VTI_LTP   pass
VTI_Kernel_Build   pass

Notes:
-
1. Two VTI domains coexist testing failed in this changeset. After doing a lot 
of 
testing, we found this issue only happened on MT enabled platform. But we 
didn't meet such similar problem before. Please see yesterday' status for the 
detailed report.

2. Create VTI domain with 4096M memory will failed at start network. Xiantao 
has sent out fixed patch to the mailing list.

The last stable changeset:
-
10706:2db50529223e

Best Regards,
Yongkang (Kangkang) 永康

___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


[Xen-ia64-devel] Re: Why do you set xen's driver m?

2006-08-04 Thread Akio Takebe
On Fri, 2006-08-04 at 13:36 +0900, Akio Takebe wrote:
 Hi, Juan
 
 Thank you for your comments.
 I can boot domU with the following modprobe.conf.
 alias scsi_hostadapter xenblk
 
 But I have some ide errors.
 After I add extra = 'ide0=noprobe ide1=noprobe ide2=noprobe ide3=noprobe 
 ide4=noprobe' into domU's config, ide errors are not occurred.

I don't get them.  Could you post a log, and I will add that ide line to
the kernel rpm :p

Later, Juan.
Hi, Juan

The below is the boot log w/o ideX=noprobe.

[EMAIL PROTECTED] linux-2.6-xen-fedora.0802]# xm create /xen/conf/domU.conf -c
Using config file /xen/conf/domU.conf.
Started domain paravm1
Dentry cache hash table entries: 65536 (order: 5, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 4, 262144 bytes) 
Software IO TLB disabled  
Memory: 240640k/393216k available (5832k code, 152368k reserved, 4032k data, 
272k init)
McKinley Errata 9 workaround not needed; disabling it   
   
register RESCHEDULE_VECTOR (RESCHED0) to xen irq (256)
register IPI_VECTOR (IPI0) to xen irq (257)   
Percpu irq 238 is unsupported by xen!  
register VIRQ_ITC (timer0) to xen irq (258)
Security Framework v1.0.0 initialized  
SELinux:  Initializing.  
SELinux:  Starting in permissive mode
selinux_register_security:  Registering secondary module capability
Capability LSM initialized as secondary
Mount-cache hash table entries: 1024   
ACPI: Core revision 20060707
Boot processor id 0x0/0x0   
SMP mode deactivated.
Brought up 1 CPUs
Total of 1 processors activated (2236.41 BogoMIPS).
migration_cost=0   
checking if image is initramfs... it is
Freeing initrd memory: 6416kB freed
DMI not present or invalid.
grant table at e100
Grant table initialized
NET: Registered protocol family 16
ACPI: bus type pci registered 
Brought up 1 CPUs
ACPI: SCI (ACPI GSI 0) not registered
ACPI: Interpreter enabled
ACPI: Using IOSAPIC for interrupt routing
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init  
pnp: PnP ACPI: found 0 devices
xen_mem: Initialising balloon driver.
usbcore: registered new driver usbfs 
usbcore: registered new driver hub  
NET: Registered protocol family 2 
IP route cache hash table entries: 4096 (order: 1, 32768 bytes)
TCP established hash table entries: 16384 (order: 5, 524288 bytes)
TCP bind hash table entries: 8192 (order: 4, 262144 bytes)
TCP: Hash tables configured (established 16384 bind 8192) 
TCP reno registered  
perfmon: version 2.0 IRQ 238
perfmon: Itanium 2 PMU detected, 16 PMCs, 18 PMDs, 4 counters (47 bits)
PAL Information Facility v0.5  
perfmon: added sampling format default_format
perfmon_default_smpl: default_format v2.0 registered
audit: initializing netlink socket (disabled)   
audit(1154659468.196:1): initialized 
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 2048 (order 0, 16384 bytes)
SELinux:  Registering netfilter hooks  
Initializing Cryptographic API   
io scheduler noop registered  
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
ACPI Exception (acpi_processor-0681): AE_NOT_FOUND, Processor Device is not 
present [20060707]
ACPI: Getting cpuindex for acpiid 0x1   
  
ACPI Exception (acpi_processor-0681): AE_NOT_FOUND, Processor Device is not 
present [20060707]
ACPI: Getting cpuindex for acpiid 0x2   
  
EFI Time Services Driver v0.4
Linux agpgart interface v0.101 (c) Dave Jones
RAMDISK driver initialized: 16 RAM disks of 16384K size 4096 blocksize
Xen virtual console successfully installed as tty1
Event-channel device installed.   
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
hda: probing with STATUS(0xa1) instead of ALTSTATUS(0x08)  
hda: IRQ probe failed (0xfffe)   
hda: probing with STATUS(0xa1) instead of ALTSTATUS(0x08)
hda: IRQ probe failed (0xfffe)   
hda: no response (status = 0xa1), resetting drive
hda: IRQ probe failed (0xfffe)   
hdb: probing with STATUS(0xa1) instead of ALTSTATUS(0x08)
hdb: IRQ probe failed (0xfffe)   
hdb: probing with STATUS(0xa1) instead of ALTSTATUS(0x08)
hdb: IRQ probe failed (0xfffe)   
hdb: no response (status = 0xa1), resetting drive
hdb: IRQ probe failed (0xfffe)   
hdc: probing with STATUS(0xa1) instead of ALTSTATUS(0x08)
hdc: IRQ probe failed 

[Xen-ia64-devel] PATCH: unprotected perfc_defn.h

2006-08-04 Thread Tristan Gingold
Hi,

this file must not be protected against multiple include, because it is 
included severals times on purpose.

Add a comment.

Tristan.
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 90fe9eed7f98394743b5499d28d92bf8f71ffa38
# Parent  3d6c1af609bfd49fc4ee89df0923334e04558058
Do not protected against multiple include.

Signed-off-by: Tristan Gingold [EMAIL PROTECTED]

diff -r 3d6c1af609bf -r 90fe9eed7f98 xen/include/asm-ia64/perfc_defn.h
--- a/xen/include/asm-ia64/perfc_defn.h	Thu Aug 03 11:21:34 2006 -0600
+++ b/xen/include/asm-ia64/perfc_defn.h	Fri Aug 04 11:23:42 2006 +0200
@@ -1,5 +1,4 @@
-#ifndef XEN_PERFC_DEFN_H
-#define XEN_PERFC_DEFN_H
+/* This file is legitimately included multiple times. */
 
 PERFCOUNTER_CPU(dtlb_translate,		dtlb hit)
 
@@ -20,5 +19,3 @@ PERFCOUNTER_CPU(context_switch,		contex
 PERFCOUNTER_CPU(context_switch,		context switch)
 
 PERFCOUNTER_CPU(lazy_cover,		lazy cover)
-
-#endif
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

Re: [Xen-ia64-devel] PATCH: convert some stats to perfc

2006-08-04 Thread Tristan Gingold
Le Vendredi 04 Août 2006 13:35, Atsushi SAKAI a écrit :
 Hi, Tristan

  Why you add perfc(context_switch) in context_switch for IA64?
 (General sched_ctx is in __enter_scheduler)
 It seems double counting.(sched_ctx and context_switch gets the same value)
 (I want to hear your opinion.)
Oops, I will remove the ia64 counter.  I converted it blindly not noticing it 
was already present elsewhere.

Thank you for this remark.
Tristan.

___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


[Xen-ia64-devel] PATCH: convert more privop_stat to perfc.

2006-08-04 Thread Tristan Gingold
Hi,

this patch convert more privop_stat to perfc.
I hope to remove all the privop_stat as soon as all the perfc patches are 
integrated.
I also plan to write an ia64 xenperf to get a nicer output.

Tested by compiling w and w/o perfc=y.

Tristan.
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID b23585cd4e700890930f7b5b1eeeaecc00a79bcb
# Parent  6c4b7669876b707b5eccf2ad99be6681f5b52366
Convert most privop stats to perfc.

Signed-off-by: Tristan Gingold [EMAIL PROTECTED]

diff -r 6c4b7669876b -r b23585cd4e70 xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c	Fri Aug 04 11:51:09 2006 +0200
+++ b/xen/arch/ia64/asm-offsets.c	Fri Aug 04 12:14:16 2006 +0200
@@ -215,5 +215,7 @@ void foo(void)
 	BLANK();
 	DEFINE(RECOVER_TO_PAGE_FAULT_PERFC_OFS, offsetof (struct perfcounter, recover_to_page_fault));
 	DEFINE(RECOVER_TO_BREAK_FAULT_PERFC_OFS, offsetof (struct perfcounter, recover_to_break_fault));
+	DEFINE(FAST_HYPERPRIVOP_PERFC_OFS, offsetof (struct perfcounter, fast_hyperprivop));
+	DEFINE(FAST_REFLECT_PERFC_OFS, offsetof (struct perfcounter, fast_reflect));
 #endif
 }
diff -r 6c4b7669876b -r b23585cd4e70 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Fri Aug 04 11:51:09 2006 +0200
+++ b/xen/arch/ia64/xen/domain.c	Fri Aug 04 12:14:16 2006 +0200
@@ -136,7 +136,6 @@ void context_switch(struct vcpu *prev, s
 uint64_t pta;
 
 local_irq_save(spsr);
-perfc_incrc(context_switch);
 
 __ia64_save_fpu(prev-arch._thread.fph);
 __ia64_load_fpu(next-arch._thread.fph);
diff -r 6c4b7669876b -r b23585cd4e70 xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c	Fri Aug 04 11:51:09 2006 +0200
+++ b/xen/arch/ia64/xen/faults.c	Fri Aug 04 12:14:16 2006 +0200
@@ -51,8 +51,6 @@ extern IA64FAULT ia64_hypercall(struct p
 
 extern void do_ssc(unsigned long ssc, struct pt_regs *regs);
 
-#define inc_slow_reflect_count(vec) slow_reflect_count[vec8]++;
-
 // should never panic domain... if it does, stack may have been overrun
 void check_bad_nested_interruption(unsigned long isr, struct pt_regs *regs, unsigned long vector)
 {
@@ -92,7 +90,7 @@ void reflect_interruption(unsigned long 
 	v-vcpu_info-evtchn_upcall_mask = 1;
 	PSCB(v,interrupt_collection_enabled) = 0;
 
-	inc_slow_reflect_count(vector);
+	perfc_incra(slow_reflect,vector8);
 }
 
 static unsigned long pending_false_positive = 0;
@@ -247,7 +245,7 @@ void ia64_do_page_fault (unsigned long a
 		regs-cr_ipsr = (regs-cr_ipsr  ~DELIVER_PSR_CLR) | DELIVER_PSR_SET;
 		// NOTE: nested trap must NOT pass PSCB address
 		//regs-r31 = (unsigned long) PSCB(current);
-		inc_slow_reflect_count(fault);
+		perfc_incra(slow_reflect,fault8);
 		return;
 	}
 
diff -r 6c4b7669876b -r b23585cd4e70 xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S	Fri Aug 04 11:51:09 2006 +0200
+++ b/xen/arch/ia64/xen/hyperprivop.S	Fri Aug 04 12:14:16 2006 +0200
@@ -22,34 +22,39 @@
 #define _PAGE_PL_2	(27)
 
 #if 1	 // change to 0 to turn off all fast paths
-#define FAST_HYPERPRIVOPS
-#define FAST_HYPERPRIVOP_CNT
-#define FAST_REFLECT_CNT
+# define FAST_HYPERPRIVOPS
+# ifdef PERF_COUNTERS
+#  define FAST_HYPERPRIVOP_CNT
+#  define FAST_HYPERPRIVOP_PERFC(N) \
+	(perfcounters+FAST_HYPERPRIVOP_PERFC_OFS+(4*N))
+#  define FAST_REFLECT_CNT
+# endif
+	
 //#define FAST_TICK // mostly working (unat problems) but default off for now
 //#define FAST_TLB_MISS_REFLECT	// mostly working but default off for now
-#ifdef CONFIG_XEN_IA64_DOM0_VP
-#undef FAST_ITC	//XXX CONFIG_XEN_IA64_DOM0_VP
+# ifdef CONFIG_XEN_IA64_DOM0_VP
+#  undef FAST_ITC	//XXX CONFIG_XEN_IA64_DOM0_VP
 		//TODO fast_itc doesn't suport dom0 vp yet.
-#else
-//#define FAST_ITC	// to be reviewed
-#endif
-#define FAST_BREAK
-#ifndef CONFIG_XEN_IA64_DOM0_VP
-# define FAST_ACCESS_REFLECT
-#else
-# undef FAST_ACCESS_REFLECT //XXX CONFIG_XEN_IA64_DOM0_VP
+# else
+//#  define FAST_ITC	// to be reviewed
+# endif
+# define FAST_BREAK
+# ifndef CONFIG_XEN_IA64_DOM0_VP
+#  define FAST_ACCESS_REFLECT
+# else
+#  undef FAST_ACCESS_REFLECT //XXX CONFIG_XEN_IA64_DOM0_VP
 //TODO fast_access_reflect
 //doesn't support dom0 vp yet.
-#endif
-#define FAST_RFI
-#define FAST_SSM_I
-#define FAST_PTC_GA
-#undef RFI_TO_INTERRUPT // not working yet
+# endif
+# define FAST_RFI
+# define FAST_SSM_I
+# define FAST_PTC_GA
+# undef RFI_TO_INTERRUPT // not working yet
 #endif
 
 #ifdef CONFIG_SMP
-//#warning FIXME: ptc.ga instruction requires spinlock for SMP
-#undef FAST_PTC_GA
+ //#warning FIXME: ptc.ga instruction requires spinlock for SMP
+ #undef FAST_PTC_GA
 #endif
 
 // FIXME: turn off for now... but NaTs may crash Xen so re-enable soon!
@@ -237,10 +242,10 @@ ENTRY(hyper_ssm_i)
 	cmp.ne p7,p0=r21,r0
 (p7)	br.sptk.many dispatch_break_fault ;;
 #ifdef FAST_HYPERPRIVOP_CNT
-	movl r20=fast_hyperpriv_cnt+(8*HYPERPRIVOP_SSM_I);;
-	ld8 r21=[r20];;
+	movl r20=FAST_HYPERPRIVOP_PERFC(HYPERPRIVOP_SSM_I);;
+	ld4 r21=[r20];;
 	adds r21=1,r21;;
-	st8 [r20]=r21;;
+	

[Xen-ia64-devel] [PATCH 0/4] [RFC] performance tuning of vTLB flush

2006-08-04 Thread Isaku Yamahata

Hi all
These patches are for performance tuning.
They are for comment, review and evaluation.

- per vcpu vhpt
- tlb tracking
- deferred page freeing
  NEW: This patch is incomplete yet. It must be polished more.
  

thanks  

___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


[Xen-ia64-devel] [PATCH 2/4] [RFC] performance tuning:import linux hash.h

2006-08-04 Thread Isaku Yamahata

 2 / 4 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1153743932 -32400
# Node ID 2fb48626546541cf3018dd3daca68701f5094b8c
# Parent  0f52ce8492a651be6f40dfa9e74d67820f89b5ed
import linux/include/linux/hash.h.
PATCHNAME: import_linux_hash.h

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 0f52ce8492a6 -r 2fb486265465 xen/include/asm-ia64/linux/README.origin
--- a/xen/include/asm-ia64/linux/README.origin  Thu Jul 27 19:58:13 2006 +0900
+++ b/xen/include/asm-ia64/linux/README.origin  Mon Jul 24 21:25:32 2006 +0900
@@ -8,6 +8,7 @@ bitmap.h- linux/include/linux/bitmap.
 bitmap.h   - linux/include/linux/bitmap.h
 bitops.h   - linux/include/linux/bitops.h
 initrd.h   - linux/include/linux/initrd.h
+hash.h - linux/include/linux/hash.h
 jiffies.h  - linux/include/linux/jiffies.h
 kmalloc_sizes.h- linux/include/linux/kmalloc_sizes.h
 linkage.h  - linux/include/linux/linkage.h
diff -r 0f52ce8492a6 -r 2fb486265465 xen/include/asm-ia64/linux/hash.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/include/asm-ia64/linux/hash.h Mon Jul 24 21:25:32 2006 +0900
@@ -0,0 +1,58 @@
+#ifndef _LINUX_HASH_H
+#define _LINUX_HASH_H
+/* Fast hashing routine for a long.
+   (C) 2002 William Lee Irwin III, IBM */
+
+/*
+ * Knuth recommends primes in approximately golden ratio to the maximum
+ * integer representable by a machine word for multiplicative hashing.
+ * Chuck Lever verified the effectiveness of this technique:
+ * http://www.citi.umich.edu/techreports/reports/citi-tr-00-1.pdf
+ *
+ * These primes are chosen to be bit-sparse, that is operations on
+ * them can use shifts and additions instead of multiplications for
+ * machines where multiplications are slow.
+ */
+#if BITS_PER_LONG == 32
+/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
+#define GOLDEN_RATIO_PRIME 0x9e370001UL
+#elif BITS_PER_LONG == 64
+/*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
+#define GOLDEN_RATIO_PRIME 0x9e37fffc0001UL
+#else
+#error Define GOLDEN_RATIO_PRIME for your wordsize.
+#endif
+
+static inline unsigned long hash_long(unsigned long val, unsigned int bits)
+{
+   unsigned long hash = val;
+
+#if BITS_PER_LONG == 64
+   /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
+   unsigned long n = hash;
+   n = 18;
+   hash -= n;
+   n = 33;
+   hash -= n;
+   n = 3;
+   hash += n;
+   n = 3;
+   hash -= n;
+   n = 4;
+   hash += n;
+   n = 2;
+   hash += n;
+#else
+   /* On some cpus multiply is faster, on others gcc will do shifts */
+   hash *= GOLDEN_RATIO_PRIME;
+#endif
+
+   /* High bits are more random, so use them. */
+   return hash  (BITS_PER_LONG - bits);
+}
+   
+static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
+{
+   return hash_long((unsigned long)ptr, bits);
+}
+#endif /* _LINUX_HASH_H */
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

[Xen-ia64-devel] [PATCH 4/4] [RFC] performance tuning: deferred page freeing

2006-08-04 Thread Isaku Yamahata

 4 / 4 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1154348100 -32400
# Node ID 6a8e356b13c8753180c5f42ebee01468479d9d1c
# Parent  93cb627b2b773825627154d6da960a33e8d3c62e
the first proto type of deferred page freeing.
PATCHNAME: deferred_page_freeing_first_proto_type

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 93cb627b2b77 -r 6a8e356b13c8 xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mkFri Aug 04 21:04:25 2006 +0900
+++ b/xen/arch/ia64/Rules.mkMon Jul 31 21:15:00 2006 +0900
@@ -46,6 +46,9 @@ ifeq ($(xen_ia64_tlb_track),y)
 ifeq ($(xen_ia64_tlb_track),y)
 CFLAGS += -DCONFIG_XEN_IA64_TLB_TRACK
 endif
+ifeq ($(xen_ia64_deferred_free),y)
+CFLAGS += -DCONFIG_XEN_IA64_DEFERRED_FREE
+endif
 ifeq ($(no_warns),y)
 CFLAGS += -Wa,--fatal-warnings -Werror -Wno-uninitialized
 endif
diff -r 93cb627b2b77 -r 6a8e356b13c8 xen/arch/ia64/xen/Makefile
--- a/xen/arch/ia64/xen/MakefileFri Aug 04 21:04:25 2006 +0900
+++ b/xen/arch/ia64/xen/MakefileMon Jul 31 21:15:00 2006 +0900
@@ -28,3 +28,4 @@ obj-y += privop_stat.o
 
 obj-$(crash_debug) += gdbstub.o
 obj-$(xen_ia64_tlb_track) += tlb_track.o
+obj-$(xen_ia64_deferred_free) += deferred_free.o
diff -r 93cb627b2b77 -r 6a8e356b13c8 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.cFri Aug 04 21:04:25 2006 +0900
+++ b/xen/arch/ia64/xen/domain.cMon Jul 31 21:15:00 2006 +0900
@@ -446,6 +446,9 @@ struct vcpu *alloc_vcpu_struct(struct do
return NULL;
}
}
+#ifdef CONFIG_XEN_IA64_DEFERRED_FREE
+dfree_init(v, v-arch.dfree);
+#endif
 
/* Create privregs page only if not VTi. */
order = get_order_from_shift(XMAPPEDREGS_SHIFT);
@@ -484,6 +487,9 @@ struct vcpu *alloc_vcpu_struct(struct do
 
 void relinquish_vcpu_resources(struct vcpu *v)
 {
+#ifdef CONFIG_XEN_IA64_DEFERRED_FREE
+dfree_relinquish(v-arch.dfree);
+#endif
 if (HAS_PERVCPU_VHPT(v-domain))
 pervcpu_vhpt_free(v);
 if (v-arch.privregs != NULL) {
diff -r 93cb627b2b77 -r 6a8e356b13c8 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.cFri Aug 04 21:04:25 2006 +0900
+++ b/xen/arch/ia64/xen/mm.cMon Jul 31 21:15:00 2006 +0900
@@ -36,7 +36,7 @@
  * 
  *   operations on this structure:
  *   - global tlb purge
- * vcpu_ptc_g(), vcpu_ptc_ga() and domain_page_flush()
+ * vcpu_ptc_g(), vcpu_ptc_ga() and domain_page_flush_and_put()
  * I.e. callers of domain_flush_vtlb_range() and domain_flush_vtlb_all()
  * These functions invalidate VHPT entry and vcpu-arch.{i, d}tlb
  * 
@@ -180,8 +180,20 @@
 #ifndef CONFIG_XEN_IA64_DOM0_VP
 #define CONFIG_DOMAIN0_CONTIGUOUS
 #else
-static void domain_page_flush(struct domain* d, unsigned long mpaddr,
-  volatile pte_t* ptep, pte_t old_pte);
+#ifdef CONFIG_XEN_IA64_DEFERRED_FREE
+static void __domain_page_flush_and_put(struct domain* d, unsigned long mpaddr,
+volatile pte_t* ptep, pte_t old_pte,
+struct page_info* page,
+int do_defer);
+#define domain_page_flush_and_put(d, mpaddr, ptep, old_pte, page)   \
+__domain_page_flush_and_put((d), (mpaddr), (ptep), (old_pte), (page), 1)
+#define domain_page_flush_and_put_nodefer(d, mpaddr, ptep, old_pte, page) \
+__domain_page_flush_and_put((d), (mpaddr), (ptep), (old_pte), (page), 0)
+#else
+static void domain_page_flush_and_put(struct domain* d, unsigned long mpaddr,
+  volatile pte_t* ptep, pte_t old_pte, 
+  struct page_info* page);
+#endif
 #endif
 
 extern unsigned long ia64_iobase;
@@ -1155,10 +1167,8 @@ assign_domain_page_replace(struct domain
 set_gpfn_from_mfn(old_mfn, INVALID_M2P_ENTRY);
 }
 
-domain_page_flush(d, mpaddr, pte, old_pte);
-
 try_to_clear_PGC_allocate(d, old_page);
-put_page(old_page);
+domain_page_flush_and_put(d, mpaddr, pte, old_pte, old_page);
 }
 }
 }
@@ -1219,8 +1229,11 @@ assign_domain_page_cmpxchg_rel(struct do
 
 set_gpfn_from_mfn(old_mfn, INVALID_M2P_ENTRY);
 
-domain_page_flush(d, mpaddr, pte, old_pte);
-put_page(old_page);
+#ifdef CONFIG_XEN_IA64_DEFERRED_FREE
+domain_page_flush_and_put_nodefer(d, mpaddr, pte, old_pte, old_page);
+#else
+domain_page_flush_and_put(d, mpaddr, pte, old_pte, old_page);
+#endif
 return 0;
 }
 
@@ -1287,12 +1300,10 @@ zap_domain_page_one(struct domain *d, un
 set_gpfn_from_mfn(mfn, INVALID_M2P_ENTRY);
 }
 
-domain_page_flush(d, mpaddr, pte, old_pte);
-
 if (page_get_owner(page) != NULL) {
 try_to_clear_PGC_allocate(d, page);
 }
-put_page(page);
+domain_page_flush_and_put(d, mpaddr, pte, old_pte, page);
 }
 
 unsigned long
@@ -1305,6 +1316,9 @@ dom0vp_zap_physmap(struct domain *d, uns
 }
 
   

[Xen-ia64-devel] [PATCH 1/4] [RFC] performance tuning:per vcpu vhpt

2006-08-04 Thread Isaku Yamahata

 1 / 4 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1154692114 -32400
# Node ID 9d437064b88315a3fba4304397677b7d3822d864
# Parent  2fb48626546541cf3018dd3daca68701f5094b8c
implement per vcpu vhpt option. allocate VHPT per vcpu.
added compile time option, xen_ia64_pervcpu_vhpt=y, to enable it.
added xen boot time option, pervcpu_vhpt=0, to disable it.
This patch depends on tlb tracking patch.
PATCHNAME: pervcpu_vhpt

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 2fb486265465 -r 9d437064b883 xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mkMon Jul 24 21:25:32 2006 +0900
+++ b/xen/arch/ia64/Rules.mkFri Aug 04 20:48:34 2006 +0900
@@ -4,6 +4,7 @@ HAS_ACPI := y
 HAS_ACPI := y
 VALIDATE_VT?= n
 xen_ia64_dom0_virtual_physical ?= y
+xen_ia64_pervcpu_vhpt  ?= y
 no_warns ?= n
 
 ifneq ($(COMPILE_ARCH),$(TARGET_ARCH))
@@ -39,6 +40,9 @@ ifeq ($(xen_ia64_dom0_virtual_physical),
 ifeq ($(xen_ia64_dom0_virtual_physical),y)
 CFLAGS += -DCONFIG_XEN_IA64_DOM0_VP
 endif
+ifeq ($(xen_ia64_pervcpu_vhpt),y)
+CFLAGS += -DCONFIG_XEN_IA64_PERVCPU_VHPT
+endif
 ifeq ($(no_warns),y)
 CFLAGS += -Wa,--fatal-warnings -Werror -Wno-uninitialized
 endif
diff -r 2fb486265465 -r 9d437064b883 xen/arch/ia64/vmx/vmx_entry.S
--- a/xen/arch/ia64/vmx/vmx_entry.S Mon Jul 24 21:25:32 2006 +0900
+++ b/xen/arch/ia64/vmx/vmx_entry.S Fri Aug 04 20:48:34 2006 +0900
@@ -669,7 +669,7 @@ 1:
 
// re-pin mappings for guest_vhpt
 
-   mov r24=IA64_TR_PERVP_VHPT
+   mov r24=IA64_TR_VHPT
movl r25=PAGE_KERNEL
;;
or loc5 = r25,loc5  // construct PA | page properties
diff -r 2fb486265465 -r 9d437064b883 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.cMon Jul 24 21:25:32 2006 +0900
+++ b/xen/arch/ia64/xen/domain.cFri Aug 04 20:48:34 2006 +0900
@@ -249,8 +249,10 @@ static void flush_vtlb_for_context_switc
if (VMX_DOMAIN(vcpu)) {
// currently vTLB for vt-i domian is per vcpu.
// so any flushing isn't needed.
+   } else if (HAS_PERVCPU_VHPT(vcpu-domain)) {
+   // nothing to do
} else {
-   vhpt_flush();
+   local_vhpt_flush();
}
local_flush_tlb_all();
}
@@ -265,9 +267,13 @@ void schedule_tail(struct vcpu *prev)
vmx_do_launch(current);
} else {
ia64_set_iva(ia64_ivt);
-   ia64_set_pta(VHPT_ADDR | (1  8) | (VHPT_SIZE_LOG2  2) |
-   VHPT_ENABLED);
+   // disable VHPT. ia64_new_rr7() might cause VHPT
+   // fault without this because it flushes dtr[IA64_TR_VHPT]
+   // (VHPT_SIZE_LOG2  2) is just for avoid
+   // Reserved Register/Field fault.
+   ia64_set_pta(VHPT_SIZE_LOG2  2);
load_region_regs(current);
+   ia64_set_pta(vcpu_pta(current));
vcpu_load_kernel_regs(current);
__ia64_per_cpu_var(current_psr_i_addr) = current-domain-
  shared_info-vcpu_info[current-vcpu_id].evtchn_upcall_mask;
@@ -318,9 +324,13 @@ if (!i--) { i = 100; printk(+); }
 
nd = current-domain;
if (!is_idle_domain(nd)) {
-   ia64_set_pta(VHPT_ADDR | (1  8) | (VHPT_SIZE_LOG2  2) |
-VHPT_ENABLED);
+   // disable VHPT. ia64_new_rr7() might cause VHPT
+   // fault without this because it changes dtr[IA64_TR_VHPT]
+   // (VHPT_SIZE_LOG2  2) is just for avoid
+   // Reserved Register/Field fault.
+   ia64_set_pta(VHPT_SIZE_LOG2  2);
load_region_regs(current);
+   ia64_set_pta(vcpu_pta(current));
vcpu_load_kernel_regs(current);
vcpu_set_next_timer(current);
if (vcpu_timer_expired(current))
@@ -422,6 +432,17 @@ struct vcpu *alloc_vcpu_struct(struct do
if (!d-arch.is_vti) {
int order;
int i;
+   DPRINTK(%s:%d allocating d 0x%p %d v 0x%p %d 
+   has_pervcpu_vhpt %d\n,
+   __func__, __LINE__, d, d-domain_id,
+   v, vcpu_id, HAS_PERVCPU_VHPT(d));
+   // vti domain has its own vhpt policy.
+   if (HAS_PERVCPU_VHPT(d)) {
+   if (pervcpu_vhpt_alloc(v)  0) {
+   free_xenheap_pages(v, KERNEL_STACK_SIZE_ORDER);
+   return NULL;
+   }
+   }
 
/* Create privregs page only if not VTi. */
order = get_order_from_shift(XMAPPEDREGS_SHIFT);
@@ -460,6 +481,8 @@ struct vcpu *alloc_vcpu_struct(struct do
 
 void relinquish_vcpu_resources(struct vcpu *v)
 {
+if (HAS_PERVCPU_VHPT(v-domain))
+pervcpu_vhpt_free(v);
 if (v-arch.privregs != NULL) {
 

[Xen-ia64-devel] Re: PATCH: unprotected perfc_defn.h

2006-08-04 Thread Alex Williamson
On Fri, 2006-08-04 at 13:14 +0200, Tristan Gingold wrote:
 Hi,
 
 this file must not be protected against multiple include, because it is 
 included severals times on purpose.
 
 Add a comment.

  Sorry Tristan, my fault for adding that.  Applied.  Thanks,

Alex

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


[Xen-ia64-devel] Re: PATCH: convert more privop_stat to perfc.

2006-08-04 Thread Alex Williamson
On Fri, 2006-08-04 at 14:06 +0200, Tristan Gingold wrote:
 Hi,
 
 this patch convert more privop_stat to perfc.
 I hope to remove all the privop_stat as soon as all the perfc patches are 
 integrated.
 I also plan to write an ia64 xenperf to get a nicer output.

   Applied.

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel


Re: [Xen-ia64-devel][PATCH] SMP Windows is up on VTI domain.

2006-08-04 Thread Alex Williamson
On Fri, 2006-08-04 at 12:50 +0800, Xu, Anthony wrote:
 This patch makes SMP Windows boot,
 Rewrite global purge to support multiple page size.

   Applied.

-- 
Alex Williamson HP Open Source  Linux Org.


___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel