Re: [PATCH rdma-next] RDMA/uverbs: Optimize clearing of extra bytes in response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 10, 2018 at 07:00:12PM +0000, Jason Gunthorpe wrote:
> On Mon, Dec 10, 2018 at 11:35:34AM +0200, Leon Romanovsky wrote:
> > +	if (resp_len < attrs->ucore.outlen)
> > +		/*
> > +		 * Zero fill any extra memory that user
> > +		 * space might have provided.
> > +		 */
> > +		ret = clear_user(attrs->ucore.outbuf + resp_len,
> > +				 attrs->ucore.outlen - resp_len);
> >
> > -	return 0;
> > +	return (ret) ? -EFAULT : 0;
>
> This would be nicer to stay as return 0 so we don't have to have extra
> branches on the fast path. Code is clearer that way too..

I don't see usage of this function in "fast path", only in our standard
control verbs which are far to be optimized for the speed.

Let's try to avoid premature optimization and I disagree with second
part of the question too :)

>
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux