From owner-svn-src-head@freebsd.org Mon Mar 4 14:30:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB3A1513422; Mon, 4 Mar 2019 14:30:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84AE46CBD1; Mon, 4 Mar 2019 14:30:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x24EULwP043485 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 Mar 2019 16:30:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x24EULwP043485 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x24EULJ9043483; Mon, 4 Mar 2019 16:30:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Mar 2019 16:30:21 +0200 From: Konstantin Belousov To: Edward Napierala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344758 - in head/sys/fs: nfs nfsserver Message-ID: <20190304143021.GO68879@kib.kiev.ua> References: <201903041302.x24D2aG0093620@repo.freebsd.org> <20190304132021.GN68879@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2019 14:30:33 -0000 On Mon, Mar 04, 2019 at 01:31:37PM +0000, Edward Napierala wrote: > pon., 4 mar 2019 o 13:20 Konstantin Belousov napisaƂ(a): > > > + p = curthread; > > Why do you name it 'p', which is typical for process, and not 'td', you are > > changing most of the code anyway. > > To keep the diff size smaller. You're right, this touches a lot of stuff, > but most of those added lines are temporary anyway - they will be > removed later, when the td is pushed down even more. But if you create code churn, doing it only half way is worse. > > > Also I am curious why. It is certainly fine to remove td when it is used > > as a formal placeholder argument only. But when the first action in the > > function is evaluation of curthread() it becomes less obvious. > > Again, many/most of those are temporary. I'm trying to push td down > in small steps, "layer by layer", so it's easy to review. > > > curthread() become very cheap on modern amd64, I am not so sure about > > older machines or non-x86 cases. > > The main reason is readability. Right now there's no easy way to tell whether > a function can be passed any td, or if it must be curthread. I must admit that this is the weirdnest argument against 'td' that I ever heard. I saw more or less reasonable argumentation - that using less arguments make one more register for argument passing (amd64 has 6 input arg regs), - that less arguments make smaller call code. But trust me, in all cases where function can take td != curthread, it is either obvious or well-known for anybody who works with that code. Before you start doing a lot of small changes (AKA continous churn) please formulate your goals and get some public feedback. My immediate question that I want answered before you ever start touching the code, is what you plan to do with sys_syscall(struct thread *td, uap)