Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Jan 2003 20:18:07 +0100
From:      phk@freebsd.org
To:        Bruce Evans <bde@zeta.org.au>
Cc:        current@freebsd.org
Subject:   Re: aligned_nblks calculations broken in vm_swap.c 
Message-ID:  <78485.1041621487@critter.freebsd.dk>
In-Reply-To: Your message of "Sat, 04 Jan 2003 05:46:04 %2B1100." <20030104053046.A5138-100000@gamplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030104053046.A5138-100000@gamplex.bde.org>, Bruce Evans writes:
>% Index: vm_swap.c
>% ===================================================================
>% RCS file: /home/ncvs/src/sys/vm/vm_swap.c,v
>% retrieving revision 1.127
>% retrieving revision 1.128
>% diff -u -1 -r1.127 -r1.128
>% --- vm_swap.c	3 Jan 2003 09:55:05 -0000	1.127
>% +++ vm_swap.c	3 Jan 2003 14:30:46 -0000	1.128
>% ...
>% @@ -353,3 +352,3 @@
>%  	 */
>% -	aligned_nblks = (nblks + (dmmax - 1)) & ~(u_long)(dmmax - 1);
>% +	aligned_nblks = (nblks + dmmax_mask) & ~(u_long)dmmax_mask;
>%
>% @@ -472,3 +471,3 @@
>%
>% -	aligned_nblks = (nblks + (dmmax - 1)) & ~(u_long)(dmmax - 1);
>% +	aligned_nblks = (nblks + dmmax_mask) & ~(u_long)dmmax_mask;
>%  	nswap = aligned_nblks * nswdev;
>
>dmmax_mask is ~(dmmax - 1) not (dmmax - 1), so all of these changes are
>wrong.

damn!

Fixed, thanks!

>(Old) related type bugs:

I'm actually more than a bit of mind to rip out the entire bogus
swap-stripe code:  If you want swap on a striped disk, you should
use hardware, controller, vinum, ccd or raidframe to stripe.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?78485.1041621487>