Re: Why nodeid==1 need to be checked and dealt with specially in "fuse-bridge.c"?

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

 





On Wed, Mar 15, 2017 at 9:17 PM, Zhitao Li <zhitaoli1201@xxxxxxxxxxx> wrote:

Hello, everyone,


I have been trying to optimize "ls" performance for Glusterfs recently. My volume is disperse(48 bricks  with redundancy 16), and I mount it with fuse. I create 10000 little files in mount point. Then I execute "ls" command. In my cluster, it takes about 3 seconds.

I have a question about fuse_getattr function in "fuse-bridge.c" . Why need we check whether nodeid is equal to 1? , which means it is the mount point.  It is hard for me to get its meaning.

(In my case, I find the operation of fuse_getattr takes neer half time for "ls", that is why I want to know what the check means. )




 

I try to disable the special check, and then test "ls". It works normally and have a speedup 2x(about 1.3s without check). The reason is that in my case, "lookup" cost is much higher than "stat". Without the special check, getattr goes into "stat" instead of "lookup".


Could you tell me the meaning of the special check for "nodeid == 1"?

glusterfs passes 'nodeid' as pointer of inode_t for an entry in all the cases. But in case of root (which is inode number 1, and nodeid 1), we can't pass inode pointer value, but needs to override that part of the code to send 1 instead of pointer. Hence a separate fuse_root_lookup_cbk() function.

Regards,
Amar

 

I would appreciate it if anyone could give some tips . Thank you!


Best regards,
Zhitao Li
 
Sent from Outlook

_______________________________________________
Gluster-users mailing list
Gluster-users@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-users



--
Amar Tumballi (amarts)
_______________________________________________
Gluster-users mailing list
Gluster-users@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-users

[Index of Archives]     [Gluster Development]     [Linux Filesytems Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux