From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 28 Aug 2001 12:26:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 28 Aug 2001 12:26:23 -0400 Received: from bacchus.veritas.com ([204.177.156.37]:47300 "EHLO bacchus-int.veritas.com") by vger.kernel.org with ESMTP id ; Tue, 28 Aug 2001 12:26:11 -0400 Date: Tue, 28 Aug 2001 17:27:52 +0100 (BST) From: Hugh Dickins To: Rik van Riel cc: Marcelo Tosatti , Ingo Molnar , lkml Subject: Re: find_get_swapcache_page() question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Aug 2001, Rik van Riel wrote: > On Tue, 28 Aug 2001, Hugh Dickins wrote: > > > if (!PageSwapCache(found)) > > BUG(); > > if (found->mapping != &swapper_space) > > BUG(); > > are not safe, since there may a concurrent remove_from_swap_cache(), > > either from try_to_unuse() or from Rik's new vm_swap_full() deletion. > > Those tests would be safe if the page were locked, but it's not. > > vm_swap_full() is called with the page locked, > remove_from_swap_cache() also seems to want the > page locked... Certainly (I seem to recall composing a comment to that effect recently :-)! Sorry for being unclear, I meant that those tests in lookup_swap_cache() are made without the page being locked by lookup_swap_cache() or its caller (and I'm not proposing that the page should be locked, but the unsafe tests removed). Hugh