From: David Howells <dhowells@redhat.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: dhowells@redhat.com, willy@infradead.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
viro@zeniv.linux.org.uk, hch@infradead.org, axboe@kernel.dk,
jlayton@kernel.org, brauner@kernel.org,
torvalds@linux-foundation.org, netdev@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, linux-crypto@vger.kernel.org
Subject: Re: [RFC PATCH 23/28] algif: Remove hash_sendpage*()
Date: Fri, 24 Mar 2023 16:47:50 +0000 [thread overview]
Message-ID: <3763055.1679676470@warthog.procyon.org.uk> (raw)
In-Reply-To: <ZBPTC9WPYQGhFI30@gondor.apana.org.au>
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> David Howells <dhowells@redhat.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
next parent reply other threads:[~2023-03-24 16:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ZB6N/H27oeWqouyb@gondor.apana.org.au>
[not found] ` <ZBPTC9WPYQGhFI30@gondor.apana.org.au>
2023-03-24 16:47 ` David Howells [this message]
2023-03-25 7:44 ` David Howells
2023-03-16 15:25 [RFC PATCH 00/28] splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES) David Howells
2023-03-16 15:26 ` [RFC PATCH 23/28] algif: Remove hash_sendpage*() David Howells
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=3763055.1679676470@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hch@infradead.org \
--cc=herbert@gondor.apana.org.au \
--cc=jlayton@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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