Using grep, I was unable to find where 60988 is set
on my Fedora 38. So my best guess is that this value
has been set when compiling the kernel.
2) Maybe the Linux kernel sets the default value based
on how much RAM is available.
Neither of these results seem reasonable or tied to anything.
What is going on?
Kenny McCormack <[email protected]> wrote:
Neither of these results seem reasonable or tied to anything.
On my Fedora 38 amd64 "uname -a" shows e.g.
6.4.12-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 23 17:46:49 UTC 2023 x86_64 GNU/Linux
and the result of running your program is:
Result: 0
cur = 60988, max = 60988
RLIM_INFINITY = -1
What is going on?
You used "%lu" and that is correct based on the Linux
headers. On my Fedora 38 we have these:
struct rlimit {
__kernel_ulong_t rlim_cur;
__kernel_ulong_t rlim_max;
};
#define RLIM64_INFINITY (~0ULL)
struct rlimit64 {
__u64 rlim_cur;
__u64 rlim_max;
};
Using grep, I was unable to find where 60988 is set
on my Fedora 38. So my best guess is that this value
has been set when compiling the kernel.
Have you tried using a recursive grep invocation
to find the values you mentioned?
Scott Lurndal <[email protected]> wrote:
the login values are generally specified in
/etc/security/limits.conf on systems that use PAM authentication.
Yes, I know that very well. But in this case they
are irrelevant to the problem discussed.
I would disagree; Scott's point is quite relevant to Kenny's
(very information free) quesion.
More specifically, Kenny only mentioned the values obtained
(31411 and 6807), and asked "What is going on?" Each of those
two values occur in two places: the "curr" limit and the "max"
limit. While others have discussed how the "max" limit is
derived, no one (other than Scott) has mentioned how the "curr"
limit may (or may not) have been set.
Scott Lurndal <[email protected]> wrote:
While the defaults are compiled into the kernel,
I just checked out some of the Linux kernel
sources and I am pretty convinced that the
RLIMIT_PROC defaults are actually dynamically
calculated based on available RAM.
the login values are generally specified in
/etc/security/limits.conf on systems that use PAM authentication.
Yes, I know that very well. But in this case they
are irrelevant to the problem discussed.
While the defaults are compiled into the kernel,
the login values are generally specified in
/etc/security/limits.conf on systems that use PAM authentication.
I have the following C program:
--- Cut Here ---
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
int main(void)
{
struct rlimit rlim;
printf("Result: %d\n",getrlimit(RLIMIT_NPROC, &rlim));
printf("cur = %lu, max = %lu\n",rlim.rlim_cur,rlim.rlim_max);
printf("RLIM_INFINITY = %ld\n",RLIM_INFINITY);
return 0;
}
What the heck is 31411???
What the heck is 6807???
Kalevi Kolttonen <[email protected]> wrote:
Using grep, I was unable to find where 60988 is set
on my Fedora 38. So my best guess is that this value
has been set when compiling the kernel.
I downloaded the current Fedora 38 kernel sources. The
value 60988 is nowhere to be found. Some possible reasons:
1) Maybe 60988 value was given as a command line parameter
when running "make". I suppose this is quite unlikely and
I did not investigate the Makefiles to see whether that
is even supported.
2) Maybe the Linux kernel sets the default value based
on how much RAM is available.
On 2023-08-29, Kalevi Kolttonen <[email protected]> wrote:
Kalevi Kolttonen <[email protected]> wrote:
Using grep, I was unable to find where 60988 is set
on my Fedora 38. So my best guess is that this value
has been set when compiling the kernel.
I downloaded the current Fedora 38 kernel sources. The
value 60988 is nowhere to be found. Some possible reasons:
1) Maybe 60988 value was given as a command line parameter
when running "make". I suppose this is quite unlikely and
I did not investigate the Makefiles to see whether that
is even supported.
Pretty much nobody is going to do
#define DEFAULT_THING 60988 // or other weird number.
Plus, we are seeing different numbers on different systems
2) Maybe the Linux kernel sets the default value based
on how much RAM is available.
Precisely. It looks calculated. You have to find the area
of the kernel where [...]
That's a waste of time; the existing "ulimit" tool reads these
limits. "ulimit -a" gives you all of them; "ulimit -u" gives
us that one ([u]ser processes).
What the heck is 31411???
What the heck is 6807???
Pre-release version of Motrola 6809? ;)
Good question; do these valuas come from some boot scripts on that
system, or are they in the kernel?
Ubuntu 18, 32 bit:
$ ulimit -u
15791
Indeed, weird numbers; it's as if they are concocted by some formula
applied to various other system parameters.
I think you have to hunt down the kernel code where the initial/default >values are prepared.
It could be the work of a boot script, or ... dare I utter it ... systemd.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 158:37:19 |
| Calls: | 12,094 |
| Calls today: | 2 |
| Files: | 15,000 |
| Messages: | 6,517,756 |