[Rpm-maint] [rpm-software-management/rpm] Consider available memory and address space for parallel execution (PR #2418)

Michal Domonkos notifications at github.com
Wed Mar 22 16:22:30 UTC 2023


@dmnks commented on this pull request.



> +     * Conservative estimates for thread use on 32bit systems where address
+     * space is an issue: 2GB for bare metal, 3GB for a 32bit process
+     * on a 64bit system.
+     */
+    if (thread) {
+	unsigned long vmem = mem;
+#if __WORDSIZE == 32
+	vmem = UINT32_MAX / 2;
+#else
+#if defined(__linux__)
+	if ((personality(0xffffffff) & PER_MASK) == PER_LINUX32)
+	    vmem = (UINT32_MAX / 4) * 3;
+#endif
+#endif
+	/* Fixup to get nice even numbers */
+	vmem = vmem / (1024*1024) + 1;

This needs to be outside of the block so that the function also returns the no. of megabytes when called with `thread` 0. Right now, it returns the number of bytes which makes the `%{getncpus:proc}` calculation, erm, a bit too optimistic :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2418#pullrequestreview-1353020133
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2418/review/1353020133 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230322/8a9e5c90/attachment.html>


More information about the Rpm-maint mailing list