summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-08-22 11:18:47 +0000
committerkib <kib@FreeBSD.org>2011-08-22 11:18:47 +0000
commit1d94389f8f3e368db05482320ee08c9b33ef48da (patch)
tree83c688d3ebdd214fdd49d52c7db81de6bc93324c /sys/vm
parentee4d73add41ff99c62ad98f1f448e6078d5cafe8 (diff)
downloadFreeBSD-src-1d94389f8f3e368db05482320ee08c9b33ef48da.zip
FreeBSD-src-1d94389f8f3e368db05482320ee08c9b33ef48da.tar.gz
Apply the limit to avoid the overflows in the radix tree subr_blist.c
after the conversion of the swap device size to the page size units, not before. That lifts the limit on the usable swap partition size from 32GB to 256GB, that is less depressing for the modern systems. Submitted by: Alexander V. Chernikov <melifaro ipfw ru> Reviewed by: alc Approved by: re (bz) MFC after: 2 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 9a818e7..2dd678b 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2133,16 +2133,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strateg
u_long mblocks;
/*
- * If we go beyond this, we get overflows in the radix
- * tree bitmap code.
- */
- mblocks = 0x40000000 / BLIST_META_RADIX;
- if (nblks > mblocks) {
- printf("WARNING: reducing size to maximum of %lu blocks per swap unit\n",
- mblocks);
- nblks = mblocks;
- }
- /*
* nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks.
* First chop nblks off to page-align it, then convert.
*
@@ -2151,6 +2141,18 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strateg
nblks &= ~(ctodb(1) - 1);
nblks = dbtoc(nblks);
+ /*
+ * If we go beyond this, we get overflows in the radix
+ * tree bitmap code.
+ */
+ mblocks = 0x40000000 / BLIST_META_RADIX;
+ if (nblks > mblocks) {
+ printf(
+ "WARNING: reducing swap size to maximum of %luMB per unit\n",
+ mblocks / 1024 / 1024 * PAGE_SIZE);
+ nblks = mblocks;
+ }
+
sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO);
sp->sw_vp = vp;
sp->sw_id = id;
OpenPOWER on IntegriCloud