* Re: [PATCH net-next v3 05/10] crypto: af_alg: Pin pages rather than ref'ing if appropriate
[not found] ` <20230606130856.1970660-6-dhowells@redhat.com>
@ 2023-06-07 8:40 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:40 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:51PM +0100, David Howells wrote:
> Convert AF_ALG to use iov_iter_extract_pages() instead of
> iov_iter_get_pages(). This will pin pages or leave them unaltered rather
> than getting a ref on them as appropriate to the iterator.
>
> The pages need to be pinned for DIO-read rather than having refs taken on
> them to prevent VM copy-on-write from malfunctioning during a concurrent
> fork() (the result of the I/O would otherwise end up only visible to the
> child process and not the parent).
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
> crypto/af_alg.c | 10 +++++++---
> include/crypto/if_alg.h | 1 +
> 2 files changed, 8 insertions(+), 3 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 06/10] crypto: af_alg: Use extract_iter_to_sg() to create scatterlists
[not found] ` <20230606130856.1970660-7-dhowells@redhat.com>
@ 2023-06-07 8:41 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:41 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:52PM +0100, David Howells wrote:
> Use extract_iter_to_sg() to decant the destination iterator into a
> scatterlist in af_alg_get_rsgl(). af_alg_make_sg() can then be removed.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
>
> Notes:
> ver #2)
> - Fix some checkpatch warnings.
>
> crypto/af_alg.c | 57 +++++++++++------------------------------
> crypto/algif_aead.c | 16 +++++++-----
> crypto/algif_hash.c | 18 +++++++++----
> crypto/algif_skcipher.c | 2 +-
> include/crypto/if_alg.h | 6 ++---
> 5 files changed, 40 insertions(+), 59 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 07/10] crypto: af_alg: Indent the loop in af_alg_sendmsg()
[not found] ` <20230606130856.1970660-8-dhowells@redhat.com>
@ 2023-06-07 8:41 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:41 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:53PM +0100, David Howells wrote:
> Put the loop in af_alg_sendmsg() into an if-statement to indent it to make
> the next patch easier to review as that will add another branch to handle
> MSG_SPLICE_PAGES to the if-statement.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
>
> Notes:
> ver #2)
> - Fix a checkpatch warning.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 08/10] crypto: af_alg: Support MSG_SPLICE_PAGES
[not found] ` <20230606130856.1970660-9-dhowells@redhat.com>
@ 2023-06-07 8:41 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:41 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:54PM +0100, David Howells wrote:
> Make AF_ALG sendmsg() support MSG_SPLICE_PAGES. This causes pages to be
> spliced from the source iterator.
>
> This allows ->sendpage() to be replaced by something that can handle
> multiple multipage folios in a single transaction.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
>
> Notes:
> ver #3)
> - Remove BVEC iter restriction when using MSG_SPLICE_PAGES.
>
> crypto/af_alg.c | 24 ++++++++++++++++++++++--
> crypto/algif_aead.c | 22 +++++++++++-----------
> crypto/algif_skcipher.c | 8 ++++----
> 3 files changed, 37 insertions(+), 17 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 09/10] crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES
[not found] ` <20230606130856.1970660-10-dhowells@redhat.com>
@ 2023-06-07 8:41 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:41 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:55PM +0100, David Howells wrote:
> Convert af_alg_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather
> than directly splicing in the pages itself.
>
> This allows ->sendpage() to be replaced by something that can handle
> multiple multipage folios in a single transaction.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
> crypto/af_alg.c | 52 ++++++++-----------------------------------------
> 1 file changed, 8 insertions(+), 44 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 10/10] crypto: af_alg/hash: Support MSG_SPLICE_PAGES
[not found] ` <20230606130856.1970660-11-dhowells@redhat.com>
@ 2023-06-07 8:48 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2023-06-07 8:48 UTC (permalink / raw
To: David Howells
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn, David Ahern, Matthew Wilcox,
Jens Axboe, linux-crypto, linux-mm, linux-kernel
On Tue, Jun 06, 2023 at 02:08:56PM +0100, David Howells wrote:
> Make AF_ALG sendmsg() support MSG_SPLICE_PAGES in the hashing code. This
> causes pages to be spliced from the source iterator if possible.
>
> This allows ->sendpage() to be replaced by something that can handle
> multiple multipage folios in a single transaction.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Herbert Xu <herbert@gondor.apana.org.au>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: linux-crypto@vger.kernel.org
> cc: netdev@vger.kernel.org
> ---
>
> Notes:
> ver #2)
> - Fixed some checkpatch warnings.
>
> crypto/af_alg.c | 11 +++--
> crypto/algif_hash.c | 100 +++++++++++++++++++++++++++-----------------
> 2 files changed, 70 insertions(+), 41 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 00/10] crypto, splice, net: Make AF_ALG handle sendmsg(MSG_SPLICE_PAGES)
[not found] <20230606130856.1970660-1-dhowells@redhat.com>
` (5 preceding siblings ...)
[not found] ` <20230606130856.1970660-11-dhowells@redhat.com>
@ 2023-06-08 13:40 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-06-08 13:40 UTC (permalink / raw
To: David Howells
Cc: netdev, herbert, davem, edumazet, kuba, pabeni,
willemdebruijn.kernel, dsahern, willy, axboe, linux-crypto,
linux-mm, linux-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 6 Jun 2023 14:08:46 +0100 you wrote:
> Here are patches to make AF_ALG handle the MSG_SPLICE_PAGES internal
> sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol
> that it should splice the pages supplied if it can. The sendpage functions
> are then turned into wrappers around that.
>
> This set consists of the following parts:
>
> [...]
Here is the summary with links:
- [net-next,v3,01/10] Drop the netfs_ prefix from netfs_extract_iter_to_sg()
https://git.kernel.org/netdev/net-next/c/0d7aeb68700f
- [net-next,v3,02/10] Fix a couple of spelling mistakes
https://git.kernel.org/netdev/net-next/c/3b9e9f72badf
- [net-next,v3,03/10] Wrap lines at 80
https://git.kernel.org/netdev/net-next/c/936dc763c52e
- [net-next,v3,04/10] Move netfs_extract_iter_to_sg() to lib/scatterlist.c
https://git.kernel.org/netdev/net-next/c/f5f82cd18732
- [net-next,v3,05/10] crypto: af_alg: Pin pages rather than ref'ing if appropriate
https://git.kernel.org/netdev/net-next/c/f9e7a5fa51fb
- [net-next,v3,06/10] crypto: af_alg: Use extract_iter_to_sg() to create scatterlists
https://git.kernel.org/netdev/net-next/c/c1abe6f570af
- [net-next,v3,07/10] crypto: af_alg: Indent the loop in af_alg_sendmsg()
https://git.kernel.org/netdev/net-next/c/73d7409cfdad
- [net-next,v3,08/10] crypto: af_alg: Support MSG_SPLICE_PAGES
https://git.kernel.org/netdev/net-next/c/bf63e250c4b1
- [net-next,v3,09/10] crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES
https://git.kernel.org/netdev/net-next/c/fb800fa4c1f5
- [net-next,v3,10/10] crypto: af_alg/hash: Support MSG_SPLICE_PAGES
https://git.kernel.org/netdev/net-next/c/c662b043cdca
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-06-08 13:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230606130856.1970660-1-dhowells@redhat.com>
[not found] ` <20230606130856.1970660-6-dhowells@redhat.com>
2023-06-07 8:40 ` [PATCH net-next v3 05/10] crypto: af_alg: Pin pages rather than ref'ing if appropriate Herbert Xu
[not found] ` <20230606130856.1970660-7-dhowells@redhat.com>
2023-06-07 8:41 ` [PATCH net-next v3 06/10] crypto: af_alg: Use extract_iter_to_sg() to create scatterlists Herbert Xu
[not found] ` <20230606130856.1970660-8-dhowells@redhat.com>
2023-06-07 8:41 ` [PATCH net-next v3 07/10] crypto: af_alg: Indent the loop in af_alg_sendmsg() Herbert Xu
[not found] ` <20230606130856.1970660-9-dhowells@redhat.com>
2023-06-07 8:41 ` [PATCH net-next v3 08/10] crypto: af_alg: Support MSG_SPLICE_PAGES Herbert Xu
[not found] ` <20230606130856.1970660-10-dhowells@redhat.com>
2023-06-07 8:41 ` [PATCH net-next v3 09/10] crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES Herbert Xu
[not found] ` <20230606130856.1970660-11-dhowells@redhat.com>
2023-06-07 8:48 ` [PATCH net-next v3 10/10] crypto: af_alg/hash: Support MSG_SPLICE_PAGES Herbert Xu
2023-06-08 13:40 ` [PATCH net-next v3 00/10] crypto, splice, net: Make AF_ALG handle sendmsg(MSG_SPLICE_PAGES) patchwork-bot+netdevbpf
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 read-only IMAP folder(s) and NNTP newsgroup(s).