linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] target/file: don't zero iter before iov_iter_bvec
Date: Sat, 9 Jan 2021 20:37:17 +0000	[thread overview]
Message-ID: <4d063dde-c710-44e3-31b9-8fb6b7e1d952@gmail.com> (raw)
In-Reply-To: <BYAPR04MB4965F4DCF59E5225CF17322D86AD0@BYAPR04MB4965.namprd04.prod.outlook.com>

On 09/01/2021 20:09, Chaitanya Kulkarni wrote:
> On 1/9/21 07:59, Pavel Begunkov wrote:
>> iov_iter_bvec() initialises iterators well, no need to pre-zero it
>> beforehand as done in fd_execute_rw_aio(). Compilers can't optimise it
>> out and generate extra code for that (confirmed with assembly).
> It will be great if we can quantify this optimization with the actual
> performance
> numbers.

I expect you won't find any, but such little things can pile up
into a not-easy-to-spot overhead over time.

In any case, I don't think this requires performance justification
because it neither makes it less safe or uglier. Those iov_iter*()
are there to handle initialisation, that's a part of the iter API.

>> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>> ---
>>  drivers/target/target_core_file.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
>> index cce455929778..5a66854def95 100644
>> --- a/drivers/target/target_core_file.c
>> +++ b/drivers/target/target_core_file.c
>> @@ -267,7 +267,7 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
>>  	struct fd_dev *fd_dev = FD_DEV(dev);
>>  	struct file *file = fd_dev->fd_file;
>>  	struct target_core_file_cmd *aio_cmd;
>> -	struct iov_iter iter = {};
>> +	struct iov_iter iter;
>>  	struct scatterlist *sg;
>>  	ssize_t len = 0;
>>  	int ret = 0, i;
> 

-- 
Pavel Begunkov

  reply	other threads:[~2021-01-09 20:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09 15:53 [PATCH] target/file: don't zero iter before iov_iter_bvec Pavel Begunkov
2021-01-09 20:09 ` Chaitanya Kulkarni
2021-01-09 20:37   ` Pavel Begunkov [this message]
2021-01-09 20:52     ` Chaitanya Kulkarni
2021-01-09 21:25       ` Pavel Begunkov
2021-01-11  2:06         ` Chaitanya Kulkarni
2021-01-11  2:28           ` Pavel Begunkov
2021-01-11  5:23             ` Chaitanya Kulkarni
2021-01-11  5:31               ` Pavel Begunkov
2021-01-11  2:49 ` Bart Van Assche
2021-01-13  5:34 ` Martin K. Petersen
2021-01-15  4:08 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d063dde-c710-44e3-31b9-8fb6b7e1d952@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).