From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [ofa-general] Re: [patch 3/6] mmu_notifier: invalidate_page callbacks Date: Sat, 16 Feb 2008 21:54:41 +0200 Message-ID: <47B73F81.7090907@qumranet.com> References: <20080215064859.384203497@sgi.com> <20080215064932.918191502@sgi.com> <20080215193736.9d6e7da3.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: steiner@sgi.com, Andrea Arcangeli , Peter Zijlstra , linux-mm@kvack.org, Izik Eidus , Kanoj Sarcar , Roland Dreier , linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net, daniel.blueman@quadrics.com, Robin Holt , general@lists.openfabrics.org, Andrew Morton To: Christoph Lameter Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: general-bounces@lists.openfabrics.org Errors-To: general-bounces@lists.openfabrics.org List-Id: kvm.vger.kernel.org Christoph Lameter wrote: > On Fri, 15 Feb 2008, Andrew Morton wrote: > > >>> @@ -287,7 +288,8 @@ static int page_referenced_one(struct pa >>> if (vma->vm_flags & VM_LOCKED) { >>> referenced++; >>> *mapcount = 1; /* break early from loop */ >>> - } else if (ptep_clear_flush_young(vma, address, pte)) >>> + } else if (ptep_clear_flush_young(vma, address, pte) | >>> + mmu_notifier_age_page(mm, address)) >>> referenced++; >>> >> The "|" is obviously deliberate. But no explanation is provided telling us >> why we still call the callback if ptep_clear_flush_young() said the page >> was recently referenced. People who read your code will want to understand >> this. >> > > Andrea? > > I'm not Andrea, but the way I read it, ptep_clear_flush_young() and ->age_page() each have two effects: check whether the page has been referenced and clear the referenced bit. || would retain the semantics of the check but lose the clearing. | does the right thing. -- Any sufficiently difficult bug is indistinguishable from a feature.