From owner-freebsd-hackers Thu Oct 25 8:29:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from gull.prod.itd.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id AA8C837B401 for ; Thu, 25 Oct 2001 08:29:54 -0700 (PDT) Received: from dialup-209.244.104.103.dial1.sanjose1.level3.net ([209.244.104.103] helo=mindspring.com) by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 15wmS8-00068d-00; Thu, 25 Oct 2001 08:29:52 -0700 Message-ID: <3BD83020.E1CD620F@mindspring.com> Date: Thu, 25 Oct 2001 08:30:40 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "Ilmar S. Habibulin" Cc: freebsd-hackers@freebsd.org Subject: Re: how can i wipeout swap pages? References: <20011024044458.U45888-100000@fledge.watson.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Ilmar S. Habibulin" wrote: > > I'm trying to implement wiping of freed swap pages inside swap_pager. > I'm using 2.2-branch, here is my thoughts and steps: > > I have a (starting) block number of swapped page, i know page size, and i > know that i have to use some pool of buffers inside kernel. So i get > buffer with getpbuf(), then fill in b_data, b_blkno, b_bcount, b_bufsize, > b_proc and b_flags fields and call pbgetvp(swapdev_vp,bp) and > VOP_STRATEGY(bp). Then i analize error flag in b_flags and call > pbrelvp(bp) and relpbuf(bp). This code was copied from > getpages/putpages routines, but it hangs kernel and PC. So i misunderstand > something and need help. How can i successfully write down some data to > the known block number on the known device from the kernel? Or maybe > someone can point me where can i find more information on I/O in kernel? Free swap pages are reclaimed asynchronously in the idle loop (where they are zeroed). To do what you want, which is to clean the backing pages, you are better off doing it for all freed blocks, not just swap blocks (if someone can read your swap, they can read other data off your unallocated disk blocks from the FS, as well). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message