Skip to content

Commit

Permalink
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu in…
Browse files Browse the repository at this point in the history
…to staging

Pull request

I was too quick in sending the coroutine pool sizing change for -rc0 and still
needed to address feedback from Daniel Berrangé.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmX8bOUACgkQnKSrs4Gr
# c8hcHAf/cWacqq8B6fiUVszTHBZuvOn+curY0JGjwA6D1yeWmUVkn4xk06GYA8Zc
# wrm5jTy9nznt/Es9V8DyOCgYAPyKgDsavP1uuPjLTtJnA1lXgdrjfUi7Swd4B+5r
# rBb+WJZXa9sGM8uy2wcPxTFmIgYT7u2/b8JaOnUDBIIdvhmyOBJZTOnfRzh9xCz/
# 0vmPseq7qgWJohzpx5AVcxT3BP1cRCmOw6sKyHTdughLj+DOqg0maKamLzwBnnqC
# gdJBbplXnCH+Xz4jQ9JkzV6EWOq3MxcFFszvt8Zm3OjauSKOjTyrzUNRCZcoImYh
# Ft0A5SIla3aRN+smoXC/LBKs2HnYUg==
# =CNpd
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 21 Mar 2024 17:22:45 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  coroutine: reserve 5,000 mappings

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Mar 22, 2024
2 parents fea445e + 9352f80 commit 6a91e62
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions util/qemu-coroutine.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,17 @@ static unsigned int get_global_pool_hard_max_size(void)
NULL) &&
qemu_strtoi(contents, NULL, 10, &max_map_count) == 0) {
/*
* This is a conservative upper bound that avoids exceeding
* max_map_count. Leave half for non-coroutine users like library
* dependencies, vhost-user, etc. Each coroutine takes up 2 VMAs so
* halve the amount again.
* This is an upper bound that avoids exceeding max_map_count. Leave a
* fixed amount for non-coroutine users like library dependencies,
* vhost-user, etc. Each coroutine takes up 2 VMAs so halve the
* remaining amount.
*/
return max_map_count / 4;
if (max_map_count > 5000) {
return (max_map_count - 5000) / 2;
} else {
/* Disable the global pool but threads still have local pools */
return 0;
}
}
#endif

Expand Down

0 comments on commit 6a91e62

Please sign in to comment.