SlideShare a Scribd company logo
Glusterfs Session #5
inode_t, fd_t lifecycles
Scope
- Life cycle of inode_t
- Life cycle of fd_t
- Debugging refcount leaks
inode-table
- All inodes created in the process are linked into inode-table
- inode_table_new (size_t lru_limit, xlator_t *xl)
- In general top xlators like fuse/server/NFS/gfapi would create the inode tables
to its child(ren).
- Inode table lives as long as the fs it manages is valid.
- Demo: git grep inode_table_new
Inode_t lifecycle(Active)
- When an operation happens on a file/directory, lookup operation is performed
before this operation.
- Lookup operation creates the inode_t object for that file/directory and links the
inode into inode-table and keeps it in active_list of inode-table
- Entry creation operation can also lead to the new inode created becoming
‘active’
- Demo: fuse-code-walk-through
Inode_t lifecycle(LRU)
- By default Brick has 16384 lru size and fuse has 65536(May vary between
versions, on fuse it used to be infinity, but now it has invalidation TBD)
- When refcount of inode is 0 but the nlookup count is non-zero
- Nlookup is maintained differently between fuse and server. With fuse
nlookup-count will be cleared(using forget call) by kernel-fuse. Where as other
xlators do the forget themselves.
- Demo: inode_unref() and inode_forget() in fuse and server
Inode_t lifecycle(PURGE)
- When an entry is deleted/LRU limit is reached, the inode will be put in purge
list to be pruned out of the inode-table. Please note that the inode will be
unhashed before putting it in this list to avoid race conditions.
- All inodes in this list will be destroyed
- Demo: inode_table_prune() -- forget cbk in each xlator
Inode_t lifecycle(Invalidations)
- Fuse used to have infinite LRU because fuse-kernel was doing destroy of
inodes using forget.
- But since glusterfs is a user process, if the number of inodes in LRU is huge
and kernel doesn’t call forgets quick enough, it could lead to OOM killers
- In the latest versions LRU is limited to 65536 and fuse-kernel will be notified
to do an invalidation on the inodes that are LRUed out of the list to keep a
check on the memory usage.
Fd-table
- Auto expanding fd table is present in top xlators.
- All opened files/directories will have fd entry from this table
- When there are disconnects/graph switches, the fds are closed/migrated
respectively from this table.
- Fdtable is active as long as the graph for that fs is active
fd-create(pre-open)
- Fd_t data structure is created with necessary pid, inode
- Fd_no is allocated from table
- Fd-flags are set
- Open fop is wound to the child xlator
fd-create(post-open)
- fd_bind() is called on a successful open so that the fd can be put in
inode->fd_list and is maintained as active-fd
- Demo fd_bind()
Flush fop(Application-close)
- Close on the fd by application leads to Flush fop in glusterfs. Any cleanup
related to the fd will happen in this phase
- In gluster this can lead to flushing writes in write-behind/locks will be cleared.
- File will be open until fd->refcount is non-zero inside gluster
fd-destroy(Post-application-close)
- When the refcount reaches zero, fd_destroy() is called which will call
release/releasdir based on if it is a file/directory respectively.
- The fd will be removed from inode->fd_list as well during this process.
- Fd_table’s entry is relinquished
Network disconnect leading to fd-cleanup in server
- When a connection is dropped between a client and server it will lead to
cleanup of resources from that client.
- Fd’s associated with the client will be cleaned up during this phase.
- All locks on the fd will also be cleaned up
Fd-reopen in client xlator
- When there is a disconnect and reconnect between a client xlator and brick,
files that were open will be re-opened
- Demo, server: server_connection_cleanup
- Demo, client: client_post_handshake
Debugging ref-leaks
- Demo
Q & A

More Related Content

What's hot

Pthreads linux
Pthreads linuxPthreads linux
Pthreads linux
Mark Veltzer
 
Basic Multithreading using Posix Threads
Basic Multithreading using Posix ThreadsBasic Multithreading using Posix Threads
Basic Multithreading using Posix Threads
Tushar B Kute
 
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Kevin Lo
 
Fun with FUSE
Fun with FUSEFun with FUSE
Fun with FUSE
Kernel TLV
 
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Anne Nicolas
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
lopjuan
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
2
22
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
William Lee
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
atozknowledge .com
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
Laurynas Biveinis
 
Puppet barcampexercises.jzt
Puppet barcampexercises.jztPuppet barcampexercises.jzt
Puppet barcampexercises.jzt
som_nangia
 
Linux crontab
Linux crontabLinux crontab
Linux crontab
Teja Bheemanapally
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!
Zubair Nabi
 
Linux comands for Hadoop
Linux comands for HadoopLinux comands for Hadoop
Linux comands for Hadoop
PM Venkatesha Babu
 
Introduction to cStor replica - Contributors Meet 5th Oct 2018
Introduction to cStor replica - Contributors Meet 5th Oct 2018Introduction to cStor replica - Contributors Meet 5th Oct 2018
Introduction to cStor replica - Contributors Meet 5th Oct 2018
OpenEBS
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 

What's hot (18)

Pthreads linux
Pthreads linuxPthreads linux
Pthreads linux
 
Basic Multithreading using Posix Threads
Basic Multithreading using Posix ThreadsBasic Multithreading using Posix Threads
Basic Multithreading using Posix Threads
 
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
 
Fun with FUSE
Fun with FUSEFun with FUSE
Fun with FUSE
 
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
Kernel Recipes 2014 - What I’m forgetting when designing a new userspace inte...
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
2
22
2
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
 
Puppet barcampexercises.jzt
Puppet barcampexercises.jztPuppet barcampexercises.jzt
Puppet barcampexercises.jzt
 
Linux crontab
Linux crontabLinux crontab
Linux crontab
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!
 
Linux comands for Hadoop
Linux comands for HadoopLinux comands for Hadoop
Linux comands for Hadoop
 
Introduction to cStor replica - Contributors Meet 5th Oct 2018
Introduction to cStor replica - Contributors Meet 5th Oct 2018Introduction to cStor replica - Contributors Meet 5th Oct 2018
Introduction to cStor replica - Contributors Meet 5th Oct 2018
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 

Similar to Glusterfs session #5 inode t, fd-t lifecycles

Linux.pdf
Linux.pdfLinux.pdf
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Mohammed Farrag
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
Teja Bheemanapally
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
Ashwin Pawar
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
Nishant Munjal
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
Devanand Gehlot
 
FUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspaceFUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspace
elliando dias
 
Sysdig Open Source Intro
Sysdig Open Source IntroSysdig Open Source Intro
Sysdig Open Source Intro
Michael Ducy
 
Linux
LinuxLinux
Linux
keydak11
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
Phil Hagen
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Muhammad Qazi
 
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaKamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Sebastian Damm
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
KarthickS942388
 
Linux basics
Linux basicsLinux basics
Linux basics
Deepa
 
Vfs
VfsVfs
lec5+.docx
lec5+.docxlec5+.docx
lec5+.docx
ismailaboshatra
 
2004 ugm-tips-tricks
2004 ugm-tips-tricks2004 ugm-tips-tricks
2004 ugm-tips-tricks
Shamoon Jamshed
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Sanmuga Nathan
 
Linux audit framework
Linux audit frameworkLinux audit framework
Linux audit framework
Torstein Hansen
 
Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01
Gyanendra Kumar
 

Similar to Glusterfs session #5 inode t, fd-t lifecycles (20)

Linux.pdf
Linux.pdfLinux.pdf
Linux.pdf
 
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security FrameworkLecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
Lecture 4 FreeBSD Security + FreeBSD Jails + MAC Security Framework
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
FUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspaceFUSE Developing Fillesystems in userspace
FUSE Developing Fillesystems in userspace
 
Sysdig Open Source Intro
Sysdig Open Source IntroSysdig Open Source Intro
Sysdig Open Source Intro
 
Linux
LinuxLinux
Linux
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaKamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Vfs
VfsVfs
Vfs
 
lec5+.docx
lec5+.docxlec5+.docx
lec5+.docx
 
2004 ugm-tips-tricks
2004 ugm-tips-tricks2004 ugm-tips-tricks
2004 ugm-tips-tricks
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux audit framework
Linux audit frameworkLinux audit framework
Linux audit framework
 
Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01
 

More from Pranith Karampuri

Glusterfs session #12 locks xlator posixlk
Glusterfs session #12   locks xlator posixlkGlusterfs session #12   locks xlator posixlk
Glusterfs session #12 locks xlator posixlk
Pranith Karampuri
 
Glusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healingGlusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healing
Pranith Karampuri
 
Glusterfs session #16 self-heal daemon ( for replication)
Glusterfs session #16   self-heal daemon ( for replication)Glusterfs session #16   self-heal daemon ( for replication)
Glusterfs session #16 self-heal daemon ( for replication)
Pranith Karampuri
 
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
Pranith Karampuri
 
Glusterfs session #11 locks xlator entrylks
Glusterfs session #11   locks xlator entrylksGlusterfs session #11   locks xlator entrylks
Glusterfs session #11 locks xlator entrylks
Pranith Karampuri
 
Glusterfs session #7 client, server interactions
Glusterfs session #7   client, server interactionsGlusterfs session #7   client, server interactions
Glusterfs session #7 client, server interactions
Pranith Karampuri
 
Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
Pranith Karampuri
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming model
Pranith Karampuri
 

More from Pranith Karampuri (8)

Glusterfs session #12 locks xlator posixlk
Glusterfs session #12   locks xlator posixlkGlusterfs session #12   locks xlator posixlk
Glusterfs session #12 locks xlator posixlk
 
Glusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healingGlusterfs session #17 self heal daemon data, metadata, entry healing
Glusterfs session #17 self heal daemon data, metadata, entry healing
 
Glusterfs session #16 self-heal daemon ( for replication)
Glusterfs session #16   self-heal daemon ( for replication)Glusterfs session #16   self-heal daemon ( for replication)
Glusterfs session #16 self-heal daemon ( for replication)
 
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
 
Glusterfs session #11 locks xlator entrylks
Glusterfs session #11   locks xlator entrylksGlusterfs session #11   locks xlator entrylks
Glusterfs session #11 locks xlator entrylks
 
Glusterfs session #7 client, server interactions
Glusterfs session #7   client, server interactionsGlusterfs session #7   client, server interactions
Glusterfs session #7 client, server interactions
 
Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming model
 

Recently uploaded

Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 

Recently uploaded (20)

Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 

Glusterfs session #5 inode t, fd-t lifecycles

  • 2. Scope - Life cycle of inode_t - Life cycle of fd_t - Debugging refcount leaks
  • 3. inode-table - All inodes created in the process are linked into inode-table - inode_table_new (size_t lru_limit, xlator_t *xl) - In general top xlators like fuse/server/NFS/gfapi would create the inode tables to its child(ren). - Inode table lives as long as the fs it manages is valid. - Demo: git grep inode_table_new
  • 4. Inode_t lifecycle(Active) - When an operation happens on a file/directory, lookup operation is performed before this operation. - Lookup operation creates the inode_t object for that file/directory and links the inode into inode-table and keeps it in active_list of inode-table - Entry creation operation can also lead to the new inode created becoming ‘active’ - Demo: fuse-code-walk-through
  • 5. Inode_t lifecycle(LRU) - By default Brick has 16384 lru size and fuse has 65536(May vary between versions, on fuse it used to be infinity, but now it has invalidation TBD) - When refcount of inode is 0 but the nlookup count is non-zero - Nlookup is maintained differently between fuse and server. With fuse nlookup-count will be cleared(using forget call) by kernel-fuse. Where as other xlators do the forget themselves. - Demo: inode_unref() and inode_forget() in fuse and server
  • 6. Inode_t lifecycle(PURGE) - When an entry is deleted/LRU limit is reached, the inode will be put in purge list to be pruned out of the inode-table. Please note that the inode will be unhashed before putting it in this list to avoid race conditions. - All inodes in this list will be destroyed - Demo: inode_table_prune() -- forget cbk in each xlator
  • 7. Inode_t lifecycle(Invalidations) - Fuse used to have infinite LRU because fuse-kernel was doing destroy of inodes using forget. - But since glusterfs is a user process, if the number of inodes in LRU is huge and kernel doesn’t call forgets quick enough, it could lead to OOM killers - In the latest versions LRU is limited to 65536 and fuse-kernel will be notified to do an invalidation on the inodes that are LRUed out of the list to keep a check on the memory usage.
  • 8. Fd-table - Auto expanding fd table is present in top xlators. - All opened files/directories will have fd entry from this table - When there are disconnects/graph switches, the fds are closed/migrated respectively from this table. - Fdtable is active as long as the graph for that fs is active
  • 9. fd-create(pre-open) - Fd_t data structure is created with necessary pid, inode - Fd_no is allocated from table - Fd-flags are set - Open fop is wound to the child xlator
  • 10. fd-create(post-open) - fd_bind() is called on a successful open so that the fd can be put in inode->fd_list and is maintained as active-fd - Demo fd_bind()
  • 11. Flush fop(Application-close) - Close on the fd by application leads to Flush fop in glusterfs. Any cleanup related to the fd will happen in this phase - In gluster this can lead to flushing writes in write-behind/locks will be cleared. - File will be open until fd->refcount is non-zero inside gluster
  • 12. fd-destroy(Post-application-close) - When the refcount reaches zero, fd_destroy() is called which will call release/releasdir based on if it is a file/directory respectively. - The fd will be removed from inode->fd_list as well during this process. - Fd_table’s entry is relinquished
  • 13. Network disconnect leading to fd-cleanup in server - When a connection is dropped between a client and server it will lead to cleanup of resources from that client. - Fd’s associated with the client will be cleaned up during this phase. - All locks on the fd will also be cleaned up
  • 14. Fd-reopen in client xlator - When there is a disconnect and reconnect between a client xlator and brick, files that were open will be re-opened - Demo, server: server_connection_cleanup - Demo, client: client_post_handshake
  • 16. Q & A