Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo future and modern packaging
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
friesia
Apprentice
Apprentice


Joined: 23 Mar 2007
Posts: 202

PostPosted: Mon Jul 04, 2016 9:14 pm    Post subject: Gentoo future and modern packaging Reply with quote

Recently GCC depelopers improved "function multi-versioning" in GCC which allows software to make use of all available CPU instructions without need for compiling with "-march=native -mtune=native".
https://lwn.net/Articles/691666/

Source-based distros will probably lose the advantage of execution speed in future.

There are also projects like Flatpak which allow distribution-independent packaging (not for all installed software, of course, but still). Maybe they will gain popularity. I like the idea perhaps, but it won't fit into Gentoo philosophy.

Gentoo offers flexibility with USE flags, but in other distros it's also possible to build a set of packages from source if the default build doesn't suit you...

I've been a Gentoo user for many years but I'm trying re-consider benefits it currently offers and whether I need them.

I like the simplistic approach you can have in Gentoo (not installing unnecessary deps) and in Arch (overall KISS philosophy). Will probably stay with them for a while.

What do you think will change about building and packaging in upcoming years in Linux ecosystem?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Mon Jul 04, 2016 11:27 pm    Post subject: Reply with quote

Most build their systems suboptimally anyway, like I do, mainly for compatibility. Probably would be better for me.

However this will give binary bloat? This would require complete routines to be kept around, fine grain instruction selection doesn't work as capabilities branches themselves would waste cpu cycles.

Hopefully there's a way to prune out irrelevant code to reduce object file sizes. The resultant binary will be smaller and thus at least save disk space. Cache resident size is a fallacy as unused code will not be cached anyway. Then again people tend not to care about binary disk space consumption, assuming it's the "cost of doing business" and get that bigger hard drive. Sigh.

The "KISS" philosophy bugs me as perhaps it's simpler for the end user, but it is clearly NOT simpler for the developer to keep so many test cases around to support the end user. So who should it be simpler for? Why should the developer keep on offering OSS if it costs them effort to support options that they do not care for?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Jul 05, 2016 3:53 pm    Post subject: Reply with quote

I like having a distro that makes its own decisions and lets me make my own. This has nothing to do with execution speed; if I wanted that I'd just upgrade my CPU more than twice a decade and use Windows.

Quote:
Why should the developer keep on offering OSS if it costs them effort to support options that they do not care for?

That's a valid question, and it's their choice to. Nobody can be forced to write FOSS software, just as much as nobody can be forced to use it.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Jul 18, 2016 10:09 am    Post subject: Reply with quote

Aamazon wrote:
Gentoo offers flexibility with USE flags, but in other distros it's also possible to build a set of packages from source if the default build doesn't suit you...


It really comes down to how much do you want to tweak & how much you want to fight with the base repository dependency tree...
Sure you can build package X,Y,Z on any distro BUT the more you play the more the system fights. Gentoo is a nice balance between a sane structure and one the user can override
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Jul 18, 2016 11:07 am    Post subject: Reply with quote

I just care how gcc authors will implement this, making a code that can execute specific instruction when running is nothing really new, what is new is that it's gcc that will build that specific code part.

I just hope they will think about code size and that this option could be turn off, and that any "running section" will be built as "one running section of that cpu" when the option is off.
If not, i would see it as a regression, you have no real gain, as you can already do yourself running section for specific feature (mmx must be the most common seen in program), but bloating code of a running program for code segment that will never be trigger would be really a regression, specially on embed devices.

It's also arguable about the value added, while it will ease dev works, some feature will gave hard time to choose which one would do the job better.
Look at software raid, it execute specific running section to benchmark what feature will gave the better result, and on two cpu with the same features, depending on cpu and family, results may differ.
Code:
[ 2662.960617] raid6: sse2x1   gen()  3484 MB/s
[ 2662.977603] raid6: sse2x1   xor()  3673 MB/s
[ 2662.994612] raid6: sse2x2   gen()  5652 MB/s
[ 2663.011601] raid6: sse2x2   xor()  5978 MB/s
[ 2663.028613] raid6: sse2x4   gen()  7156 MB/s
[ 2663.045601] raid6: sse2x4   xor()  3837 MB/s
[ 2663.045603] raid6: using algorithm sse2x4 gen() 7156 MB/s
[ 2663.045604] raid6: .... xor() 3837 MB/s, rmw enabled
[ 2663.045606] raid6: using intx1 recovery algorithm
[ 2663.051916] async_tx: api initialized (async)
[ 2663.058743] xor: measuring software checksum speed
[ 2663.068598]    prefetch64-sse: 13312.000 MB/sec
[ 2663.078597]    generic_sse: 12720.000 MB/sec
[ 2663.078599] xor: using function: prefetch64-sse (13312.000 MB/sec)


For your information flatpak didn't invent the wheel, it's a really old concept having multi-binary-target in one package. So when i see "Modern Packaging", i'm seeing again the classic systemd bullshit argument at work, sorry.
Back to top
View user's profile Send private message
cue-33
n00b
n00b


Joined: 16 Jan 2016
Posts: 10

PostPosted: Tue Nov 08, 2016 3:35 am    Post subject: Reply with quote

Sorry if this is a really noobish question. But aside from the obvious answer (of application developers being too lazy or neglectful) wouldn't most issues be solved if every application specified exact library versions and we quit using generic "library.so -> library.so.X.Y" symlinks?

