Skip to contentSkip to conversation

fix functional/threads/pi_test/pitest-4 test

PATCH In review Bian Naimeng 1 participant 3 messages Jan 26, 2011 – Mar 13, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix functional/threads/pi_test/pitest-4 test

TB1 has a lower priority than TFs, it has not chance to run.

---
 .../functional/threads/pi_test/pitest-4.c          |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c +9 -9
index ad940dc..93e44b6 100644
@@ -69,13 +69,13 @@ struct thread_param
 	volatile unsigned progress;
 } tp[] = {
 	{ 0,   0,   0, 1, SCHED_FIFO, "TL",  0, 0, 0, 0 },
-	{ 1,   0, 100, 3, SCHED_FIFO, "TP",  0, 0, 0, 0 },
-	{ 2,   0,   0, 4, SCHED_FIFO, "TF",  1, 0, 0, 0 },
-	{ 3,   0,   0, 4, SCHED_FIFO, "TF",  2, 0, 0, 0 },
-	{ 4,   0,   0, 4, SCHED_FIFO, "TF",  3, 0, 0, 0 },
-	{ 5,   0,   0, 4, SCHED_FIFO, "TF",  4, 0, 0, 0 },
-	{ 6,   0,   0, 4, SCHED_FIFO, "TF",  5, 0, 0, 0 },
-	{ 7,   0,   0, 4, SCHED_FIFO, "TF",  6, 0, 0, 0 }
+	{ 1,   0, 100, 4, SCHED_FIFO, "TP",  0, 0, 0, 0 },
+	{ 2,   0,   0, 2, SCHED_FIFO, "TF",  1, 0, 0, 0 },
+	{ 3,   0,   0, 2, SCHED_FIFO, "TF",  2, 0, 0, 0 },
+	{ 4,   0,   0, 2, SCHED_FIFO, "TF",  3, 0, 0, 0 },
+	{ 5,   0,   0, 2, SCHED_FIFO, "TF",  4, 0, 0, 0 },
+	{ 6,   0,   0, 2, SCHED_FIFO, "TF",  5, 0, 0, 0 },
+	{ 7,   0,   0, 2, SCHED_FIFO, "TF",  6, 0, 0, 0 }
 };
 
 volatile unsigned do_work_dummy;
@@ -180,7 +180,7 @@ void *thread_tb1(void *arg)
 	double t0, t1;
 	int rc;
 
-	test_set_priority(pthread_self(),SCHED_FIFO, 2);
+	test_set_priority(pthread_self(), SCHED_FIFO, 3);
 	DPRINTF(stderr,"Thread TB1: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB1 Started\n",
 		seconds_read() - base_time);
@@ -212,7 +212,7 @@ void *thread_tb2(void *arg)
 	double t0, t1;
 	int rc;
 
-	test_set_priority(pthread_self(),SCHED_FIFO, 5);
+	test_set_priority(pthread_self(), SCHED_FIFO, 5);
 	DPRINTF(stderr,"Thread TB2: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB2 Started\n",
 		seconds_read() - base_time);
Signature · 20 lines
1.7.0.4




-- 
Regards
Bian Naimeng


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi Garrett,

Would you like to apply this patch?

The priority of TB1 is lower than TFs, if TB1 was assigned to the CPU
which scheduling TF, TB1 will not have chance to run.
I raise the priority of TB1, the new priority of TB1 is higher than TF
and TL, and still lower than TP.
After applying the following patch, test will work correctly.

Regards
Bian

Quoted 51 lines · Bian Naimeng

TB1 has a lower priority than TFs, it has not chance to run.

---
 .../functional/threads/pi_test/pitest-4.c          |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c +9 -9
index ad940dc..93e44b6 100644
@@ -69,13 +69,13 @@ struct thread_param
 	volatile unsigned progress;
 } tp[] = {
 	{ 0,   0,   0, 1, SCHED_FIFO, "TL",  0, 0, 0, 0 },
-	{ 1,   0, 100, 3, SCHED_FIFO, "TP",  0, 0, 0, 0 },
-	{ 2,   0,   0, 4, SCHED_FIFO, "TF",  1, 0, 0, 0 },
-	{ 3,   0,   0, 4, SCHED_FIFO, "TF",  2, 0, 0, 0 },
-	{ 4,   0,   0, 4, SCHED_FIFO, "TF",  3, 0, 0, 0 },
-	{ 5,   0,   0, 4, SCHED_FIFO, "TF",  4, 0, 0, 0 },
-	{ 6,   0,   0, 4, SCHED_FIFO, "TF",  5, 0, 0, 0 },
-	{ 7,   0,   0, 4, SCHED_FIFO, "TF",  6, 0, 0, 0 }
+	{ 1,   0, 100, 4, SCHED_FIFO, "TP",  0, 0, 0, 0 },
+	{ 2,   0,   0, 2, SCHED_FIFO, "TF",  1, 0, 0, 0 },
+	{ 3,   0,   0, 2, SCHED_FIFO, "TF",  2, 0, 0, 0 },
+	{ 4,   0,   0, 2, SCHED_FIFO, "TF",  3, 0, 0, 0 },
+	{ 5,   0,   0, 2, SCHED_FIFO, "TF",  4, 0, 0, 0 },
+	{ 6,   0,   0, 2, SCHED_FIFO, "TF",  5, 0, 0, 0 },
+	{ 7,   0,   0, 2, SCHED_FIFO, "TF",  6, 0, 0, 0 }
 };
 
 volatile unsigned do_work_dummy;
@@ -180,7 +180,7 @@ void *thread_tb1(void *arg)
 	double t0, t1;
 	int rc;
 
-	test_set_priority(pthread_self(),SCHED_FIFO, 2);
+	test_set_priority(pthread_self(), SCHED_FIFO, 3);
 	DPRINTF(stderr,"Thread TB1: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB1 Started\n",
 		seconds_read() - base_time);
@@ -212,7 +212,7 @@ void *thread_tb2(void *arg)
 	double t0, t1;
 	int rc;
 
-	test_set_priority(pthread_self(),SCHED_FIFO, 5);
+	test_set_priority(pthread_self(), SCHED_FIFO, 5);
 	DPRINTF(stderr,"Thread TB2: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB2 Started\n",
 		seconds_read() - base_time);
Signature · 14 lines
Regards
Bian Naimeng


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw
Quoted 10 lines · Bian Naimeng

Hi Garrett,

Would you like to apply this patch?

The priority of TB1 is lower than TFs, if TB1 was assigned to the CPU
which scheduling TF, TB1 will not have chance to run.
I raise the priority of TB1, the new priority of TB1 is higher than TF
and TL, and still lower than TP.
After applying the following patch, test will work correctly.

ping. Would you have time to pick up it.

Regards
Bian

Quoted 50 lines

Regards
Bian

Quoted 46 lines · Bian Naimeng

TB1 has a lower priority than TFs, it has not chance to run.

---
 .../functional/threads/pi_test/pitest-4.c          |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c +8 -8
index ad940dc..93e44b6 100644
@@ -69,13 +69,13 @@ struct thread_param
 	volatile unsigned progress;
 } tp[] = {
 	{ 0,   0,   0, 1, SCHED_FIFO, "TL",  0, 0, 0, 0 },
-	{ 1,   0, 100, 3, SCHED_FIFO, "TP",  0, 0, 0, 0 },
-	{ 2,   0,   0, 4, SCHED_FIFO, "TF",  1, 0, 0, 0 },
-	{ 3,   0,   0, 4, SCHED_FIFO, "TF",  2, 0, 0, 0 },
-	{ 4,   0,   0, 4, SCHED_FIFO, "TF",  3, 0, 0, 0 },
-	{ 5,   0,   0, 4, SCHED_FIFO, "TF",  4, 0, 0, 0 },
-	{ 6,   0,   0, 4, SCHED_FIFO, "TF",  5, 0, 0, 0 },
-	{ 7,   0,   0, 4, SCHED_FIFO, "TF",  6, 0, 0, 0 }
+	{ 1,   0, 100, 4, SCHED_FIFO, "TP",  0, 0, 0, 0 },
+	{ 2,   0,   0, 2, SCHED_FIFO, "TF",  1, 0, 0, 0 },
+	{ 3,   0,   0, 2, SCHED_FIFO, "TF",  2, 0, 0, 0 },
+	{ 4,   0,   0, 2, SCHED_FIFO, "TF",  3, 0, 0, 0 },
+	{ 5,   0,   0, 2, SCHED_FIFO, "TF",  4, 0, 0, 0 },
+	{ 6,   0,   0, 2, SCHED_FIFO, "TF",  5, 0, 0, 0 },
+	{ 7,   0,   0, 2, SCHED_FIFO, "TF",  6, 0, 0, 0 }
 };
 
 volatile unsigned do_work_dummy;
@@ -180,7 +180,7 @@ void *thread_tb1(void *arg)
 	double t0, t1;
 	int rc;
 
-	test_set_priority(pthread_self(),SCHED_FIFO, 2);
+	test_set_priority(pthread_self(), SCHED_FIFO, 3);
 	DPRINTF(stderr,"Thread TB1: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB1 Started\n",
 		seconds_read() - base_time);
@@ -212,7 +212,7 @@ void *thread_tb2(void *arg)
 	double t0, t1;
 	int rc;
 
Quoted 6 lines

testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c void *thread_tb2(void *arg) · line 218

Quoted 5 lines
testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c +1 -1
-	test_set_priority(pthread_self(),SCHED_FIFO, 5);
+	test_set_priority(pthread_self(), SCHED_FIFO, 5);
 	DPRINTF(stderr,"Thread TB2: started\n");
 	DPRINTF(stdout, "#EVENT %f Thread TB2 Started\n",
 		seconds_read() - base_time);

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list