[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3763055.1679676470@warthog.procyon.org.uk>
Date: Fri, 24 Mar 2023 16:47:50 +0000
From: David Howells <dhowells@...hat.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: dhowells@...hat.com, willy@...radead.org, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
viro@...iv.linux.org.uk, hch@...radead.org, axboe@...nel.dk,
jlayton@...nel.org, brauner@...nel.org,
torvalds@...ux-foundation.org, netdev@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-crypto@...r.kernel.org
Subject: Re: [RFC PATCH 23/28] algif: Remove hash_sendpage*()
Herbert Xu <herbert@...dor.apana.org.au> wrote:
> David Howells <dhowells@...hat.com> wrote:
> > Remove hash_sendpage*() and use hash_sendmsg() as the latter seems to just
> > use the source pages directly anyway.
>
> ...
>
> > - if (!(flags & MSG_MORE)) {
> > - if (ctx->more)
> > - err = crypto_ahash_finup(&ctx->req);
> > - else
> > - err = crypto_ahash_digest(&ctx->req);
>
> You've just removed the optimised path from user-space to
> finup/digest. You need to add them back to sendmsg if you
> want to eliminate sendpage.
I must be missing something, I think. What's particularly optimal about the
code in hash_sendpage() but not hash_sendmsg()? Is it that the former uses
finup/digest, but the latter ony does update+final?
Also, looking at:
if (!ctx->more) {
if ((msg->msg_flags & MSG_MORE))
hash_free_result(sk, ctx);
how is ctx->more meant to be interpreted? I'm guessing it means that we're
continuing to the previous op. But we do we need to free any old result if
MSG_MORE is set, but not if it isn't?
David
Powered by blists - more mailing lists