seastar crimson --- pglock solution discussion

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

 



Hi all,
 
    In order to keep IO request sequence in one pg, osd use pglock to guarantee the sequence.  Here in Crimson, it is lockless, so we use future/promise to do the same work. 

    We can design Each PG has its own IO request queue in seastar-crimson shard. And each PG has one member seastar::promise<> pg_ready; 

   When need pglock.lock(),  we use the following logic to instead: 
                                   
                                    return pg_ready.get_future()                                            //after satisfy the pg_ready promise later then the future will be fulfilled here. 
                                       .then([this] {
                                            Pg_ready = seastar::promise<>{};                           // set promise pg_ready no future.   
                                                     Dequeue io from pg's request queue and do osd following process. 
                                        });

  When need pglock.unlock(), we use the following logic to instead:
                                    then_wrapped([this] (auto fut) {                                   
                                       fut.forward_to(std::move(pg_ready));     // satisfy the pg_ready promise
                                    });
So the next IO request in the PG queue will not be dequeued until the pg_ready promise is satisfied after the prior request has already been processed in OSD. 

Do you think it is workable?

Thanks!
-Chunmei



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux