From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 30 Aug 2007 11:36:36 +0100 (BST) From: Hugh Dickins Subject: Re: speeding up swapoff In-Reply-To: Message-ID: References: <1188394172.22156.67.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: "Eric W. Biederman" Cc: Daniel Drake , linux-mm@kvack.org, linux-kernel@vger.kernel.org List-ID: On Thu, 30 Aug 2007, Eric W. Biederman wrote: > > There is one other possibility. Typically the swap code is using > compatibility disk I/O functions instead of the best the kernel > can offer. I haven't looked recently but it might be worth just > making certain that there isn't some low-level optimization or > cleanup possible on that path. Although I may just be thinking > of swapfiles. Andrew rewrote swapfile support in 2.5, making it use FIBMAP at swapon time: so that in 2.6 swapfiles are as deadlock-free and as efficient (unless the swapfile happens to be badly fragmented) as raw disk partitions. There's certainly scope for a study of I/O patterns in swapping, it's hard to imagine that improvements couldn't be made (but also easy to imagine endless disputes over different kinds of workload). But most people would appreciate an improvement in active swapping, and not care very much about the swapoff. Regarding Daniel's use of swapoff: it's a very heavy sledgehammer for cracking that nut, I strongly agree with those who have pointed him to mlock and mlockall instead. Hugh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org