Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM work #88

Merged
merged 41 commits into from
Dec 31, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cacc8da
radix: Remove useless include
heatd Sep 13, 2023
f0ea5fb
expected: Add panic.h include
heatd Sep 13, 2023
805b9b8
lib/interval_tree: Add an interval tree implementation
heatd Sep 13, 2023
7a8d09e
percpu: Add get_per_cpu_stable
heatd Sep 16, 2023
e0c1c6e
sched: Add attribute((pure)) to get_current_thread/process
heatd Sep 16, 2023
ee14f65
page: Add page reclamation code paths and cache shrinking
heatd Sep 17, 2023
3221b10
virtio: Fix queue desc setting for > 4G
heatd Oct 6, 2023
e8ea3fd
e1000: Avoid using map_page_list
heatd Oct 6, 2023
b3ce847
slab: Fix the mag size expanding beyond the pcpu size
heatd Oct 6, 2023
fd86d8c
riscv64/code_patch: Fix serialization on the patching CPU
heatd Oct 18, 2023
250c4f3
x86/multiboot2: Fix EFI load bias calculation
heatd Oct 18, 2023
9bec87a
x86: Fix mapping bugs on higher memory machines
heatd Oct 18, 2023
ef4e994
x86: Optimize copy_from_user and copy_to_user using memcpy_impl
heatd Oct 18, 2023
fff109f
x86/stack_trace: Fix stack_tracing on panics
heatd Oct 18, 2023
27eb07c
mm: Add experimental UVM-like amap implementation
heatd Oct 19, 2023
cced385
vm: Use amaps for private file mappings
heatd Oct 21, 2023
5ab2b2d
vm: Remove old MAP_PRIVATE paths
heatd Oct 21, 2023
4326f9d
vm: Rework munmap, mprotect, vma splitting
heatd Oct 22, 2023
fdab5bd
vm: vm_region -> vm_area_struct
heatd Oct 22, 2023
e18ea96
lib/compiler-rt: Remove floating point definitions
heatd Oct 22, 2023
dd3c9ac
ktrace: Remove old remnants
heatd Oct 23, 2023
cc965f8
headers: Improve C compatibility in headers
heatd Nov 7, 2023
5c5eada
anon_inode: Add basic anon_inode capabilities
heatd Nov 7, 2023
b4df36a
vm: Refactor large bits of the page cache
heatd Nov 12, 2023
4a58b85
vm: Make anonymous shared memory into a file
heatd Nov 12, 2023
c7b49aa
kernel_api_tests: Add MAP_SHARED fault test
heatd Nov 12, 2023
e599fa8
filemap: Refactoring
heatd Dec 18, 2023
bbb50fb
fs: Rename flush.cpp to writeback.cpp
heatd Dec 18, 2023
1c468d4
page: Add per-zone page stats
heatd Dec 27, 2023
c097cb0
filemap: Hook up the NR_FILE stat
heatd Dec 27, 2023
9270f7a
amap: Hook up NR_ANON
heatd Dec 27, 2023
5cb3b34
iovec_iter: Fix crash on 0-length iovecs
heatd Dec 27, 2023
ddc358d
x86/trap: Fix ENABLE_SCREAM_EXCEPTION
heatd Dec 27, 2023
50c4586
radix: Add debug check for the iterator's state
heatd Dec 27, 2023
0418cb1
iostress: Add fsync functionality
heatd Dec 31, 2023
88e6469
writeback: Writeback rework
heatd Dec 31, 2023
6afa91e
asan: Fix locking when destroying the ASAN quarantine
heatd Dec 31, 2023
290eda6
vm: Zero alloc'd vma when splitting
heatd Dec 31, 2023
5cdc2bb
pagealloc: Zero priv when allocating
heatd Dec 31, 2023
98a2c5a
vm: Add GFP_KERNEL to vma_alloc
heatd Dec 31, 2023
d22bf8f
packetbuf: Remove vmo
heatd Dec 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
slab: Fix the mag size expanding beyond the pcpu size
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd committed Oct 6, 2023
commit b3ce847ff92d67d28a183456d3d0f6e676f077b2
5 changes: 4 additions & 1 deletion kernel/kernel/mm/slab.cpp
Original file line number Diff line number Diff line change
@@ -650,14 +650,17 @@ static int kmem_cache_alloc_refill_mag(struct slab_cache *cache,

for (size_t j = 0; j < avail; j++)
{
if (pcpu->size == batch_size)
if (pcpu->size >= batch_size)
{
if (j == 0 && !slab->active_objects)
{
/* This can happen if we have just allocated a new slab and CPU migration
* happened, since our cache is now a different one that /may/ be full.
* Just free the slab and return success.
*/
/* Note: kmem_cache_free_slab removes the slab from a "list", so add it to a
* dummy partials */
list_add_tail(&slab->slab_list_node, &partials);
kmem_cache_free_slab(slab);
sched_enable_preempt();
goto out;