From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752149AbWFWWoY (ORCPT ); Fri, 23 Jun 2006 18:44:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752150AbWFWWoY (ORCPT ); Fri, 23 Jun 2006 18:44:24 -0400 Received: from amsfep17-int.chello.nl ([213.46.243.15]:46245 "EHLO amsfep12-int.chello.nl") by vger.kernel.org with ESMTP id S1752149AbWFWWoX (ORCPT ); Fri, 23 Jun 2006 18:44:23 -0400 Subject: Re: [PATCH] mm: tracking shared dirty pages -v10 From: Peter Zijlstra To: Linus Torvalds Cc: Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , David Howells , Christoph Lameter , Martin Bligh , Nick Piggin In-Reply-To: References: <20060619175243.24655.76005.sendpatchset@lappy> <20060619175253.24655.96323.sendpatchset@lappy> <1151019590.15744.144.camel@lappy> <1151100017.30819.50.camel@lappy> Content-Type: text/plain Date: Sat, 24 Jun 2006 00:44:18 +0200 Message-Id: <1151102659.30819.55.camel@lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2006-06-23 at 15:35 -0700, Linus Torvalds wrote: > On Sat, 24 Jun 2006, Peter Zijlstra wrote: > > > > > + if ((pgprot_val(vma->vm_page_prot) == pgprot_val(vm_page_prot) && > > > > + ((vm_flags & (VM_WRITE|VM_SHARED|VM_PFNMAP|VM_INSERTPAGE)) == > > > > + (VM_WRITE|VM_SHARED)) && > > > > + vma->vm_file && vma->vm_file->f_mapping && > > > > + mapping_cap_account_dirty(vma->vm_file->f_mapping)) || > > > > + (vma->vm_ops && vma->vm_ops->page_mkwrite)) > > > > + vma->vm_page_prot = > > > > + protection_map[vm_flags & (VM_READ|VM_WRITE|VM_EXEC)]; > > > > + > > > > > > I'm dazzled by the beauty of it! > > > > It's a real beauty isn't it :-) > > Since Hugh pointed that out.. > > It really would be nice to just encapsulate that as an inline function of > its own, and move the comment at the top of it to be at the top of the > inline function. Dang, I just send out -v11, awell such is life. I'll see what I can do. Preferably mprotect can reuse that same function. Will repost a new 1/5 shortly. Peter