[Rpm-maint] [PATCH] Make rpmsign tests work for builddir != srcdir.

2017-04-14 Thread Mark Wielaard
The gpg HOME is in the builddir testing directory.
But the keys to import are in the srcdir data/keys directory.

Signed-off-by: Mark Wielaard 
---
 tests/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6adc709..5fa06eb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -110,7 +110,7 @@ EXTRA_DIST += atlocal.in
 # Hack: Abusing testing$(bindir)/rpmbuild as stamp file
 # The chmod is needed when copying from read-only sources (eg in distcheck)
 testing$(bindir)/rpmbuild: ../rpmbuild
-   HOME=$(abs_srcdir)/testing gpg-connect-agent --no-autostart killagent 
bye ||:
+   HOME=$(abs_builddir)/testing gpg-connect-agent --no-autostart killagent 
bye ||:
rm -rf testing
mkdir -p testing/$(bindir)
ln -s ./$(bindir) testing/bin
@@ -126,7 +126,7 @@ testing$(bindir)/rpmbuild: ../rpmbuild
for prog in gzip cat patch tar sh ln chmod rm mkdir uname grep sed find 
file ionice mktemp nice cut sort diff touch; do p=`which $${prog}`; ln -s $${p} 
testing/$(bindir)/; done
for d in /proc /sys /selinux /etc/selinux; do if [ -d $${d} ]; then ln 
-s $${d} testing/$${d}; fi; done
(cd testing/magic && file -C)
-   HOME=$(abs_srcdir)/testing gpg2 --import data/keys/*.secret || 
HOME=$(abs_srcdir)/testing gpg --import data/keys/*.secret
+   HOME=$(abs_builddir)/testing gpg2 --import 
${abs_srcdir}/data/keys/*.secret || HOME=$(abs_builddir)/testing gpg --import 
${abs_srcdir}/data/keys/*.secret
 
 check_DATA = atconfig atlocal $(TESTSUITE)
 check_DATA += testing$(bindir)/rpmbuild
-- 
2.9.3

___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Jeff Johnson
Yes, with about 20 other similar articles and implementations, some even 
accurate.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294249350___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Phil Dibowitz
@cgwalters  - Jens works here... yes, the problem description is related, but 
while a system-wide solution can make this better, being able to 
administratively choose things that can never ever full the buffer is still 
important.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294250985___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Jeff Johnson
If you are arguing for "opt-in" rather than "opt-out" by default when a macro 
is not explicitly set, then change the "1" in this line:
`
_periodic_fsync =
  rpmExpandNumeric("%{?_periodic_fsync}%{!?_periodic_fsync:1}");
`
Otherwise set %_periodic_fsync as you wish.

There wasn't any significant speedup using a 1Mb rather than a 32Kb buffer when 
implemented.

If you wish fdatasync to be called every ~1Mb, then add logic to call every 
other trip through the loop by, say, interpreting a small value of 
%_periodic_fsync as a count, and a large value as a desired fdatasync interval, 
and proceed accordingly.

If you are saying that there is no interest in ensuring either that RPM always 
syncs to disk, or that there aren't other systems where package management 
interferes with other running processes, you are incorrect.

The critical factor choosing to do fsync in RPM is going to be knowing the cost 
of using, and only measurements can tell the cost.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294151888___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Phil Dibowitz
In regards to your questions an optimal implementation can come whenever, I'd 
like to get something merged nowish that I can opt-in to on hosts that t need 
it. So changing your patch to default to off, and then leaving it at the sync 
rate its at is fine. 1MB is probably nicer to the disk but 32k is totally fine.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294217509___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Jeff Johnson
The buffer is 32 * BUFSIZ )= 128Kb) not 32Kb. Sorry for the confusion.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294225532___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Jeff Johnson
One last note: doing fdatasync once, before fadvise+fsync, not after every 
write is ~10x faster:

`
FDIO:  30 writes,  3763601 total bytes in 0.003558 secs
 FDIO:   1 allocs,  3763601 total bytes in 0.24 secs
 FDIO:   1 dsyncs,0 total bytes in 0.074081 secs
 FDIO:   1  syncs,0 total bytes in 0.005785 secs
`

That makes the best case ~17x slower than using the kernel caches. A cost of 
17x is almost tolerable in RPM for the benefits of having files written to disk 
and not blowing out the kernel caches.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294217202___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

2017-04-14 Thread Colin Walters
Isn't this https://lwn.net/Articles/682582/ ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#issuecomment-294231945___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint