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

add dependency to Send for the implementation of spinlock #97

Merged
merged 14 commits into from
Sep 7, 2020
Merged

add dependency to Send for the implementation of spinlock #97

merged 14 commits into from
Sep 7, 2020

Conversation

stlankes
Copy link
Contributor

@stlankes stlankes commented Sep 1, 2020

@stlankes stlankes marked this pull request as draft September 1, 2020 08:01
- using of the core collection library to handle memory and tasks
- the vector of PCI adpaters aren't longer protected by a lock because it is
  initialized at boot time
- afterwards, we have only read-access
- avoids collisions in BtreeSet
@stlankes stlankes requested a review from tlambertz September 6, 2020 23:13
@stlankes
Copy link
Contributor Author

stlankes commented Sep 7, 2020

@tlambertz I revise the interface to the filesystem. Does it meet your requirements?

Copy link
Contributor

@tlambertz tlambertz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only taken a cursory glance and found virtio-net vulnerable to deadlocks. Though I think similar issues would have caused a panic before. My own rewrite of virtio-fs uses a different interrupt logic, that might be worth adopting. I'll merge it next week.

}
});
if let Some(driver) = crate::arch::kernel::pci::get_network_driver() {
driver.lock().set_polling_mode(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might deadlock. virtio_irqhandler also gets the network driver and calls

driver.lock().handle_interrupt()

The interrupt might happen while the driver is locked here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the reason for SpinlockIrqSave. If a task hold this lock, all interrupt are blocked. => No interrupt during the critical section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/syscalls/interfaces/mod.rs Show resolved Hide resolved
@stlankes stlankes requested a review from jbreitbart September 7, 2020 21:09
@stlankes stlankes marked this pull request as ready for review September 7, 2020 21:10
@stlankes stlankes merged commit f105ba8 into hermit-os:master Sep 7, 2020
@stlankes stlankes mentioned this pull request Sep 7, 2020
@stlankes stlankes deleted the lock branch September 7, 2020 21:23
simonschoening pushed a commit to simonschoening/libhermit-rs that referenced this pull request Aug 26, 2021
…s#97)

* add requirement to use only types T for spin lock, where the behavior Send is specified
* remove obsolete implementation of a irqsave refcell
* replace DoubleLinkedList by LinkedList of the alloc library
* using of the core collection library to handle memory and tasks
* the vector of PCI adapters aren't longer protected by a lock because these adapter are initialized at boot time. Afterwards, we have only read-access.
* Freelist: add check if a reunion with the previous slot is possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants