summaryrefslogtreecommitdiff
path: root/Kernel/ProcessSpecificExposed.cpp
AgeCommit message (Collapse)Author
2021-08-22Kernel: Rename ScopedSpinlock => SpinlockLockerAndreas Kling
This matches MutexLocker, and doesn't sound like it's a lock itself.
2021-08-22Kernel: Rename SpinLock => SpinlockAndreas Kling
2021-08-19Kernel: Make Process::current() return a Process& instead of Process*Idan Horowitz
This has several benefits: 1) We no longer just blindly derefence a null pointer in various places 2) We will get nicer runtime error messages if the current process does turn out to be null in the call location 3) GCC no longer complains about possible nullptr dereferences when compiling without KUBSAN
2021-08-18Kernel: Specify directory entry types properlySergey Bugaev
...in a few more places, at least. find(1) is about to start relying on the reported types more or less reflecting reality. This is especially relevant for magic symlinks in ProcFS.
2021-08-17Kernel/ProcFS: Avoid String allocation when traversing /proc/PID/fd/Andreas Kling
2021-08-16Kernel: Avoid enumerating all the fds to find a specific one in procfsAli Mohammad Pur
2021-08-15Kernel/ProcFS: Avoid two unnecessary number-to-string conversionsAndreas Kling
We don't need to create a new string from a number in order to compare an existing string to that number. Converting the existing string to a number is much cheaper, since it does not require any heap allocations. Ran into this while profiling "find /" :^)
2021-08-15Kernel+Userland: Remove chroot functionalityAndreas Kling
We are not using this for anything and it's just been sitting there gathering dust for well over a year, so let's stop carrying all this complexity around for no good reason.
2021-08-15Kernel: Move ProcFS related overrides in Process to ProcessProcFSTraitssin-ack
This allows us to 1) let go of the Process when an inode is ref'ing for ProcFSExposedComponent related reasons, and 2) change our ref/unref implementation.
2021-08-15Kernel: Handle allocation failure in ProcFS and friendssin-ack
There were many places in which allocation failure was noticed but ignored.
2021-08-12Kernel: Steer away from heap allocations for ProcFS process dataLiav A
Instead, use more static patterns to acquire that sort of data.
2021-08-06Kernel: Rename Process::space() => Process::address_space()Andreas Kling
We commonly talk about "a process's address space" so let's nudge the code towards matching how we talk about it. :^)
2021-08-06Kernel: Move Kernel/Memory/ code into Kernel::Memory namespaceAndreas Kling
2021-08-06Kernel: Rename Kernel/VM/ to Kernel/Memory/Andreas Kling
This directory isn't just about virtual memory, it's about all kinds of memory management.
2021-07-25Kernel: Make purgeable memory a VMObject level concept (again)Andreas Kling
This patch changes the semantics of purgeable memory. - AnonymousVMObject now has a "purgeable" flag. It can only be set when constructing the object. (Previously, all anonymous memory was effectively purgeable.) - AnonymousVMObject now has a "volatile" flag. It covers the entire range of physical pages. (Previously, we tracked ranges of volatile pages, effectively making it a page-level concept.) - Non-volatile objects maintain a physical page reservation via the committed pages mechanism, to ensure full coverage for page faults. - When an object is made volatile, it relinquishes any unused committed pages immediately. If later made non-volatile again, we then attempt to make a new committed pages reservation. If this fails, we return ENOMEM to userspace. mmap() now creates purgeable objects if passed the MAP_PURGEABLE option together with MAP_ANONYMOUS. anon_create() memory is always purgeable.
2021-07-18Kernel: Rename Locker => MutexLockerAndreas Kling
2021-07-17Kernel/ProcFS: Remove unused ProcFSExposedComponent::entries_count()Andreas Kling
2021-07-17Kernel: Replace "folder" => "directory" everywhereAndreas Kling
Folders are a GUI concept. File systems have directories.
2021-07-17Kernel: Rename Lock to MutexAndreas Kling
Let's be explicit about what kind of lock this is meant to be.
2021-07-14Kernel/ProcFS: Allow a process directory to have a null Process pointerLiav A
In case we are about to delete the PID directory, we clear the Process pointer. If someone still holds a reference to the PID directory (by opening it), we still need to delete the process, but we can't delete the directory, so we will keep it alive, but any operation on it will fail by propogating the error to userspace about that the Process was deleted and therefore there's no meaning to trying to do operations on the directory. Fixes #8576.
2021-07-11Kernel: Rename ProcFSComponentsRegistrar => ProcFSComponentRegistryAndreas Kling
This matches the formatting used in SysFS.
2021-07-11Kernel: Replace "Folder" => "Directory" everywhereAndreas Kling
Folders are a GUI concept, file systems have directories. :^)
2021-07-11Kernel: Rename FS => FileSystemAndreas Kling
This matches our common naming style better.
2021-07-08Kernel: Pledge promises accessible via /proc/PID/pledgeRalf Donau
2021-07-02Kernel/ProcFS: Lazily allocate all sub components of a PID folderLiav A
2021-07-02Kernel/ProcFS: Clean dead processes properlyLiav A
Now we use WeakPtrs to break Ref-counting cycle. Also, we call the prepare_for_deletion method to ensure deleted objects are ready for deletion. This is necessary to ensure we don't keep dead processes, which would become zombies. In addition to that, add some debug prints to aid debug in the future.
2021-06-30Kernel: Don't compile JsonValue & friends into the kernelAndreas Kling
2021-06-29Kernel/ProcFS: Split code into more separate filesLiav A
Instead of using one file for the entire "backend" of the ProcFS data and metadata, we could split that file into two files that represent 2 logical chunks of the ProcFS exposed objects: 1. Global and inter-process information. This includes all fixed data in the root folder of the ProcFS, networking information and the bus folder. 2. Per-process information. This includes all dynamic data about a process that resides in the /proc/PID/ folder. This change makes it more easier to read the code and to change it, hence we do it although there's no technical benefit from it now :)