introduce in kernel smb3 server called cifsd
play

INTRODUCE IN-KERNEL SMB3 SERVER CALLED CIFSD Namjae Jeon Samsung - PowerPoint PPT Presentation

INTRODUCE IN-KERNEL SMB3 SERVER CALLED CIFSD Namjae Jeon Samsung Electronics June 5, 2019 About me Linux kernel contributor since 2011 Co-Creator of Samsung internal NTFS Filesystem Introduce collapse and insert range syscall


  1. INTRODUCE IN-KERNEL SMB3 SERVER CALLED CIFSD Namjae Jeon Samsung Electronics June 5, 2019

  2. About me  Linux kernel contributor since 2011  Co-Creator of Samsung internal NTFS Filesystem  Introduce collapse and insert range syscall  Creator and maintainer of linux-cifsd project

  3. Topic  Introduction  Architecture  Components  Performance/Stability/Compatibility  Plan  Proposal

  4. What is cifsd ?  SMB Server for Linux kernel  Kernel and Userspace daemons  All SMB Ver. (SMB1 ~ SMB3.1.1) NFS NFSD CIFS CIFSD?  Authentication • NTLM KERNEL • NTLMv2  Performance feature • Oplock/lease • compound request • Copy offload NFS SAMBA  Security feature ganesha • Signing • encryption USERSPACE

  5. linux-cifsd project  Github Repo • https://github.com/cifsd-team/cifsd • https://github.com/cifsd-team/cifsd-tools  Mailing-list • linux-cifsd-devel@lists.sourceforge.net  5 active developers  SMB2 notify(In progress, Yunjae Lim)  SMBDirect (In progress, Hyunchul Lee)

  6. Key Concepts  Can gain the performance in kernel ?  No system call (less TLB miss, less context switching)  Shorter path to use VFS and network functions in kernel  no duplicate memory allocation for inode and superblock

  7. Key Concepts  Optimized SMB over RDMA support

  8. Key Concepts  Simple/light file share for embedded device Reported by Andy Walsh(OpenWRT ) Binary Size Main Extra Total cifsd 128KB(cifsd 61KB(crypto 1061KB kmod, tools) kmods) + 872KB(glib2) samba4 6MB(samba libs, 64KB(libtirpc, 6064KB server package) etc)

  9. Key Concepts  Oplock/lease better handling(page 20) User Space SMB Server (SAMBA) Different Address S pace Open “File” Client 2 Client 1 Open OK – Oplock granted IPC Message – Open “File” Oplock Break Request smbd/1 smbd/2 Oplock Break Request IPC Message – Oplock Break Done Oplock Break Response Open OK – Oplock granted Kernel Space SMB Server (CIFSD) (Uniform Address Space) Global data Open “File” Client 1 Client 2 Open OK – Oplock granted Open “File” kcifsd/1 kcifsd/2 Oplock Break Request Oplock Break Response Open OK – Oplock granted

  10. Architecture  Separate kernel space and user space daemon  Works related to performance in kernel space  Works related to non-performance in user space  Co-work cifsd and kcifsd in each space  When cifsd is launched, kcifsd is activated  They exchange information necessary for each other SMB VFS SERVER Engine KERNEL SHARE ID/PW DCERPC MANAGEMENT MANAGEMENT USER

  11. Architecture  How to communicate between kernel and userspace  Use Netlink interface  Specify a few commands Name Purpose CIFSD_EVENT_HEARTBEAT_REQUEST Monitor cifsd is alive CIFSD_EVENT_STARTING_UP Transfer the initial information necessary CIFSD_EVENT_SHUTTING_DOWN for the start and shutdown CIFSD_EVENT_LOGIN_REQUEST Transfer the user account / password CIFSD_EVENT_LOGIN_RESPONSE information necessary for login CIFSD_EVENT_SHARE_CONFIG_REQUEST Transfer the share configuration CIFSD_EVENT_SHARE_CONFIG_RESPONSE CIFSD_EVENT_TREE_CONNECT_RESPONSE Transfer the tree connect info CIFSD_EVENT_TREE_DISCONNECT_REQUEST CIFSD_EVENT_RPC_REQUEST Transfer DCERPC requests CIFSD_EVENT_RPC_RESPONSE

  12. Architecture cifsadmin cifspwd.db ( ID/PW file ) smb.conf ( config file ) DCE/RPC Share configuration ID/PW configuration cifsd NETLINK/SYSFS Interface kcifsd/0 (forker thread) Authentication kcifsd/ 1 C NTLM NTLMv2 L kcifsd/ 2 Kerberous I SOCKET Dialects E (445) SMB1 SMB2 V N Local F SMB2.1 SMB3 T Filesystem S kcifsd/ N SMB3.1.1

  13. Architecture  KCIFSD Components NETLINK INTERFACE KCIFSD EXT4 TRANSPORT SMB Engine VFS CACHE(File, IPC Virtual Filesystem INODE) SOCKET SERVER Oplock/lease XFS VFS ABSTRACTION TRANSPORT AUTH TCP NTFS KERNEL

  14. Architecture  Minimum DCERPC implementation  The parameter format of smb.conf  compatible with samba’s one  Minimum implementation  List up of supported parameters in smb.conf.example  SMB1 is disable at default  Smart phone apps(ES File Explorer) support only SMB1  Can easily remove it when merging into mainline

  15. Performance comparison  Tool : Iozone, fileop, bench-oplock(smbtorture)  Mount share tmpfs  Direct connection on two PC  Oplock / lease is disable  SMB client is a kernel cifs

  16. Performance comparison Single Writer Iozone Throught 100000 80000 Kilobyte /second 60000 samba write cifsd write 40000 20000 0 4 8 16 32 64 128 Record length (KB)

  17. Performance comparison Single Reader Iozone Throught 90000 80000 70000 Kilobyte/second 60000 50000 samba read 40000 cifsd read 30000 20000 10000 0 4 8 16 32 64 128 Record length (KB)

  18. Fileops Result 4500 4000 3500 3000 2500 Ops/second samba 2000 cifsd 1500 1000 500 0

  19. File lookup Performance(ls – l) 1400 1200 1000 Time (millisecond) 800 samba 600 cifsd 400 200 0 1000 5000 10000 50000 Number of files

  20. Bench oplock 1800 1600 1400 1200 1000 /second samba 800 cifsd Ops/s 600 400 200 0 bench-oplock

  21. Compatibility SMB CLIENT VERSIONS CIFSD SUPPORTED Windows XP (SMB 1.0)  Windows Vista (SMB 2 .0)  Windows 7 (SMB 2.1)  Windows 8 (SMB 3.0)  Windows 10 (SMB 3.1.1)  MacOS(~ High Sierra)  Ubuntu File Explorer  Linux CIFS Client(linux 4.16) 

  22. Stability SMB TORTURE(SMB2/3) 5% PASS FAIL XFSTESTS(SMB2/3) 95% 3 PASS FAIL 97%

  23. Plan  SMB Direct Support (~ Sep)  Writing by Hyunchul Lee(LGE)  Share the status at SDC 2019  Oplock/Lease is enable at default  Send the patch-set to LKML(~ Sep)

  24. Proposal  How about make kcifsd & samba running together ?

  25. Proposal  Define new parameter in smb.conf  Kcifsd can be a kernel helper of samba  Use SMBDirect in kcifsd through ioctl or netlink

  26. Thank you!

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend