From owner-freebsd-current Fri Jan 3 11:18:20 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1D6F37B401 for ; Fri, 3 Jan 2003 11:18:18 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0175B43EC2 for ; Fri, 3 Jan 2003 11:18:18 -0800 (PST) (envelope-from phk@freebsd.org) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h03JI7F4078486; Fri, 3 Jan 2003 20:18:14 +0100 (CET) (envelope-from phk@freebsd.org) To: Bruce Evans Cc: current@freebsd.org Subject: Re: aligned_nblks calculations broken in vm_swap.c From: phk@freebsd.org In-Reply-To: Your message of "Sat, 04 Jan 2003 05:46:04 +1100." <20030104053046.A5138-100000@gamplex.bde.org> Date: Fri, 03 Jan 2003 20:18:07 +0100 Message-ID: <78485.1041621487@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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