Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 12 Sep 2002 18:46:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 12 Sep 2002 18:46:47 -0400 Received: from packet.digeo.com ([12.110.80.53]:4298 "EHLO packet.digeo.com") by vger.kernel.org with ESMTP id ; Thu, 12 Sep 2002 18:46:45 -0400 Message-ID: <3D811A6C.C73FEC37@digeo.com> Date: Thu, 12 Sep 2002 15:51:24 -0700 From: Andrew Morton X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.19-pre4 i686) X-Accept-Language: en MIME-Version: 1.0 To: Rik van Riel CC: Urban Widmark , Chuck Lever , Daniel Phillips , trond.myklebust@fys.uio.no, Linux Kernel Mailing List Subject: Re: invalidate_inode_pages in 2.5.32/3 References: <3D811363.70ABB50C@digeo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Sep 2002 22:51:27.0134 (UTC) FILETIME=[ED4533E0:01C25AAE] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 40 Rik van Riel wrote: > > On Thu, 12 Sep 2002, Andrew Morton wrote: > > > Well the lazy invalidation would be OK - defer that to the next > > userspace access, > > I think I have an idea on how to do that, here's some pseudocode: > > invalidate_page(struct page * page) { > SetPageInvalidated(page); > rmap_lock(page); > for_each_pte(pte, page) { > make pte PROT_NONE; > flush TLBs for this virtual address; > } > rmap_unlock(page); > } > > And in the page fault path: > > if (pte_protection(pte) == PROT_NONE && PageInvalidated(pte_page_pte)) { > clear_pte(ptep); > page_cache_release(page); > mm->rss--; > } > That's the bottom-up approach. The top-down (vmtruncate) approach would also work, if the locking is suitable. Look, idunnoigiveup. Like scsi and USB, NFS is a black hole where akpms fear to tread. I think I'll sulk until someone explains why this work has to be performed in the context of a process which cannot do it. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/