Age | Commit message (Collapse) | Author |
|
when we have more processors than submit queues,
the submit queues are shared between some processors
and hence we have to acquire its lock.
in the case of the submit queue being full, we have
to unlock it again before retrying otherwise we have
a deadlock.
sorry :(
|
|
Some ethernet drivers like ethervt6105M maintain
a custom pool of Blocks using Block.free
callback.
To maintain that Block.list pointer is
nil when reused, we have to clear it before
returning it to the custom pool as the custom
pool code is not aware of it.
Also, poison Block.list pointer before free().
|
|
investigating
|
|
We want to provide userspace PCI config space
access on platforms that have PCI, but do not
have ISA bus.
For this, provide a stripped down version of
devpnp, wiht only the pci support that can then
be used by pi4 (bcm64) and reform (imx8) kernels.
|
|
when many processes go to sleep, our old timer would
slow to a crawl; this new implementation does not.
|
|
dmaflush() is a no-op macro on amd64, so
wrap all calls into {} braces to avoid
the compiler warning.
|
|
|
|
when forwarding packets (gating), unconditionally
check tcp-syn packets for the mss-size option and
reduce it to fit the mtu of the outgoing interface.
this is done by exporting a new tcpmssclamp() function
from ip/tcp.c that takes an ip packet and its buffer size
and the effective mtu of the interface and adjusts
the mss value of tcp syn options.
this function is now also used by devbridge, enforcing
a tcp mss below the tunnel mtu.
|
|
postnotepg()
Half NERR stack to 32.
When posing a note to a large group, avoid allocating Notes
for each individual process, but post the reference instread.
factor out process interruption into procinterrupt().
Avoid allocation of notes in alarmkproc, just posting the
same note to everyone.
|
|
|
|
to reproduce:
for(i in `{seq 10}) echo softscreen off >/dev/vgactl
|
|
de-bloat the proc structure by allocating notes
with on the heap instead of embedding them in
the proc structure.
This saves around 640 bytes per process.
|
|
Handlin notes is common for all architectures
except how the note has to be pushed on the user
stack.
This change adds a popnote() function that returns
only the note string or nil if the process should
not be notified (no notes or user notes hold off).
Popnote() also handles common errors like notify
during note handling or missing note handler and
will suicide the process in that case.
|
|
|
|
When probing a timer, we were running in our own kproc,
and not in an interrupt context, which meant that we didn't
have any access to anything worth sampling, so we didn't
give any data back.
This moves the probe to the hzclock interrupt, and returns
the pc in the probe.
|
|
The kernel stack is now above the Proc structure,
so the explicit kstack pointer can be eliminated.
|
|
procs come from the dynamic pools, so we don't need
to remove the memory used by possible procs from the
total available.
|
|
Treallocate the small data structures around procs eagerly,
but use malloc to allocate the large proc data structures
when we need them, which allows us to scale to many more procs.
There are still many scalability bottlenecks, so we only crank
up the nproc limit by a little bit this time around, and crank
it up more as we optimize more.
|
|
We dont expose this anymore, wrapping
these would be bad. Just send more bits.
|
|
For "in" transactions, the "Total Bytes to Transfer" field in
the siTD is decremented by the controller by the actual transfer
size, so what remains in the field is the residue number of bytes.
Also, handle restart when we get a zero byte read on a isochronous
"in" endpoint in devusb itself (removing the restart code for
xhci drivers).
This fixes audio recording with a usb1.1 audio device connected
to ehci controller.
|
|
The mount ID is a sequence number in a 32 bit integer, which means that
it can't be unique. This is largely harmless, because there is no way to
use the mount id, beyond checking if it's negative.
However, there's no overflow check, so the mount ID can wrap negative,
which will break error checks on mount calls.
Because it's useless, let's just stop returning it.
|
|
Our #! line length is very short, and the naïve quoting
makes it difficult to pass more complicated arguments to
the programs being run. This is fine for simple interpreters,
but it's often useful to pass arguments to more complicated
interpreters like auth/box or awk.
This change raises the limit, but also switches to tokenizing
via tokenize(2), rather than hand rolled whitespace splitting.
The limits chosen are arbitrary, but they leave approximately
3 KiB of stack space on 386, and 13k on amd64. This is a lot
of stack used, but it should leave enough for fairly deep
devtab chan stacks.
|
|
|
|
|
|
|
|
readstr can error, we need to catch the error and unlock.
|
|
|
|
mdio interrupt command completion handling was broken,
as the interrupt handler would clear the mii status
register before mdiodone() sees it.
handle errors in miistatus() and miiane(), to not get
confused.
|
|
for unknown reasons, multiwrite is busted in usdhc:
sdhc: write error intr 10 stat ff88858e
usdhccmd: need to reset Datinhibit intr 10 stat ff88858e
usdhc: cmd 193a0027 arg 1e5b6b error intr 18010 stat ff88858f
i'm disabling it for now, adding a flag to the SDio struct.
|
|
|
|
The original intention was to put devskel in to the
kernel to detach what it provides from devsrv.
That is not a good reason, just move it to userspace.
auth/box has been changed to exec skelfs instead
of relying on '#z'.
|
|
nc is not yet tied to the device that
called us
|
|
|
|
this leaks /srvs, revert until we can fix it.
|
|
/srv/clone allows a namespace to get their
own private /srv session.
|
|
|
|
|
|
We don't need to multiply session path by 2, the definition
for NETQID is:
Meaning we don't need to save room between session paths
for individual Qid paths. This doubles the amount of
pipe sessions we can have before a wrap.
|
|
Not crashing on 'chdev &' is important.
|
|
This makes it much easier to run a rc
program without needing to bind in all of '#s/boot'.
|
|
|
|
This code is checking the return of devwalk for
a walk resulting in a clone of an open pipe file. However,
devclone ensures that the chan we are cloning is not
currently open.
|
|
|
|
joe7)
devproc allows changing the noteid of another process
which opens a race condition in sysrfork(), when deciding
to inherit the noteid of "up" to the child and calling
pidalloc() later to take the reference, the noteid could
have been changed and the childs noteid could have been
freed already in the process.
this bug can only happen when one writes the /proc/n/noteid
file of a another process than your own that is in the
process of forking.
the noteid changing functionality of devproc seems questinable
and seems to be only used by ape's setpgrid() implementation.
|
|
|
|
Avoid calling sdgetdev() for every I/O. Instead,
put the SDunit pointer for #S/sdXX/* files in Chan.aux
and keep a reference to SDev between sdopen()/sdclose().
This avoids having to do the sdindex() lookup and
qlock(),incref(),decref() on every read/write
operation. Removal of SDev's is quite rare and only
can happen with pcmcia ide controllers, and i assume
that for that we can assume thet fileservers having
been exited properly and closed their files before
we attempt to remove a device.
The rest is improving waserror() codepaths, making
sure we release the locks for any of the interface
callbacks (verify/online).
Also get rid of tas() and instead only change the
unit's rawopen flag while holding raw qlock.
|
|
pci uarts are detected late and usually do not contain
the console= parameter logic.
for these, we can just enable them when devuart is reset,
and replay the boot messages once enabled.
this is usefull as it allows us to use these uarts for
kernel debugging in interrupt context.
|
|
|
|
Use an RWlock so readers can work in parallel in
the common case (no cache updates).
When a reader needs to update the cache to add
a new learned source mac address, it will drop
the rlock and aquire the wlock to do the update.
When we get a read error, we now unbind the
port to avoid further packets being forwarded
to it.
This is usefull for hotplug ethernet devices
like usb ones or tunnels.
Simplify the unbind, getting rid of the refcount,
by having only the reader proc call freeport().
Avoid holding the bridge lock while opening
and closing ethernet/tunnel device files during
bind and unbind.
Dont use smalloc() (especially when holding locks).
Allocate bridges dynamically, so we do not waste
the memory when we do not need them.
Reject non-hostowner from allocating new bridges.
Use consistent naming: port -> port
Use consistent comment style: // -> /* */
|
|
|