mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
vfs: handle submit_ready signal in fs adapter
to avoid starvation. Issue #2664
This commit is contained in:
parent
4a3fc21ada
commit
f05c4df36a
@ -506,6 +506,12 @@ class Vfs::Fs_file_system : public File_system
|
||||
return count;
|
||||
}
|
||||
|
||||
void _ready_to_submit()
|
||||
{
|
||||
/* notify anyone who might have failed on write() ready_to_submit */
|
||||
_post_signal_hook.arm(nullptr);
|
||||
}
|
||||
|
||||
void _handle_ack()
|
||||
{
|
||||
::File_system::Session::Tx::Source &source = *_fs.tx();
|
||||
@ -535,7 +541,7 @@ class Vfs::Fs_file_system : public File_system
|
||||
case Packet_descriptor::WRITE:
|
||||
/*
|
||||
* Notify anyone who might have failed on
|
||||
* 'alloc_packet()' or 'submit_packet()'
|
||||
* 'alloc_packet()'
|
||||
*/
|
||||
_post_signal_hook.arm(nullptr);
|
||||
|
||||
@ -565,6 +571,9 @@ class Vfs::Fs_file_system : public File_system
|
||||
Genode::Io_signal_handler<Fs_file_system> _ack_handler {
|
||||
_env.ep(), *this, &Fs_file_system::_handle_ack };
|
||||
|
||||
Genode::Io_signal_handler<Fs_file_system> _ready_handler {
|
||||
_env.ep(), *this, &Fs_file_system::_ready_to_submit };
|
||||
|
||||
public:
|
||||
|
||||
Fs_file_system(Genode::Env &env,
|
||||
@ -583,6 +592,7 @@ class Vfs::Fs_file_system : public File_system
|
||||
::File_system::DEFAULT_TX_BUF_SIZE)
|
||||
{
|
||||
_fs.sigh_ack_avail(_ack_handler);
|
||||
_fs.sigh_ready_to_submit(_ready_handler);
|
||||
}
|
||||
|
||||
/*********************************
|
||||
|
Loading…
Reference in New Issue
Block a user