All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Various rt-test patches
@ 2015-07-10 12:25 John Kacur
  2015-07-10 12:25 ` [PATCH 1/6] Fix warning: unused variable ‘c’ John Kacur
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Various rt-patches

Some of these have to do with infrastructure.
Moving to git-archive so we get cleaner tarballs.
I'm planning on ripping out anything in the makefiles that have to do with
maintaining rt-tests though, and either removing it or putting it in the
scripts dir.

Oh, and we have a new repo you should clone, one of the following

git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
https://kernel.googlesource.com/pub/scm/utils/rt-tests/rt-tests.git

And a new location for our tarballs

https://www.kernel.org/pub/linux/utils/rt-tests/


Cheers!

John Kacur (6):
  Fix warning: unused variable ‘c’
  Fix possible exit on error without releasing mutex
  Create a .gitattribute file to specify what files git-archive should
    ignore
  Add .tar files to .gitignore
  Change VERSION_STRING to VERSION
  Create an rt-tests.tar file using git-archive

 .gitattributes                |  4 ++++
 .gitignore                    |  1 +
 Makefile                      | 25 +++++++++++++++----------
 src/backfire/sendme.c         |  2 +-
 src/cyclictest/cyclictest.c   |  2 +-
 src/pi_tests/pi_stress.c      | 17 ++++++++++++-----
 src/pi_tests/pip_stress.c     |  1 -
 src/pmqtest/pmqtest.c         |  2 +-
 src/ptsematest/ptsematest.c   |  2 +-
 src/signaltest/signaltest.c   |  2 +-
 src/sigwaittest/sigwaittest.c |  2 +-
 src/svsematest/svsematest.c   |  2 +-
 12 files changed, 39 insertions(+), 23 deletions(-)
 create mode 100644 .gitattributes

-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/6] Fix warning: unused variable ‘c’
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-10 12:25 ` [PATCH 2/6] Fix possible exit on error without releasing mutex John Kacur
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

This is a legitimate compiler warning, so remove the unused variable.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/pi_tests/pip_stress.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/pi_tests/pip_stress.c b/src/pi_tests/pip_stress.c
index 66b3dc1c9fea..812a7030aa9d 100644
--- a/src/pi_tests/pip_stress.c
+++ b/src/pi_tests/pip_stress.c
@@ -91,7 +91,6 @@ int main(void)
 	cpu_set_t set, *setp = &set;
 	int res;
 	int *minimum_priority = (int*)&prio_min;
-	int c;
 
 	*minimum_priority = sched_get_priority_min(policy);
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/6] Fix possible exit on error without releasing mutex
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
  2015-07-10 12:25 ` [PATCH 1/6] Fix warning: unused variable ‘c’ John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-14 15:59   ` Sebastian Andrzej Siewior
  2015-07-10 12:25 ` [PATCH 3/6] Create a .gitattribute file to specify what files git-archive should ignore John Kacur
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Coverage tools indicate that there are two spots where the function
low_priority() could exit without releasing the mutex.

Since the only error that pthread_barrier_wait is supposed to give is
EINVAL when the barrier is not an initialized barrier object, the
chances of this happinning seem remote. However, if we are going to
test for the error and potentially exit, then we should release the
mutex too.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/pi_tests/pi_stress.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index aaa36c362445..1d1cc58fae54 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -727,17 +727,24 @@ void *low_priority(void *arg)
 		status = pthread_barrier_wait(&p->locked_barrier);
 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
 			pi_error
-			    ("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
-			     p->id, status);
+				("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
+				 p->id, status);
+			/* release the mutex */
+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
+			pthread_mutex_unlock(&p->mutex);
 			return NULL;
 		}
+
 		/* wait for priority boost */
 		pi_debug("low_priority[%d]: entering elevated wait\n", p->id);
 		status = pthread_barrier_wait(&p->elevate_barrier);
 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
 			pi_error
-			    ("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
-			     p->id, status);
+				("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
+				 p->id, status);
+			/* release the mutex */
+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
+			pthread_mutex_unlock(&p->mutex);
 			return NULL;
 		}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/6] Create a .gitattribute file to specify what files git-archive should ignore
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
  2015-07-10 12:25 ` [PATCH 1/6] Fix warning: unused variable ‘c’ John Kacur
  2015-07-10 12:25 ` [PATCH 2/6] Fix possible exit on error without releasing mutex John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-10 12:25 ` [PATCH 4/6] Add .tar files to .gitignore John Kacur
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 .gitattributes | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 .gitattributes

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000000..0867b8185bb2
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+.gitattributes export-ignore
+.gitignore export-ignore
+rt-tests.spec-in export-ignore
+scripts export-ignore
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/6] Add .tar files to .gitignore
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
                   ` (2 preceding siblings ...)
  2015-07-10 12:25 ` [PATCH 3/6] Create a .gitattribute file to specify what files git-archive should ignore John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-14 15:58   ` Sebastian Andrzej Siewior
  2015-07-10 12:25 ` [PATCH 5/6] Change VERSION_STRING to VERSION John Kacur
  2015-07-10 12:25 ` [PATCH 6/6] Create an rt-tests.tar file using git-archive John Kacur
  5 siblings, 1 reply; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Ignore .tar files too

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 1924e73bef67..ceee8bfb6e9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 .*
 *.o
 *.tar.gz
+*.tar
 *.d
 *.patch
 *.a
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/6] Change VERSION_STRING to VERSION
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
                   ` (3 preceding siblings ...)
  2015-07-10 12:25 ` [PATCH 4/6] Add .tar files to .gitignore John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-10 13:42   ` Pavel Vasilyev
  2015-07-14 16:09   ` Sebastian Andrzej Siewior
  2015-07-10 12:25 ` [PATCH 6/6] Create an rt-tests.tar file using git-archive John Kacur
  5 siblings, 2 replies; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Adding _STRING doesn't add any extra meaning, but the extra length makes
the Makefile more unreadable than is necessary, so shorten this up

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile                      | 20 ++++++++++----------
 src/backfire/sendme.c         |  2 +-
 src/cyclictest/cyclictest.c   |  2 +-
 src/pi_tests/pi_stress.c      |  2 +-
 src/pmqtest/pmqtest.c         |  2 +-
 src/ptsematest/ptsematest.c   |  2 +-
 src/signaltest/signaltest.c   |  2 +-
 src/sigwaittest/sigwaittest.c |  2 +-
 src/svsematest/svsematest.c   |  2 +-
 9 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index a48e7597b908..1f7640b82fa6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION_STRING = 0.92
+VERSION = 0.92
 
 HAVE_NPTL ?= yes
 
@@ -60,7 +60,7 @@ VPATH	+= src/lib
 VPATH	+= src/hackbench
 
 %.o: %.c
-	$(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS) $(CPPFLAGS)
+	$(CC) -D VERSION=$(VERSION) -c $< $(CFLAGS) $(CPPFLAGS)
 
 # Pattern rule to generate dependency files from .c files
 %.d: %.c
@@ -158,23 +158,23 @@ release: distclean changelog
 	mkdir -p releases
 	mkdir -p tmp/rt-tests
 	cp -r Makefile COPYING ChangeLog MAINTAINERS doc README.markdown src tmp/rt-tests
-	rm -f rt-tests-$(VERSION_STRING).tar rt-tests-$(VERSION_STRING).tar.asc
-	tar -C tmp -cf rt-tests-$(VERSION_STRING).tar rt-tests
-	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION_STRING).tar
-	gzip rt-tests-$(VERSION_STRING).tar
+	rm -f rt-tests-$(VERSION).tar rt-tests-$(VERSION).tar.asc
+	tar -C tmp -cf rt-tests-$(VERSION).tar rt-tests
+	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION).tar
+	gzip rt-tests-$(VERSION).tar
 	rm -f ChangeLog
-	cp rt-tests-$(VERSION_STRING).tar.gz rt-tests-$(VERSION_STRING).tar.asc releases
+	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases
 
 .PHONY: push
 push:	release
-	scripts/do-git-push $(VERSION_STRING)
+	scripts/do-git-push $(VERSION)
 
 .PHONY: pushtest
 pushtest: release
-	scripts/do-git-push --test $(VERSION_STRING)
+	scripts/do-git-push --test $(VERSION)
 
 rt-tests.spec: Makefile rt-tests.spec-in
-	sed s/__VERSION__/$(VERSION_STRING)/ <$@-in >$@
+	sed s/__VERSION__/$(VERSION)/ <$@-in >$@
 ifeq ($(NUMA),1)
 	sed -i -e 's/__MAKE_NUMA__/NUMA=1/' $@
 	sed -i -e 's/__BUILDREQUIRES_NUMA__/numactl-devel/' $@
diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c
index 8c169dda5857..c1854d9660cb 100644
--- a/src/backfire/sendme.c
+++ b/src/backfire/sendme.c
@@ -108,7 +108,7 @@ void stop_tracing(void)
 
 static void display_help(void)
 {
-	printf("sendme V %1.2f\n", VERSION_STRING);
+	printf("sendme V %1.2f\n", VERSION);
 	puts("Usage: sendme <options>");
 	puts("Function: send a signal from driver to userspace");
 	puts(
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 34053c5d42b0..94e383f8fde1 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1016,7 +1016,7 @@ static void display_help(int error)
 			strcpy(tracers, "none");
 	}
 
-	printf("cyclictest V %1.2f\n", VERSION_STRING);
+	printf("cyclictest V %1.2f\n", VERSION);
 	printf("Usage:\n"
 	       "cyclictest <options>\n\n"
 #if LIBNUMA_API_VERSION >= 2
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 1d1cc58fae54..a4e6e3df1a3d 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -1362,7 +1362,7 @@ void process_command_line(int argc, char **argv)
 			debugging = 1;
 			break;
 		case 'V':
-			printf("pi_stress v%1.2f ", VERSION_STRING);
+			printf("pi_stress v%1.2f ", VERSION);
 			exit(0);
 		case 'u':
 			uniprocessor = 1;
diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
index 336a8eb23626..75d5ee8185a0 100644
--- a/src/pmqtest/pmqtest.c
+++ b/src/pmqtest/pmqtest.c
@@ -240,7 +240,7 @@ void *pmqthread(void *param)
 
 static void display_help(void)
 {
-	printf("pmqtest V %1.2f\n", VERSION_STRING);
+	printf("pmqtest V %1.2f\n", VERSION);
 	puts("Usage: pmqtest <options>");
 	puts("Function: test POSIX message queue latency");
 	puts(
diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
index 7558a41d1917..a31c745ec928 100644
--- a/src/ptsematest/ptsematest.c
+++ b/src/ptsematest/ptsematest.c
@@ -162,7 +162,7 @@ void *semathread(void *param)
 
 static void display_help(void)
 {
-	printf("ptsematest V %1.2f\n", VERSION_STRING);
+	printf("ptsematest V %1.2f\n", VERSION);
 	puts("Usage: ptsematest <options>");
 	puts("Function: test POSIX threads mutex latency");
 	puts(
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 9454a2642342..61259a0a8913 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -202,7 +202,7 @@ out:
 /* Print usage information */
 static void display_help(void)
 {
-	printf("signaltest V %1.2f\n", VERSION_STRING);
+	printf("signaltest V %1.2f\n", VERSION);
 	printf("Usage:\n"
 	       "signaltest <options>\n\n"
 	       "-b USEC  --breaktrace=USEC send break trace command when latency > USEC\n"
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
index 428f5cecadd7..91fcdaa5f185 100644
--- a/src/sigwaittest/sigwaittest.c
+++ b/src/sigwaittest/sigwaittest.c
@@ -210,7 +210,7 @@ void *semathread(void *param)
 
 static void display_help(void)
 {
-	printf("sigwaittest V %1.2f\n", VERSION_STRING);
+	printf("sigwaittest V %1.2f\n", VERSION);
 	puts("Usage: sigwaittest <options>");
 	puts("Function: test sigwait() latency");
 	puts(
diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
index c1128cc375b1..eeb82858720a 100644
--- a/src/svsematest/svsematest.c
+++ b/src/svsematest/svsematest.c
@@ -236,7 +236,7 @@ union semun {
 
 static void display_help(void)
 {
-	printf("svsematest V %1.2f\n", VERSION_STRING);
+	printf("svsematest V %1.2f\n", VERSION);
 	puts("Usage: svsematest <options>");
 	puts("Function: test SYSV semaphore latency");
 	puts(
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/6] Create an rt-tests.tar file using git-archive
  2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
                   ` (4 preceding siblings ...)
  2015-07-10 12:25 ` [PATCH 5/6] Change VERSION_STRING to VERSION John Kacur
@ 2015-07-10 12:25 ` John Kacur
  2015-07-14 16:13   ` Sebastian Andrzej Siewior
  5 siblings, 1 reply; 16+ messages in thread
From: John Kacur @ 2015-07-10 12:25 UTC (permalink / raw
  To: rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior,
	John Kacur

Create an rt-tests.tar file using git-archive so we don't mistakenly
pull in uncommitted files

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 1f7640b82fa6..07394e1292f7 100644
--- a/Makefile
+++ b/Makefile
@@ -118,6 +118,7 @@ CLEANUP += $(if $(wildcard .git), ChangeLog)
 .PHONY: clean
 clean:
 	for F in $(CLEANUP); do find -type f -name $$F | xargs rm -f; done
+	rm -f rt-tests-*.tar
 	rm -f hwlatdetect
 	rm -f tags
 
@@ -165,6 +166,10 @@ release: distclean changelog
 	rm -f ChangeLog
 	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases
 
+.PHONY: tarball
+tarball:
+	git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}
+
 .PHONY: push
 push:	release
 	scripts/do-git-push $(VERSION)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/6] Change VERSION_STRING to VERSION
  2015-07-10 12:25 ` [PATCH 5/6] Change VERSION_STRING to VERSION John Kacur
@ 2015-07-10 13:42   ` Pavel Vasilyev
  2015-07-14 16:09   ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 16+ messages in thread
From: Pavel Vasilyev @ 2015-07-10 13:42 UTC (permalink / raw
  To: John Kacur, rt-users
  Cc: Clark Williams, Thomas Gleixner, Carsten Emde, Sebastian Siewior

10.07.2015 15:25, John Kacur пишет:

> +VERSION = 0.92
> ...
> +	printf("cyclictest V %1.2f\n", VERSION);

Eight other versions and overflow ? ;)


-- 

                                                          Pavel.
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/6] Add .tar files to .gitignore
  2015-07-10 12:25 ` [PATCH 4/6] Add .tar files to .gitignore John Kacur
@ 2015-07-14 15:58   ` Sebastian Andrzej Siewior
  2015-07-14 20:33     ` John Kacur
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-07-14 15:58 UTC (permalink / raw
  To: John Kacur; +Cc: rt-users, Clark Williams, Thomas Gleixner, Carsten Emde

* John Kacur | 2015-07-10 14:25:29 [+0200]:

>Ignore .tar files too
>
>Signed-off-by: John Kacur <jkacur@redhat.com>
>---
> .gitignore | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/.gitignore b/.gitignore
>index 1924e73bef67..ceee8bfb6e9a 100644
>--- a/.gitignore
>+++ b/.gitignore
>@@ -2,6 +2,7 @@
> .*
> *.o
> *.tar.gz
>+*.tar
> *.d
> *.patch
> *.a

Wouldn't it make sense to remove *.tar* and *patch from that list?
After all if "git status" shows you that those exists then step two
should be remove them, right? Why would you want to them around?

Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/6] Fix possible exit on error without releasing mutex
  2015-07-10 12:25 ` [PATCH 2/6] Fix possible exit on error without releasing mutex John Kacur
@ 2015-07-14 15:59   ` Sebastian Andrzej Siewior
  2015-07-14 21:03     ` John Kacur
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-07-14 15:59 UTC (permalink / raw
  To: John Kacur; +Cc: rt-users, Clark Williams, Thomas Gleixner, Carsten Emde

* John Kacur | 2015-07-10 14:25:27 [+0200]:

>diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
>index aaa36c362445..1d1cc58fae54 100644
>--- a/src/pi_tests/pi_stress.c
>+++ b/src/pi_tests/pi_stress.c
>@@ -727,17 +727,24 @@ void *low_priority(void *arg)
> 		status = pthread_barrier_wait(&p->locked_barrier);
> 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
> 			pi_error
>-			    ("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
>-			     p->id, status);
>+				("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
>+				 p->id, status);
>+			/* release the mutex */
>+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
>+			pthread_mutex_unlock(&p->mutex);
> 			return NULL;
> 		}
>+
> 		/* wait for priority boost */
> 		pi_debug("low_priority[%d]: entering elevated wait\n", p->id);
> 		status = pthread_barrier_wait(&p->elevate_barrier);
> 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
> 			pi_error
>-			    ("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
>-			     p->id, status);
>+				("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
>+				 p->id, status);
>+			/* release the mutex */
>+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
>+			pthread_mutex_unlock(&p->mutex);
> 			return NULL;
> 		}
> 

What about having an out: label which does all the clean up at one spot
instead of doing copy/paste here and there?

Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/6] Change VERSION_STRING to VERSION
  2015-07-10 12:25 ` [PATCH 5/6] Change VERSION_STRING to VERSION John Kacur
  2015-07-10 13:42   ` Pavel Vasilyev
@ 2015-07-14 16:09   ` Sebastian Andrzej Siewior
  2015-07-14 21:45     ` John Kacur
  1 sibling, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-07-14 16:09 UTC (permalink / raw
  To: John Kacur; +Cc: rt-users, Clark Williams, Thomas Gleixner, Carsten Emde

* John Kacur | 2015-07-10 14:25:30 [+0200]:

>Adding _STRING doesn't add any extra meaning, but the extra length makes
>the Makefile more unreadable than is necessary, so shorten this up

It isn't a STRING to begin with. You could use __stringify() to make a
string out of it. Not sure if -D=\"VERSION\" works as expected. This
would also get rid of the "overflow" with 0.100 that was mentioned in
the thread…

>diff --git a/Makefile b/Makefile
>index a48e7597b908..1f7640b82fa6 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -158,23 +158,23 @@ release: distclean changelog
> 	mkdir -p releases
> 	mkdir -p tmp/rt-tests
> 	cp -r Makefile COPYING ChangeLog MAINTAINERS doc README.markdown src tmp/rt-tests
>-	rm -f rt-tests-$(VERSION_STRING).tar rt-tests-$(VERSION_STRING).tar.asc
>-	tar -C tmp -cf rt-tests-$(VERSION_STRING).tar rt-tests
>-	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION_STRING).tar
>-	gzip rt-tests-$(VERSION_STRING).tar
>+	rm -f rt-tests-$(VERSION).tar rt-tests-$(VERSION).tar.asc
>+	tar -C tmp -cf rt-tests-$(VERSION).tar rt-tests
>+	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION).tar
>+	gzip rt-tests-$(VERSION).tar
> 	rm -f ChangeLog
>-	cp rt-tests-$(VERSION_STRING).tar.gz rt-tests-$(VERSION_STRING).tar.asc releases
>+	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases

Is this target in use? I doubt you use Clark's key. You could remove the
--default-key option and have default-key in ~/.gnupg/gpg.conf.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/6] Create an rt-tests.tar file using git-archive
  2015-07-10 12:25 ` [PATCH 6/6] Create an rt-tests.tar file using git-archive John Kacur
@ 2015-07-14 16:13   ` Sebastian Andrzej Siewior
  2015-07-14 20:28     ` John Kacur
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-07-14 16:13 UTC (permalink / raw
  To: John Kacur; +Cc: rt-users, Clark Williams, Thomas Gleixner, Carsten Emde

* John Kacur | 2015-07-10 14:25:31 [+0200]:

>diff --git a/Makefile b/Makefile
>index 1f7640b82fa6..07394e1292f7 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -165,6 +166,10 @@ release: distclean changelog
> 	rm -f ChangeLog
> 	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases
> 
>+.PHONY: tarball
>+tarball:
>+	git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}

Okay. So this looks like the release target could go :)

> .PHONY: push
> push:	release
> 	scripts/do-git-push $(VERSION)

Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/6] Create an rt-tests.tar file using git-archive
  2015-07-14 16:13   ` Sebastian Andrzej Siewior
@ 2015-07-14 20:28     ` John Kacur
  0 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-14 20:28 UTC (permalink / raw
  To: Sebastian Andrzej Siewior
  Cc: John Kacur, rt-users, Clark Williams, Thomas Gleixner,
	Carsten Emde



On Tue, 14 Jul 2015, Sebastian Andrzej Siewior wrote:

> * John Kacur | 2015-07-10 14:25:31 [+0200]:
> 
> >diff --git a/Makefile b/Makefile
> >index 1f7640b82fa6..07394e1292f7 100644
> >--- a/Makefile
> >+++ b/Makefile
> >@@ -165,6 +166,10 @@ release: distclean changelog
> > 	rm -f ChangeLog
> > 	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases
> > 
> >+.PHONY: tarball
> >+tarball:
> >+	git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}
> 
> Okay. So this looks like the release target could go :)
> 
> > .PHONY: push
> > push:	release
> > 	scripts/do-git-push $(VERSION)
> 

Right, like I said in Patch [0/6] - I'm planning on ripping everything out 
that is for maintainence purposes, and either doing without it, or at 
least putting it in the scripts dir, I don't think it should be in the 
standard Makefile, but doing it in some baby steps, not making Clark quit 
cold turkey. :)

John

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/6] Add .tar files to .gitignore
  2015-07-14 15:58   ` Sebastian Andrzej Siewior
@ 2015-07-14 20:33     ` John Kacur
  0 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-14 20:33 UTC (permalink / raw
  To: Sebastian Andrzej Siewior
  Cc: John Kacur, rt-users, Clark Williams, Thomas Gleixner,
	Carsten Emde



On Tue, 14 Jul 2015, Sebastian Andrzej Siewior wrote:

> * John Kacur | 2015-07-10 14:25:29 [+0200]:
> 
> >Ignore .tar files too
> >
> >Signed-off-by: John Kacur <jkacur@redhat.com>
> >---
> > .gitignore | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/.gitignore b/.gitignore
> >index 1924e73bef67..ceee8bfb6e9a 100644
> >--- a/.gitignore
> >+++ b/.gitignore
> >@@ -2,6 +2,7 @@
> > .*
> > *.o
> > *.tar.gz
> >+*.tar
> > *.d
> > *.patch
> > *.a
> 
> Wouldn't it make sense to remove *.tar* and *patch from that list?
> After all if "git status" shows you that those exists then step two
> should be remove them, right? Why would you want to them around?
> 

I don't know, I suppose it's a matter of taste, but there are a lot of 
legitimate reasons to have *.tar and *.patch files in your local repo, 
that you might not want to see in via git-status. This is pretty standard 
practice, the Linux kernel has these in .gitignore too, so I'm going to 
keep them in the list.

Cheers!

John

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/6] Fix possible exit on error without releasing mutex
  2015-07-14 15:59   ` Sebastian Andrzej Siewior
@ 2015-07-14 21:03     ` John Kacur
  0 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-14 21:03 UTC (permalink / raw
  To: Sebastian Andrzej Siewior
  Cc: John Kacur, rt-users, Clark Williams, Thomas Gleixner,
	Carsten Emde



On Tue, 14 Jul 2015, Sebastian Andrzej Siewior wrote:

> * John Kacur | 2015-07-10 14:25:27 [+0200]:
> 
> >diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
> >index aaa36c362445..1d1cc58fae54 100644
> >--- a/src/pi_tests/pi_stress.c
> >+++ b/src/pi_tests/pi_stress.c
> >@@ -727,17 +727,24 @@ void *low_priority(void *arg)
> > 		status = pthread_barrier_wait(&p->locked_barrier);
> > 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
> > 			pi_error
> >-			    ("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
> >-			     p->id, status);
> >+				("low_priority[%d]: pthread_barrier_wait(locked): %x\n",
> >+				 p->id, status);
> >+			/* release the mutex */
> >+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
> >+			pthread_mutex_unlock(&p->mutex);
> > 			return NULL;
> > 		}
> >+
> > 		/* wait for priority boost */
> > 		pi_debug("low_priority[%d]: entering elevated wait\n", p->id);
> > 		status = pthread_barrier_wait(&p->elevate_barrier);
> > 		if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
> > 			pi_error
> >-			    ("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
> >-			     p->id, status);
> >+				("low_priority[%d]: pthread_barrier_wait(elevate): %x\n",
> >+				 p->id, status);
> >+			/* release the mutex */
> >+			pi_debug("low_priority[%d]: unlocking mutex\n", p->id);
> >+			pthread_mutex_unlock(&p->mutex);
> > 			return NULL;
> > 		}
> > 
> 
> What about having an out: label which does all the clean up at one spot
> instead of doing copy/paste here and there?
> 

The thought did cross my mind, there are certainly some classic parts of 
the kernel in which that provides a clean solution, but I'm not sure it's 
really better here.

We're talking about two unusual spots that basically are
line 1: print debug message
line 2: unlock the mutex
line 3: return null

With two spots that's a total of six lines, and the flow of control is 
quite clear.

Your method we have an out with 
line 1: out_label:
line 2: print debug message
line 3: unlock the mutex
line 4: return null

And then in two spots we have to do the
spot 1: goto out_label
spot 2: goto out_label

So the total number of lines is also six, but the flow of control isn't 
quite as clear.

It would make more sense if it was just part of the normal sequence in 
cleaning-up, but it isn't because for the other clean-up tasks we've
already released the mutex. Also, in case you are thinking that is a 
little odd, don't forget that this program purposely does some slightly 
odd things in order to intentionally trigger priority inversions.

That all being said, if you see a cleaner way to do this, I'll certainly
take a patch, but for now, I'm just going to supress the complaints from
the coverage tools.

John

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/6] Change VERSION_STRING to VERSION
  2015-07-14 16:09   ` Sebastian Andrzej Siewior
@ 2015-07-14 21:45     ` John Kacur
  0 siblings, 0 replies; 16+ messages in thread
From: John Kacur @ 2015-07-14 21:45 UTC (permalink / raw
  To: Sebastian Andrzej Siewior
  Cc: John Kacur, rt-users, Clark Williams, Thomas Gleixner,
	Carsten Emde

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1777 bytes --]



On Tue, 14 Jul 2015, Sebastian Andrzej Siewior wrote:

> * John Kacur | 2015-07-10 14:25:30 [+0200]:
> 
> >Adding _STRING doesn't add any extra meaning, but the extra length makes
> >the Makefile more unreadable than is necessary, so shorten this up
> 
> It isn't a STRING to begin with. You could use __stringify() to make a
> string out of it. Not sure if -D=\"VERSION\" works as expected. This

That does look a little bogus doesn't it? will need to take a closer look.

> would also get rid of the "overflow" with 0.100 that was mentioned in
> the thread…
> 
> >diff --git a/Makefile b/Makefile
> >index a48e7597b908..1f7640b82fa6 100644
> >--- a/Makefile
> >+++ b/Makefile
> >@@ -158,23 +158,23 @@ release: distclean changelog
> > 	mkdir -p releases
> > 	mkdir -p tmp/rt-tests
> > 	cp -r Makefile COPYING ChangeLog MAINTAINERS doc README.markdown src tmp/rt-tests
> >-	rm -f rt-tests-$(VERSION_STRING).tar rt-tests-$(VERSION_STRING).tar.asc
> >-	tar -C tmp -cf rt-tests-$(VERSION_STRING).tar rt-tests
> >-	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION_STRING).tar
> >-	gzip rt-tests-$(VERSION_STRING).tar
> >+	rm -f rt-tests-$(VERSION).tar rt-tests-$(VERSION).tar.asc
> >+	tar -C tmp -cf rt-tests-$(VERSION).tar rt-tests
> >+	gpg2 --default-key clrkwllms@kernel.org --detach-sign --armor rt-tests-$(VERSION).tar
> >+	gzip rt-tests-$(VERSION).tar
> > 	rm -f ChangeLog
> >-	cp rt-tests-$(VERSION_STRING).tar.gz rt-tests-$(VERSION_STRING).tar.asc releases
> >+	cp rt-tests-$(VERSION).tar.gz rt-tests-$(VERSION).tar.asc releases
> 
> Is this target in use? I doubt you use Clark's key. You could remove the
> --default-key option and have default-key in ~/.gnupg/gpg.conf.
> 

Oh, I like that idea, will have a closer look.

Thanks

John

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-07-14 21:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 12:25 [PATCH 0/6] Various rt-test patches John Kacur
2015-07-10 12:25 ` [PATCH 1/6] Fix warning: unused variable ‘c’ John Kacur
2015-07-10 12:25 ` [PATCH 2/6] Fix possible exit on error without releasing mutex John Kacur
2015-07-14 15:59   ` Sebastian Andrzej Siewior
2015-07-14 21:03     ` John Kacur
2015-07-10 12:25 ` [PATCH 3/6] Create a .gitattribute file to specify what files git-archive should ignore John Kacur
2015-07-10 12:25 ` [PATCH 4/6] Add .tar files to .gitignore John Kacur
2015-07-14 15:58   ` Sebastian Andrzej Siewior
2015-07-14 20:33     ` John Kacur
2015-07-10 12:25 ` [PATCH 5/6] Change VERSION_STRING to VERSION John Kacur
2015-07-10 13:42   ` Pavel Vasilyev
2015-07-14 16:09   ` Sebastian Andrzej Siewior
2015-07-14 21:45     ` John Kacur
2015-07-10 12:25 ` [PATCH 6/6] Create an rt-tests.tar file using git-archive John Kacur
2015-07-14 16:13   ` Sebastian Andrzej Siewior
2015-07-14 20:28     ` John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.