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

Make IO asynchronous #90

Merged
merged 58 commits into from
Mar 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a3154fd
block: Remove blkdev_read and blkdev_write
heatd Dec 31, 2023
d72c715
block: Allocate bio_reqs on the heap, not on the stack
heatd Dec 31, 2023
397e021
io: Various changes wrt IO
heatd Jan 5, 2024
aa82409
vterm: Implement scrolling regions, various other escapes
heatd Jan 18, 2024
3189ce5
writeback: Wake the address while not holding the inode spinlock
heatd Jan 18, 2024
124bf33
vmo: Initialize the private_lock member
heatd Jan 18, 2024
abcdc64
vmo: Wait for writeback when purging pages
heatd Jan 18, 2024
42e8b1a
vmo: Remove old, useless code
heatd Jan 18, 2024
83a9529
pagealloc: Assert that WRITEBACK isn't set when freeing a page
heatd Jan 18, 2024
46dcc7f
nvme: Adapt to the new io-queue interfaces
heatd Jan 18, 2024
d66e97e
rcupdate: Add auto_rcu_lock
heatd Jan 18, 2024
cea0cc9
kernel: Add preliminary C support for many headers
heatd Jan 19, 2024
0a178b6
time: Fix date calculation
heatd Jan 26, 2024
6b1b5bd
iovec_iter: Make the type compatible with C
heatd Jan 26, 2024
7af948f
kernel: Make onyx/process.h C-compatible
heatd Jan 26, 2024
d4acd15
nvme/bio: NVMe driver and io-queue fixes
heatd Feb 12, 2024
59704b1
page: Add a page_owner feature
heatd Feb 12, 2024
3f5b7e9
filemap: Generate SIGBUS on faults out of range
heatd Feb 12, 2024
2a81070
block_buf: Add block buf "forgetting" for inode association
heatd Feb 12, 2024
f2cfea8
ext2: Fix truncate
heatd Feb 12, 2024
a843b3d
trunctests: Add truncation-related tests
heatd Feb 12, 2024
8423aa1
slab: Rewrite the magazine refill logic
heatd Feb 15, 2024
774065d
slab: Add kcalloc()
heatd Feb 15, 2024
0cf22a7
io-queue: Add pull_sq()
heatd Feb 15, 2024
7f64c4f
io-queue: Fix "pending" io queue setting
heatd Feb 15, 2024
ba6aeb2
nvme: Add pull_sq()
heatd Feb 15, 2024
4b65d87
iovec_iter: Add iovec_is_aligned
heatd Feb 15, 2024
a90e03d
bio: Add BIO_REQ_PINNED_PAGES
heatd Feb 15, 2024
5a5b6c6
vfs: Add file_ops::directio
heatd Feb 15, 2024
4734f6c
buffer: Add a directio() implementation
heatd Feb 15, 2024
c365e41
iostress: Add --sync
heatd Feb 15, 2024
c1a0936
login: Fix sessions not having a ctty
heatd Feb 16, 2024
141bc05
socket: Fix socket_write()'s error codes
heatd Feb 16, 2024
da25821
anon: Fix MAP_SHARED files' sizes
heatd Feb 16, 2024
2625afc
partition: Fix partition_setup() error handling
heatd Feb 17, 2024
760020c
partition: Clean up errno uses
heatd Feb 17, 2024
cf0dc25
mm/bootmem: static-ify internal functions
heatd Feb 18, 2024
bbb1b72
memory.hpp: Make unique_ptr constructors constexpr
heatd Mar 3, 2024
35b5c63
block: Add requests, merging and queue properties
heatd Mar 3, 2024
85b460a
mailmap: Add mailmap
heatd Mar 13, 2024
b9d1635
spinlock: Remove Spinlock
heatd Mar 20, 2024
e26aebe
local_lock: Add local_lock
heatd Mar 21, 2024
fe22e48
block: Start using struct request as the unit of hardware IO submission
heatd Mar 21, 2024
b4d54b9
block: Add block IO plugging
heatd Mar 21, 2024
61881a3
block: Add checks for bio validity
heatd Mar 21, 2024
7c9ccef
filemap: Plug up IO in filemap_writepages
heatd Mar 21, 2024
18e0145
ahci: Convert to struct request
heatd Mar 23, 2024
ba08182
ide: Adapt to the new io-queue interfaces
heatd Mar 23, 2024
4ae8e8b
arch: Hide C++ mov_non_temporal from C code
heatd Mar 23, 2024
7175e4b
arm64: Percpu C fixes
heatd Mar 23, 2024
02c71de
bio: Add bio bouncing and primitive chaining
heatd Mar 23, 2024
bdb29db
ide: Ask for highmem bouncing
heatd Mar 23, 2024
9e71af1
ahci: Ask for 64-bit buffer bouncing if 64-bit DMA not supported
heatd Mar 23, 2024
d2920ff
ahci: Set max_sectors_per_request to 64K
heatd Mar 23, 2024
2d2aee2
ide: Set max_sectors_per_request
heatd Mar 23, 2024
73a1aab
block: Add dma_boundary
heatd Mar 23, 2024
1f5740d
io-queue: Clean up unused functions
heatd Mar 23, 2024
0a1df41
bio: Clean up unused members
heatd Mar 23, 2024
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
local_lock: Add local_lock
Add local_lock, a nice abstraction over preemption disabling and irq
disabling.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd committed Mar 21, 2024
commit e26aebecb7415c8522f9355f1933a08007754765
57 changes: 57 additions & 0 deletions kernel/include/onyx/local_lock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2024 Pedro Falcato
* This file is part of Onyx, and is released under the terms of the MIT License
* check LICENSE at the root directory for more information
*
* SPDX-License-Identifier: MIT
*/
#ifndef _ONYX_LOCAL_LOCK_H
#define _ONYX_LOCAL_LOCK_H

#include <onyx/lock_annotations.h>
#include <onyx/preempt.h>

#include <platform/irq.h>

/* Linux-like local_lock implementation as defined in
* https://docs.kernel.org/locking/locktypes.html#local-lock
*/
struct CAPABILITY("local lock") local_lock
{
#ifdef __cplusplus
/* We need this dummy[0] to force a zero-sized struct in C++*/
int dummy[0];
#endif
};

#define local_lock_init(x) ((void) (x))

static inline void local_lock(struct local_lock *ll) ACQUIRE(ll) NO_THREAD_SAFETY_ANALYSIS
{
sched_disable_preempt();
}

static inline void local_unlock(struct local_lock *ll) RELEASE(ll) NO_THREAD_SAFETY_ANALYSIS
{
sched_enable_preempt();
}

static inline void local_unlock_nosoftirq(struct local_lock *ll)
RELEASE(ll) NO_THREAD_SAFETY_ANALYSIS
{
sched_enable_preempt_no_softirq();
}

static inline unsigned long local_lock_irqsave(struct local_lock *ll)
ACQUIRE(ll) NO_THREAD_SAFETY_ANALYSIS
{
return irq_save_and_disable();
}

static inline void local_unlock_irqrestore(struct local_lock *ll, unsigned long flags)
RELEASE(ll) NO_THREAD_SAFETY_ANALYSIS
{
irq_restore(flags);
}

#endif