Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 40 |
Nodes: | 6 (0 / 6) |
Uptime: | 12:51:32 |
Calls: | 291 |
Files: | 910 |
Messages: | 76,474 |
What other place would be suitable for including this functionality?
have a pattern of packages coming up with code chewing /proc/meminfo
using various means (refer to my initial mail referenced from the bug >submission) and reducing parallelism based on it
Do you see the computation of allocatable RAM as something we can
accommodate in coreutils? Michael suggested adding "nmem" between the
lines. Did you mean that in an ironic way or are you open to adding such
a tool? It would solve a quite platform-dependent part of the problem
and significantly reduce the boiler plate in real use cases.
As I suggested: you need two tools or one new tool because what you're looking for is the min of ncpus and (available_mem / process_size). The result of that calculation is not the "number of cpus", it is the
number of processes you want to run.
Here's the problem: the definition of "available memory" is very vague.
`free -hwv` output from a random machine:
total used free shared buffers
cache available
Mem: 30Gi 6.7Gi 2.4Gi 560Mi 594Mi
21Gi 23Gi
Swap: 11Gi 2.5Mi 11Gi
Comm: 27Gi 22Gi 4.3Gi
Is the amount of available memory 2.4Gi, 23Gi, maybe 23+11Gi? Or 4.3Gi?
IMO, there is no good answer to that question.
(or else, what's wrong with using /proc/meminfo directly?)
I fear your rebuild is ooming workers (...) it seems that some package
is reducing is parallelism to two c++ compilers and that still exceeds
20G
You'd need to somehow get people to define policies, what would that
look like?
On Thu, Dec 26, 2024 at 09:01:30AM +0100, Helmut Grohne wrote:
What other place would be suitable for including this functionality?
As I suggested: you need two tools or one new tool because what you're looking for is the min of ncpus and (available_mem / process_size). The result of that calculation is not the "number of cpus", it is the number of processes you want to run.
Here's the problem: the definition of "available memory" is very vague.
`free -hwv` output from a random machine:
IMO, there is no good answer to that question. It's going to vary based on how/whether virtual memory is implemented, the purpose of the system (e.g., is it dedicated to building this one thing or does it have other roles that shouldn't be impacted), the particulars of the build process (is reducing disk cache better or worse than reducing ||ism?), etc.--and we havent even gotten to cgroups or other esoteric factors yet. Long before asking where nmem should go, you'd need to figure out how nmem would work. You're
implicitly looking for this tool to be portable (or else, what's wrong with using /proc/meminfo directly?) but I don't have any idea how that would
work. You'd need to somehow get people to define policies, what would that look like? I'd suggest starting by writing a proof of concept and shopping
it around to get buy-in and/or see if it's useful. The answers you get from someone doing HPC on linux may be different from the administrator of an openbsd server or a developer on an OS/X laptop or windows desktop. I'm personally skeptical that this is a problem that can be solved, but maybe you'll be able to demonstrate otherwise. At any rate, looking for a project to host & distribute the tool would seem to be just about the last step. Actually naming the thing won't be easy either, but showing how it works is probably a better place to start.
Before we move on, please allow me to ask what problem the nproc tool is supposed to solve. Of course it tells you the number of processors, but
that is not a use case on its own. If you search for uses, "make
-j$(nproc)" (with varying build systems) is the immediate hit. This use
is now broken by hardware trends (see below). It can also be used to partition a system and computing partition sizes. This use case
continues to work. Are there other use cases? Unless I am missing
something, it seems like nproc no longer solves its most common use case
(and this bug is asking to fix it).
Thus far, I am effectively turned down by:
* coreutils
* debhelper
* dpkg
What other place would be suitable for including this functionality? We