From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0EFBC433B4 for ; Tue, 27 Apr 2021 20:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C772613F9 for ; Tue, 27 Apr 2021 20:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235412AbhD0UyW (ORCPT ); Tue, 27 Apr 2021 16:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239274AbhD0UyQ (ORCPT ); Tue, 27 Apr 2021 16:54:16 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94878C061574; Tue, 27 Apr 2021 13:53:32 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 517BF728D; Tue, 27 Apr 2021 16:53:31 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 517BF728D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1619556811; bh=5ZQPQuFxsL8p1/4VGoLL6WsBT7fTywQ1GIUgUVF5lec=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=z3cr0vjp/pv7UrKkb/9QmeUT/9blZGZODaNPAChaxG+CDObuj+ishlur6hK/qxwbC SqS0MqNzAWgcan9EQmGtzfjtU9ejxGVL+7cHdv5KrqPR/luCQ9NSDqmBGCo7HgCEBp DqCWgdpAe4DrYSJERm9sp/UbCbumPSOtVuxmHwRU= Date: Tue, 27 Apr 2021 16:53:31 -0400 To: Namjae Jeon Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, smfrench@gmail.com, senozhatsky@chromium.org, hyc.lee@gmail.com, viro@zeniv.linux.org.uk, hch@lst.de, hch@infradead.org, ronniesahlberg@gmail.com, aurelien.aptel@gmail.com, aaptel@suse.com, sandeen@sandeen.net, dan.carpenter@oracle.com, colin.king@canonical.com, rdunlap@infradead.org, willy@infradead.org Subject: Re: [PATCH v2 00/10] cifsd: introduce new SMB3 kernel server Message-ID: <20210427205331.GA15168@fieldses.org> References: <20210422002824.12677-1-namjae.jeon@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210422002824.12677-1-namjae.jeon@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 09:28:14AM +0900, Namjae Jeon wrote: > This is the patch series for cifsd(ksmbd) kernel server. > > What is cifsd(ksmbd) ? > ====================== > > The SMB family of protocols is the most widely deployed > network filesystem protocol, the default on Windows and Macs (and even > on many phones and tablets), with clients and servers on all major > operating systems, but lacked a kernel server for Linux. For many > cases the current userspace server choices were suboptimal > either due to memory footprint, performance or difficulty integrating > well with advanced Linux features. > > ksmbd is a new kernel module which implements the server-side of the SMB3 protocol. > The target is to provide optimized performance, GPLv2 SMB server, better > lease handling (distributed caching). The bigger goal is to add new > features more rapidly (e.g. RDMA aka "smbdirect", and recent encryption > and signing improvements to the protocol) which are easier to develop > on a smaller, more tightly optimized kernel server than for example > in Samba. The Samba project is much broader in scope (tools, security services, > LDAP, Active Directory Domain Controller, and a cross platform file server > for a wider variety of purposes) but the user space file server portion > of Samba has proved hard to optimize for some Linux workloads, including > for smaller devices. This is not meant to replace Samba, but rather be > an extension to allow better optimizing for Linux, and will continue to > integrate well with Samba user space tools and libraries where appropriate. > Working with the Samba team we have already made sure that the configuration > files and xattrs are in a compatible format between the kernel and > user space server. > > > Architecture > ============ > > |--- ... > --------|--- ksmbd/3 - Client 3 > |-------|--- ksmbd/2 - Client 2 > | | ____________________________________________________ > | | |- Client 1 | > <--- Socket ---|--- ksmbd/1 <<= Authentication : NTLM/NTLM2, Kerberos | > | | | | <<= SMB engine : SMB2, SMB2.1, SMB3, SMB3.0.2, | > | | | | SMB3.1.1 | > | | | |____________________________________________________| > | | | > | | |--- VFS --- Local Filesystem > | | > KERNEL |--- ksmbd/0(forker kthread) > ---------------||--------------------------------------------------------------- > USER || > || communication using NETLINK > || ______________________________________________ > || | | > ksmbd.mountd <<= DCE/RPC(srvsvc, wkssvc, samr, lsarpc) | > ^ | <<= configure shares setting, user accounts | > | |______________________________________________| > | > |------ smb.conf(config file) > | > |------ ksmbdpwd.db(user account/password file) > ^ > ksmbd.adduser ---------------| > > The subset of performance related operations(open/read/write/close etc.) belong > in kernelspace(ksmbd) and the other subset which belong to operations(DCE/RPC, > user account/share database) which are not really related with performance are > handled in userspace(ksmbd.mountd). > > When the ksmbd.mountd is started, It starts up a forker thread at initialization > time and opens a dedicated port 445 for listening to SMB requests. Whenever new > clients make request, Forker thread will accept the client connection and fork > a new thread for dedicated communication channel between the client and > the server. Judging from the diagram above, all those threads are kernel threads, is that right? So a kernel thread gets each call first, then uses netlink to get help from ksmbd.mountd if necessary, is that right? --b.