serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Kernel: Add new integer variable type to SysFS

Open Optimoos opened this issue 1 year ago • 1 comments

This change adds an integer variable type to SysFS in preparation for allowing certain features to be configured live, such as network TTL.

Optimoos avatar Jun 21 '23 20:06 Optimoos

It looks like that note came from the original boolean variable implementation, and has been copied along since. I can remove it from this for sure.

Re safe_memcpy, as I'm not 100% clear on where locks are required, just to be sure - you're saying that the mutex probably isn't required and that doing safe_memcpy on the result should be good enough?

I've done the other cleanup as well, but will wait on the safe_memcpy discussion before I push the update.

Optimoos avatar Jun 23 '23 16:06 Optimoos

It looks like that note came from the original boolean variable implementation, and has been copied along since. I can remove it from this for sure.

Re safe_memcpy, as I'm not 100% clear on where locks are required, just to be sure - you're saying that the mutex probably isn't required and that doing safe_memcpy on the result should be good enough?

I've done the other cleanup as well, but will wait on the safe_memcpy discussion before I push the update.

If we do safe_memcpy, then it doesn't matter if we took a spinlock or not - page faults could still occur, hence everything is fine. The initial problem (I think) was that I tried to use mutexes to protect /sys/kernel/... variables, but since we use spinlocks, that problem is not relevant.

supercomputer7 avatar Jul 13 '23 19:07 supercomputer7

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Aug 04 '23 08:08 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Aug 11 '23 15:08 stale[bot]