[RFC] alter inode table lock from mutex to rwlock

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFC] alter inode table lock from mutex to rwlock

Changwei Ge
Hi,

Now inode_table_t:lock is type of mutex which I think we can use
‘pthread_rwlock' to replace it for a better concurrency.

Because phread_rwlock allows more than one thread accessing inode table
at the same time.
Moreover, the critical section the lock is protecting won't take many
CPU cycles and no I/O and CPU fault/exception involved after a quick
glance at glusterfs code.
I hope I didn't miss something.
If I would get an ACK from major glusterfs developer, I will try to do it.

Thanks.
_______________________________________________

Community Meeting Calendar:

APAC Schedule -
Every 2nd and 4th Tuesday at 11:30 AM IST
Bridge: https://bluejeans.com/836554017

NA/EMEA Schedule -
Every 1st and 3rd Tuesday at 01:00 PM EDT
Bridge: https://bluejeans.com/486278655

Gluster-devel mailing list
[hidden email]
https://lists.gluster.org/mailman/listinfo/gluster-devel

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] alter inode table lock from mutex to rwlock

Amar Tumballi Suryanarayan
Hi Changwei Ge,

On Thu, Aug 22, 2019 at 5:57 PM Changwei Ge <[hidden email]> wrote:
Hi,

Now inode_table_t:lock is type of mutex which I think we can use
‘pthread_rwlock' to replace it for a better concurrency.

Because phread_rwlock allows more than one thread accessing inode table
at the same time.
Moreover, the critical section the lock is protecting won't take many
CPU cycles and no I/O and CPU fault/exception involved after a quick
glance at glusterfs code.
I hope I didn't miss something.
If I would get an ACK from major glusterfs developer, I will try to do it.


You are right. I believe this is possible. No harm in trying this out.

Xavier, Raghavendra, Pranith, Nithya, do you think this is possible?

Regards,

 
Thanks.
_______________________________________________

Community Meeting Calendar:

APAC Schedule -
Every 2nd and 4th Tuesday at 11:30 AM IST
Bridge: https://bluejeans.com/836554017

NA/EMEA Schedule -
Every 1st and 3rd Tuesday at 01:00 PM EDT
Bridge: https://bluejeans.com/486278655

Gluster-devel mailing list
[hidden email]
https://lists.gluster.org/mailman/listinfo/gluster-devel



--
Amar Tumballi (amarts)

_______________________________________________

Community Meeting Calendar:

APAC Schedule -
Every 2nd and 4th Tuesday at 11:30 AM IST
Bridge: https://bluejeans.com/836554017

NA/EMEA Schedule -
Every 1st and 3rd Tuesday at 01:00 PM EDT
Bridge: https://bluejeans.com/486278655

Gluster-devel mailing list
[hidden email]
https://lists.gluster.org/mailman/listinfo/gluster-devel

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] alter inode table lock from mutex to rwlock

Changwei Ge
Hi Amar,

Thanks for your reply, I will try it out then.


     -Changwei


On 2019/8/22 8:48 下午, Amar Tumballi Suryanarayan wrote:

> Hi Changwei Ge,
>
> On Thu, Aug 22, 2019 at 5:57 PM Changwei Ge <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     Now inode_table_t:lock is type of mutex which I think we can use
>     ‘pthread_rwlock' to replace it for a better concurrency.
>
>     Because phread_rwlock allows more than one thread accessing inode
>     table
>     at the same time.
>     Moreover, the critical section the lock is protecting won't take many
>     CPU cycles and no I/O and CPU fault/exception involved after a quick
>     glance at glusterfs code.
>     I hope I didn't miss something.
>     If I would get an ACK from major glusterfs developer, I will try
>     to do it.
>
>
> You are right. I believe this is possible. No harm in trying this out.
>
> Xavier, Raghavendra, Pranith, Nithya, do you think this is possible?
>
> Regards,
>
>     Thanks.
>     _______________________________________________
>
>     Community Meeting Calendar:
>
>     APAC Schedule -
>     Every 2nd and 4th Tuesday at 11:30 AM IST
>     Bridge: https://bluejeans.com/836554017
>
>     NA/EMEA Schedule -
>     Every 1st and 3rd Tuesday at 01:00 PM EDT
>     Bridge: https://bluejeans.com/486278655
>
>     Gluster-devel mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.gluster.org/mailman/listinfo/gluster-devel
>
>
>
> --
> Amar Tumballi (amarts)
_______________________________________________

Community Meeting Calendar:

APAC Schedule -
Every 2nd and 4th Tuesday at 11:30 AM IST
Bridge: https://bluejeans.com/836554017

NA/EMEA Schedule -
Every 1st and 3rd Tuesday at 01:00 PM EDT
Bridge: https://bluejeans.com/486278655

Gluster-devel mailing list
[hidden email]
https://lists.gluster.org/mailman/listinfo/gluster-devel