git: f5c894479e59 - main - Revert "Avoid division in round_up."

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Thu, 25 Jul 2024 23:11:27 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=f5c894479e5986323a0d5a5a698c7d2177eec20f

commit f5c894479e5986323a0d5a5a698c7d2177eec20f
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-07-25 23:10:44 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-07-25 23:11:11 +0000

    Revert "Avoid division in round_up."
    
    This reverts commit 2b229739e7ca43b36e53f47147ac05a91333f7b9.
    
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1343
---
 lib/libthr/thread/thr_stack.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c
index ab3b73085bb5..f576a2c04104 100644
--- a/lib/libthr/thread/thr_stack.c
+++ b/lib/libthr/thread/thr_stack.c
@@ -126,7 +126,10 @@ static char *last_stack = NULL;
 static inline size_t
 round_up(size_t size)
 {
-	return (roundup2(size, _thr_page_size - 1));
+	if (size % _thr_page_size != 0)
+		size = ((size / _thr_page_size) + 1) *
+		    _thr_page_size;
+	return size;
 }
 
 void