SRCU use from different contexts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

We were pondering with Amir about some issues with fsnotify subsystem and
as a building block we would need a mechanism to make sure write(2) has
completed. For simplicity we could imagine it like a sequence

write(2)
  START
  do stuff to perform write
  END

and we need a mechanism to wait for all processes that already passed START
to reach END. Ideally without blocking new writes while we wait for the
pending ones. Now this seems like a good task for SRCU. We could do:

write(2)
  srcu_read_lock(&sb->s_write_rcu);
  do stuff to perform write
  srcu_read_unlock(&sb->s_write_rcu);

and use synchronize_srcu(&sb->s_write_rcu) for waiting.

But the trouble with writes is there are things like aio or io_uring where
the part with srcu_read_lock() happens from one task (the submitter) while
the part with srcu_read_unlock() happens from another context (usually worker
thread triggered by IRQ reporting that the HW has finished the IO).

Is there any chance to make SRCU work in a situation like this? It seems to
me in principle it should be possible to make this work but maybe there are
some implementation constraints I'm missing... 

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux