prevent exceeding 32 bit memory limitations with multithreaded xz compression 77/106477/2
authorPer Øyvind Karlsen <proyvind@moondrake.org>
Thu, 8 Sep 2016 23:52:39 +0000 (01:52 +0200)
committerpark <sk7.park@samsung.com>
Mon, 2 Jan 2017 10:38:54 +0000 (02:38 -0800)
commitaa6c5c9e76c87804048f478588928d5061ee9dea
tree399fa84c220772a92e2d455432a9417674fd866a
parent61702223c11c73ed47fb81c0c26d04322daf62bb
prevent exceeding 32 bit memory limitations with multithreaded xz compression

As 32 bit build suffers under the limitation of 32 bit address space,
regardless of it's environment would be ie. 64 bit and not have this
constration, rpm must make sure not to exceed this memory limitation.
When using multithreaded xz compression, the number of threads used will
increase the memory usage, making it necessary to check the memory
required with the number of threads to be used.

Number of compression threads will therefore be kept reduced untill
amount of memory required won't exceed this limitation.

For 32 bit binaries running under 64 bit host environment, where less
available memory will be reserved for kernel, easing memory constraints,
determination of this will be done by a combination of checking host
arch as well as whether 32 bit personality flag is set, thereby still
allow a sligthly greater memory usage for such cases to avoid
imposing unnecessatry limitations under such environments.

Change-Id: Ie72827d3067a353a8a48faff9b65595c99f60a4c
rpmio/rpmio.c