Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757740AbcJQHkN (ORCPT ); Mon, 17 Oct 2016 03:40:13 -0400 Received: from mout.web.de ([212.227.15.4]:55534 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757544AbcJQHkE (ORCPT ); Mon, 17 Oct 2016 03:40:04 -0400 Subject: Re: MD-RAID: Use seq_putc() in three status functions? To: Hannes Reinecke References: <566ABCD9.1060404@users.sourceforge.net> <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> <92c52f1d-d151-cea6-e9ac-31378e6862d0@users.sourceforge.net> <1475771699.1914.10.camel@perches.com> <77fb6fdc-7480-8607-0af1-42f73c125b9d@users.sourceforge.net> <688764a4-072d-2faf-37ba-a222b190a5d9@suse.de> <59d71170-c48d-a084-c748-b6ab74a2bee4@users.sourceforge.net> <1e151094-e228-5307-ae2f-b376b31f5628@suse.de> Cc: linux-raid@vger.kernel.org, Christoph Hellwig , Guoqing Jiang , Jens Axboe , Joe Perches , Mike Christie , Neil Brown , Shaohua Li , Tomasz Majchrzak , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <83e720c6-9037-a3c1-6e83-27505805f37f@users.sourceforge.net> Date: Mon, 17 Oct 2016 09:39:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1e151094-e228-5307-ae2f-b376b31f5628@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Q4RJ43BotZifKRSbrs/l4tD+htimCZEd0eLeW9ywO1GOJIoMNQ/ LCyfKbmo+nprexH5PRv622xTDakm4rT4oxgZZ+UyayhGcHiYh9zxWInCDgZ8wcuAT9oOlLL Q0Niabl2nQxVTv6lQHtYJXF3BKzuLKJgNNOA3dALxiCI2eYMjjrMajsyZwuplx59aAH8AW0 ru54FzyfHu5/1sF1GoUPg== X-UI-Out-Filterresults: notjunk:1;V01:K0:QwPEgnzw0cU=:7G0CFlGuF6SkdENdkr5/+3 L4JlotKlQOBuNMoq1uaXLMEvhFLt1Iy8s3cMe8hxn5zoaw7JDPxbLXgyqZeCXUxJFh4fmJDYT q7fyXAqYtm5mzRMKP8tkpzT6DR9sjvK85lBJI5bZGhWipcDOauF+pkvh/HfrG5MmUUiXz8s+5 nYQasCna2I/L4u2enkgLXLBb9tpifnmUK6tk6lx8FXyMyo2oYN336NbOnxravWoNqSJzLxfpa 693zdiGQLyHGWqU2vmfrivzaPCvvLQ6zqAf8dP2Y8LdKHlL49Tb/gVi/tw0nwaxdfMHn8hATb brE/yGYOM7pWWz9iMCaphqCQDNiUQVTdFqtt4a3OQOISIUkouq4xEllBCjJm5eX9m5npghjHD 2BIfiyW1EYYePpDv9KTidTtEhmZW05LzxgWgg19JOL83GDaliJ9Syyz6ZzQxSrfqxnc6rjOA5 XbKunpTMmEW8P0mbMaCaUwdqlf6QSwyBxFt6aae2KC59xS/VizButituql++LuYE82fyopJlD IT03DbRo480jX6PUoGoAUh7YtYw/Vq3j270ve82yCClZ1lHGtxaFzyQ8zYreQZ6l+dGR4uA2u IyIV/Hjq2FWJJbHFCZKYhctwo8U/Hgx0+0tvlnz5Op/ngYYZFpngivY7/G6iASwSW5YeiakKh W/x7Lv7aweAqOQNNAGwC/pKPCijlvAt4q20WHeJKXwJhz+gKr6cWRC9SpwOc+FCy5PZasH8Wv iN+Q/c0T9VU3Tcqkx21VrIy43uocIk6YzkCFEdebSyF1ZkCDbsF3wRf8zQOP+GA+sSrwsvaeJ nb2fOmm Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 54 >>> Does it improve code? Does it improve anything? >> >> Yes. - I got such an impression. >> >> * Is it more efficient to call the function "seq_printf" for the desired data processing >> for a single character than to pass it to the function "" in a string? >> >> * Will the required data transfer shrink a bit for the affected functions because of >> such a change? >> > Which are questions _you_ should be able to answer. I wonder that the answers are not obvious for you already. Calling the function "seq_putc" will be more efficient than "seq_printf" in this case because of the following reasons. 1. How does the distribution look like for supported processor architectures where the data transfer for bytes (as a function call parameter) is faster than for (string) pointers? 2. Did anybody measure already how many the execution times can vary for these functions? 3. seq_printf() provides more functionality as this kind of programming interface was designed for a bigger purpose. How much do you care for consequences when such general functions are called with input data they were not designed for mainly? 4. The seq_putc() implementation is so simple. http://lxr.free-electrons.com/source/fs/seq_file.c?v=4.8#L657 Where do you get doubts about its efficiency for the data processing of a single character? > It's your patch, after all. Yes. - I published a special update suggestion once again. > Once you do (and prove that the answer is 'yes' to the above two > questions) the patch will be applied. How do you think about to share a bit more from your software development and testing experience? Which call frequencies do you observe for the affected functions? 1. raid1_status 2. raid10_status 3. raid5_status Regards, Markus