Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Florian Festi
Merged #949 into master. -- 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/949#event-3051531080___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
Macro documentation updated. -- 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/949#issuecomment-588194422___ Rpm-maint mailing

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
@pmatilai pushed 1 commit. d5470ef98b5c858227a0c44b5b14c1b73f6e299e Auto-enable optimizations for non-rotational disks on Linux -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Florian Festi
May be it is worth pointing out the auto detection in the macros file for both %_minimize_writes and %_flush_io. May be with a sentence like "When running on non-rotational disk only and the macro is not set this is done automatically". -- You are receiving this because you are subscribed to

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
@pmatilai pushed 1 commit. 3a776ab506b3f4043947a4121f6aaf4eacbb6739 Auto-enable optimizations for non-rotational disks on Linux -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
Also rebased while at it. -- 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/949#issuecomment-588144511___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
Realized %_minimize_writes had 0 as default, fixed in latest push. Also explained the macro config logic a bit in the commit. I guess this is as ready to be lifted from RFC status. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Panu Matilainen
@pmatilai pushed 2 commits. 79841eed95f164fd8c63c57b08643e468d74638d Only enable flush_io and minimize_writes on positive values 1bd9b801b6c5a0a4f18de462bb8009c1374e8aff Auto-enable optimizations for non-rotational disks on Linux -- You are receiving this because you are subscribed to this

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-18 Thread Florian Festi
Ok, looking at the history of flush_io and the potential to do more with it in the future I think just keeping both of those macros is the way to go. As auto detection for now is Linux only there is no perspective to get rid of these macros and just always "do the right thing(tm)" as people with

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-17 Thread Florian Festi
Well, the question is whether we need minimize_writes and flush_io as separate parameters. If we think we do there is really no less complicated option. Adding a third switch really doesn't help. I'd rather set them both to autodetect pre default and have people that really need something else

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-13 Thread Panu Matilainen
Feels awfully fiddly still, and somehow this makes me think there should be a new config value to enable the ssd autodetection, because otherwise to override its effect now you need to set *two* macros instead of just one. Which feels wrong. One way around that would be only enabling

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-13 Thread Panu Matilainen
Updated as per @ffesti's idea to always always push a value on the optimization macros so we can easily revert to original state by popping the macros. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-13 Thread Panu Matilainen
@pmatilai pushed 2 commits. e966e703d1500d1050c238a50c4da48d0cc83c72 Only enable flush_io and minimize_writes on positive values 3ba2e8beb82b847af1b4bb6db48b2d88989fc45d Auto-enable optimizations for non-rotational disks on Linux -- You are receiving this because you are subscribed to this

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-30 Thread Florian Festi
What about this: In setSSD() when enabling: Check if macro is already set. If so push the current value otherwise push "1". So after after rpmPopMacro things are back where they were before. Then we just have to remove the macros from the macros.in file. -- You are receiving this because you

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-29 Thread Panu Matilainen
Oh, it was perfectly clear and I fully agree. I just fixed the easy part because, well, it's easy :smile: The config stuff is not. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-29 Thread Florian Festi
Ok, may be this was not clear enough from my comments: I want to see the last few issues with the macro handling resolved and the patch merged. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-29 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -1415,8 +1467,23 @@ static int rpmtsSetup(rpmts ts, rpmprobFilterFlags > ignoreSet) return 0; } +/* Enable / disable optimizations for solid state disks */ +static void setSSD(int enable) +{ +if (enable) { + rpmlog(RPMLOG_DEBUG,

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-29 Thread Panu Matilainen
@pmatilai pushed 1 commit. 94dfac0bfabeadde5ff9a4045ad871954adeb8b0 Auto-enable optimizations for non-rotational disks on Linux -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-28 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -1415,8 +1467,23 @@ static int rpmtsSetup(rpmts ts, rpmprobFilterFlags > ignoreSet) return 0; } +/* Enable / disable optimizations for solid state disks */ +static void setSSD(int enable) +{ +if (enable) { + rpmlog(RPMLOG_DEBUG,

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-01-27 Thread Michal Domonkos
dmnks commented on this pull request. > @@ -1415,8 +1467,23 @@ static int rpmtsSetup(rpmts ts, rpmprobFilterFlags > ignoreSet) return 0; } +/* Enable / disable optimizations for solid state disks */ +static void setSSD(int enable) +{ +if (enable) { + rpmlog(RPMLOG_DEBUG,

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2019-12-02 Thread Panu Matilainen
Rotational disks only hold us back if they're part of the transaction even in this implementation, so I doubt that's a big issue. Ultimately we'd want per-fs capability tracking to cover device- and fs-specific issues, all the way down to fsm. That's one deep rabbit hole... -- You are

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2019-12-02 Thread Florian Festi
Detecting SSDs automatically is a great step IMHO. This will in the end result in may be half a dozen OS specific code pieces in `getRotational()`. That's fine with me. Not setting these config macros is probably the best way to set those values to "autodetect" which should be the default

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2019-12-02 Thread Panu Matilainen
I don't know what you mean by that. Other than, "yes that's the caveat in the description." -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2019-11-29 Thread ニール・ゴンパ
Wouldn't it make sense for this to apply the auto-detected value and then check if a macro has been set to override the value? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2019-11-22 Thread Panu Matilainen
Try to auto-detect non-rotational disks on start of transactions, and if all involved disks are non-rotational enable optimizations: %_minimize_io to conserve writes, and %_flush_io to avoid trashing the system caches. Caveat: this potentially overrides values from system macro configuration