Finding which process was killed by Linux OOM killer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions about general computing hardware and software on Stack Overflow. You can edit the question so it’s on-topic for Stack Overflow. Closed 9 months ago. The community reviewed whether to reopen this question 3 months ago and … Read more

Why is Linux called a monolithic kernel?

I read that Linux is a monolithic kernel. Does monolithic kernel mean compiling and linking the complete kernel code into an executable? If Linux is able to support modules, why not break all the subsystems into modules and load them when necessary? In that case, the kernel doesn’t have to load all modules initially and … Read more

What is the theoretical maximum number of open TCP connections that a modern Linux box can have

Assuming infinite performance from hardware, can a Linux box support >65536 open TCP connections? I understand that the number of ephemeral ports (<65536) limits the number of connections from one local IP to one port on one remote IP. The tuple (local ip, local port, remote ip, remote port) is what uniquely defines a TCP … Read more

How do the likely/unlikely macros in the Linux kernel work and what is their benefit?

I’ve been digging through some parts of the Linux kernel, and found calls like this: if (unlikely(fd < 0)) { /* Do something */ } or if (likely(!err)) { /* Do something */ } I’ve found the definition of them: #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) I know that they are for optimization, but how … Read more

What is “:-!!” in C code?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if condition is true, but also produce a result (of value 0 and type size_t), so the expression can be used e.g. in a structure initializer (or where-ever else comma expressions aren’t permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) #define … Read more