Pádraig Brady wrote: > > For physmem_total, I'm not sure. It is defined as "the total amount of > > physical memory". So, either > > - leave physmem_total as it is, or > > - invent a new function physmem_in_container, > > - or add a 'bool in_container' parameter to physmem_total. > I'm not sure I agree with physmem_total ignoring cgroups. > > If one does `sort --buffer-size=50%` you would want it > based on the current static defined limit, whether that's physical memory, > or what has been configured as the max possible. > Looking at the comment for physmem_total in lib/physmem.h it's described as: > "more or less a hard limit for the working set" > which to me should reflect the cgroup limit. > > If we did also provided a phsysmem_max and adjusted sort(1) to use that, > then how useful would physmem_total be. I.e. what would that ever be used for?
It would still be useful for informational purposes, like neofetch. Really, the total RAM of the machine is the simplest notion in this area; it should remain available through a Gnulib API. Also, the name "*_total" should return the total, because that's the name says. Bruno