It's my understanding that the difficulty of building a package manager or ensuring that a Linux distro runs smoothly comes down to whether or not the library versions on the system play nice with the software linking to them, since we pretty much only ever have a single version of any library at a time. Is that correct or am I mistaken?
It's also my understanding that these new package managers like "nix" or "snappy" intend to solve this issue by basically giving every application a complete set of libraries (which would lead to us having a whole bunch of redundant libraries). Is this correct?

Assuming I'm not missing something here, wouldn't it be beneficial to just allow multiple versions of each library to be installed and just create a new "Linux standard" for software to always specify the exact library version number?
Sure that might take up extra disk space, but isn't that better than the "snaps" solution of giving us potentially several copies of the exact same library version?
and isn't it better than all these dependency headaches and questions of whether a piece of software can run on one Linux distro and not another?

Then package managers can just keep track of when no packages use a specific library version and remove it.

Again, sorry if this is really ignorant and I'm completely missing something here.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Tue Nov 08, 2016 3:54 am    Post subject: Reply with quote

Well, your noobness is missing the topic, but that is fine.

You are talking about linking, which isn't what is being discussed. Each processor speaks a slightly different language. They all speak x86_64, but intel teaches their cpu a few special words and amd teaches their cpus a few different special words. Telling the compiler to use these special words speeds up program execution for the program but will cause a crash on the wrong cpu. The new GCC feature allows programs to speak both languages and choose which one at run time.

They are worried that this would waste disk space since both instructions are needed.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
cue-33
n00b
n00b


Joined: 16 Jan 2016
Posts: 10

PostPosted: Tue Nov 08, 2016 6:18 am    Post subject: Reply with quote

Ok, sorry about that. I thought since the OP mentioned flatpak and USE flags that it was just a general discussion about package management.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Tue Nov 08, 2016 12:19 pm    Post subject: Reply with quote

Quote:
Recently GCC depelopers improved "function multi-versioning" in GCC which allows software to make use of all available CPU instructions without need for compiling with "-march=native -mtune=native".


I'm not sure if I miss something.

The lazy approach is to use march-native or read the docs on every new gcc version and adapt your lets phrase it "use-flags / cpu-flags" and such.
Reusing is kinda not obtainable in my point of view. For myself i moved this installation several times and intel always supports the older architecture features. I doubt many have a setting which allow a reuse of the root partition, or let's call it an existing gentoo installtion. I'm kinda certain that most do a fresh installation from scratch, as a new box needs a recompile anyway for anything. You usually stick to an architecture until the mainboard dies or the notebook dies. There is also the option to recompile for a generic architecture before you upgrade the hardware if thats an issue, although i would only recompile the system portage set if that use case occurs

There is also the trap that some cpuflags and gcc-flags are not really named accordingly. Makes things complicated and not that obvious. So march native is the easier and more error free approach.
Back to top
View user's profile Send private message
laineg
n00b
n00b


Joined: 13 Nov 2016
Posts: 3

PostPosted: Tue Nov 15, 2016 2:25 am    Post subject: Reply with quote

gcc -march=native knows everything about your CPU, and can optimize accordingly, like avoiding instructions that are slower than normal on your CPU. Function multi-versioning only enables stuff like AVX while not breaking support for older CPUs. If your CPU has a slower-than-normal <some instruction>, FMV won't help you.
_________________
/sbin/fsck: error while loading shared libraries: /lib/libc.so.6: invalid ELF header
Back to top
View user's profile Send private message
gwr
Apprentice
Apprentice


Joined: 19 Nov 2014
Posts: 194

PostPosted: Tue Nov 22, 2016 12:59 pm    Post subject: Reply with quote

I am confused. When is function multi-versioning done? If I don't specify -march/-mtune? If I specify -march does it compile in the proper functions without doing the initial runtime lookup?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Nov 22, 2016 3:11 pm    Post subject: Reply with quote

The OP's linked article is actually a pretty good introduction. It's done at three different places & times:
  1. At development time, when the programmer calls out critical functions that should be compiled against multiple architectures. Alternatively, the developer can provide multiple implementations of the same function that are optimized for different architectures. Functions are effectively overloaded with multiple implementations.
  2. At compile time, when the compiler provides the infrastructure to automatically detect and call the correct implementation.
  3. At run time, when this detection and automatic dispatch takes place.
The no free lunch aspect is that all implementations are compiled and exist in the resultant binary (i.e., code size gets bigger), and that the function calls themselves become slightly less efficient; presumably it's worth it most of the time because the implementation makes up for the loss of call/return efficiency. However (someone correct me if I'm wrong), this overhead appears to only occur where multiple implementations are explicitly called for in the source code. So, although the lunch isn't free, it appears to be at a reasonable cost for some use cases.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
gwr
Apprentice
Apprentice


Joined: 19 Nov 2014
Posts: 194

PostPosted: Tue Nov 22, 2016 3:22 pm    Post subject: Reply with quote

John R. Graham wrote:

[*]At run time, when this detection and automatic dispatch takes place


But what if I don't want that? Say, I am on an embedded platform and I don't want that cost. My question is can I opt out of that behaviour?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Nov 22, 2016 3:38 pm    Post subject: Reply with quote

It's more like you have to opt in. If the actions are not taken at development time, then there is no overhead at runtime.

Edit: Although true, this is simplistic because it appears that many OSS developers are adding optimized snippets to their code that utilize this feature, so you might get some of it whether you want it or not. I haven't been able to confirm this yet, but "-Os" in CFLAGS will likely disable this feature.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum