lkml.org 
[lkml]   [2008]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 3/6] mmu_notifier: invalidate_page callbacks
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.



\
 
 \ /
  Last update: 2008-02-16 20:59    [W:0.087 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site