reactos/ntoskrnl/ps
George Bișoc b22eefac88
[NTOS:PS] Process Quota Overhaul
-- Rewrite PspChargeProcessQuotaSpecifiedPool and PspReturnProcessQuotaSpecifiedPool private kernel routines, with the goal to implement the algorithms necessary to manage the fields of quota blocks (Usage, Return, Limit and Peak).
-- Invoke the Mm if quota limit raising or returning has to be done
-- When destroying a quota block, make sure that we're giving back all the rest of non-returned quotas to Memory Mm
-- Crash the system with QUOTA_UNDERFLOW if someone is returning way too much quota than it was previously charged
-- When a process exits, ensure that it doesn't hold up any charged quotas in QuotaUsage field of the process object, that way we're enforcing proper kernel consistency
-- Implement PsChargeSharedPoolQuota and PsChargeProcessPageFileQuota functions, used exclusively by the Object Manager. These routines are used to charge or return amount of quotas of a newly created object.
-- On PspInheritQuota, when assigning to process the default quota block if no parent process is given, we must increment the reference counts as we're using it
-- Handle the ProcessCount reference field, as it wasn't used
-- Annotate the functions with SAL
-- Document the code

=== REMARKS ===
Windows LogOn (Winlogon) is responsible for setting up a different quota block for all the processes within an interactive session, which is what we don't do. What we're currently doing instead is we're using the default block, PspDefaultQuotaBlock, for all the processes
across the system. The default block contains the default limits of -1 (which would imply no limits). By definition, the kernel won't ever return STATUS_QUOTA_EXCEEDED as we literally don't set up a definite limit for regular processes. This situation has to be tackled
in the future.

=== TODO FOR FUTURE ===
Most of the code in PspChargeProcessQuotaSpecifiedPool and PspReturnProcessQuotaSpecifiedPool private routines must be refactored in order to reduce the usage of the quota spin lock, possibly wrapping such code in a loop and whatnot.

CORE-17784
2022-01-11 10:11:09 +01:00
..
amd64 [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
arm [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
i386 [NTOSKRNL] Regroup the pool allocation tags in one dedicated place 2021-12-27 18:57:03 +01:00
apphelp.c [NTOSKRNL] Regroup the pool allocation tags in one dedicated place 2021-12-27 18:57:03 +01:00
debug.c [REACTOS] Fix some instances of DPRINTs with trailing whitespace before newlines. 2021-09-13 03:52:19 +02:00
job.c [NTOS:PS] Fix copypasta in NtQueryInformationJobObject. CID 1441354 2021-11-13 21:23:40 -05:00
kill.c [REACTOS] Fix some instances of DPRINTs with trailing whitespace before newlines. 2021-09-13 03:52:19 +02:00
process.c [NTOSKRNL][NDK] Get rid of SECTION_OBJECT typedef 2021-02-03 09:41:21 +01:00
psmgr.c [REACTOS] Cleanup INIT and some PAGE section allocations 2020-11-02 21:45:31 +03:00
psnotify.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
query.c [NTOS:PS] Fix several issues within info classes in AMD64 build 2021-06-25 10:33:18 +02:00
quota.c [NTOS:PS] Process Quota Overhaul 2022-01-11 10:11:09 +01:00
security.c [NTOS:PS] Make sure we can impersonate the given token first 2021-05-02 16:55:20 +02:00
state.c [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
thread.c [FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
win32.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00