From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751085AbcG3GZS (ORCPT ); Sat, 30 Jul 2016 02:25:18 -0400 Received: from mout.web.de ([217.72.192.78]:56272 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbcG3GZM (ORCPT ); Sat, 30 Jul 2016 02:25:12 -0400 Subject: Re: [lustre-devel] staging: lustre: One function call less in class_register_type() after error detection To: Oleg Drokin References: <566ABCD9.1060404@users.sourceforge.net> <566D7733.1030102@users.sourceforge.net> <56784D83.7080108@users.sourceforge.net> <56784F0C.6040007@users.sourceforge.net> <20151221234857.GA27079@kroah.com> <59d94e70-7476-728e-5f63-013557ec2db9@users.sourceforge.net> <0f9ecc7c-f98a-0296-563b-6fcfab459c31@users.sourceforge.net> <2BFF8460-ECEA-470D-ACD6-A9D7E540FE33@intel.com> Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, LKML , Julia Lawall , Bhumika Goyal , lustre-devel@lists.lustre.org From: SF Markus Elfring Message-ID: <061d83fa-b1e6-651e-ccfe-c95544ae8bd2@users.sourceforge.net> Date: Sat, 30 Jul 2016 08:24:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:/PyrLE596YwLxZRLBWuyNUj6pfCXTSXyjQa1uh3Jz6HtNjqW7eK +vPmXOclzQkMicXvM/m518MTu+M64PABKj3HjQZSYaGQ3mW/5HQMJODEefU3/ySWVWijJjo 6KSngDYtJYr+lnva6Hms3xCbGAaO29hCQ25wmH322tQ2N3Z7hMfOx0COv5DGtTkcKhq94vW e9W/r4q38xqTTFT5uCl3g== X-UI-Out-Filterresults: notjunk:1;V01:K0:lOS9IKGoxgY=:WoWwSbb3dRNXelItH7Ai7U tJ818PIfipD/vhPKCgHNMcWfJuB9XTbTpPhyZA9miI4gnOqcdqUjTcSpG8q3puiWULcnmIlX3 WuWe/Q3GMoQ/yje4PeAQa1amUSHFSRW6xHz3EL4JN3SZ0N6Rr0CNyWlEM3izDR6YZBI/356Mj xkaCgh8neuvcI/FkZ4FSUD7VIN4rZ/h5vj96bzwV8+9sBaozuIQYE5ORHTvtv3Vy45zKrW5+B OuDxPclj8hW/8yL1+P9rT8KnHaI4URSdQRSp/o1AtfbC6QuHm34qFWwmr3hYYir6QU8bwR9+E wEIVkqE1SUrVU+UF2rJMaybS8yn/fPILye+BehHtY+cXg3RaHHavLO5FOTkX2sFkA8InrNsLb n+8L+udkAqUD7daIClJYGz0XJw+kKC3vFvn8yX3bpnbJew02EofipseRassZ+mERbuxc9tFTq Mk5K2FrzfMqS2NhhRdac1rE0hEB0HBQTkfwiCO/aJ1W4Rvb6cXSCM3JUimARdrNyKS0ojK3lq Vqq88oQ+YqtKedfJRsXR1tmIZjRf+7pDAuuQOe1D+FJM8tZUAVJmif/k0i0mzt00Z/sqkcufK wdOVOe2AoJKKP/yg00gLtOdAQW5T1XMk2Rc/C6Psq2voKunDyckf/d9DYyCHG2JXr4b3nt2se BOKHDvVp/N43N8+XsVhQW7T+KMgrlKfRcPNIzDDlf1vRbdLe9V5XrgKbYmqLeCrNYQBDH3LqZ lfo7/LHygc8JH/G8O4IFn56yv+9BwUMT8zZ8qd9SgmQJ73BMbBEJU+xwYtRcbrJM/8vFb7NV1 9P0ijKK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > In typical deployments outside of testing environment, this function is > called 5 times every system boot and never again. Does this information mean that a bit more fine-tuning is insignificant at such a source code place? >> Did the assignment for the local variable "rc" with a well-known error code >> influence the run-time characteristics in unwanted ways? >> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/staging/lustre/lustre/obdclass/genops.c?id=6a5b99a46bedc2cfbba96dec6d255c4b90af9ff8#n140 > > I am not sure what do you mean here. I suggest to take another look at corresponding implementation details. An error code is assigned to the variable "rc" before four memory allocations succeeded so far. We hope that this function will usually return zero as a constant for the indication of a successful execution. I find that this variable should not be touched in the preferred case. Will such an unnecessary assignment reduce the execution speed a bit for the desired file system initialisation? Regards, Markus