All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andrea Arcangeli <andrea@qumranet.com>, Robin Holt <holt@sgi.com>,
	Izik Eidus <izike@qumranet.com>,
	kvm-devel@lists.sourceforge.net,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	general@lists.openfabrics.org,
	Steve Wise <swise@opengridcomputing.com>,
	Roland Dreier <rdreier@cisco.com>,
	Kanoj Sarcar <kanojsarcar@yahoo.com>,
	steiner@sgi.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, daniel.blueman@quadrics.com
Subject: Re: [patch 3/6] mmu_notifier: invalidate_page callbacks
Date: Sat, 16 Feb 2008 21:54:41 +0200	[thread overview]
Message-ID: <47B73F81.7090907@qumranet.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802161121130.25573@schroedinger.engr.sgi.com>

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.


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: steiner@sgi.com, Andrea Arcangeli <andrea@qumranet.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-mm@kvack.org, Izik Eidus <izike@qumranet.com>,
	Kanoj Sarcar <kanojsarcar@yahoo.com>,
	Roland Dreier <rdreier@cisco.com>,
	linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net,
	daniel.blueman@quadrics.com, Robin Holt <holt@sgi.com>,
	general@lists.openfabrics.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [ofa-general] Re: [patch 3/6] mmu_notifier: invalidate_page callbacks
Date: Sat, 16 Feb 2008 21:54:41 +0200	[thread overview]
Message-ID: <47B73F81.7090907@qumranet.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802161121130.25573@schroedinger.engr.sgi.com>

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.

WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@qumranet.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andrea Arcangeli <andrea@qumranet.com>, Robin Holt <holt@sgi.com>,
	Izik Eidus <izike@qumranet.com>,
	kvm-devel@lists.sourceforge.net,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	general@lists.openfabrics.org,
	Steve Wise <swise@opengridcomputing.com>,
	Roland Dreier <rdreier@cisco.com>,
	Kanoj Sarcar <kanojsarcar@yahoo.com>,
	steiner@sgi.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, daniel.blueman@quadrics.com
Subject: Re: [patch 3/6] mmu_notifier: invalidate_page callbacks
Date: Sat, 16 Feb 2008 21:54:41 +0200	[thread overview]
Message-ID: <47B73F81.7090907@qumranet.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802161121130.25573@schroedinger.engr.sgi.com>

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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-02-16 19:56 UTC|newest]

Thread overview: 258+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15  6:48 [patch 0/6] MMU Notifiers V7 Christoph Lameter
2008-02-15  6:48 ` [ofa-general] " Christoph Lameter
2008-02-15  6:49 ` [patch 1/6] mmu_notifier: Core code Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-16  3:37   ` Andrew Morton
2008-02-16  3:37     ` Andrew Morton
2008-02-16  3:37     ` [ofa-general] " Andrew Morton
2008-02-16  8:45     ` Avi Kivity
2008-02-16  8:45       ` Avi Kivity
2008-02-16  8:45       ` Avi Kivity
2008-02-16  8:56       ` Andrew Morton
2008-02-16  8:56         ` Andrew Morton
2008-02-16  8:56         ` [ofa-general] " Andrew Morton
2008-02-16  9:21         ` Avi Kivity
2008-02-16  9:21           ` Avi Kivity
2008-02-16  9:21           ` Avi Kivity
2008-02-16 10:41     ` Brice Goglin
2008-02-16 10:41       ` Brice Goglin
2008-02-16 10:58       ` Andrew Morton
2008-02-16 10:58         ` Andrew Morton
2008-02-16 19:31         ` Christoph Lameter
2008-02-16 19:31           ` Christoph Lameter
2008-02-16 19:21     ` Christoph Lameter
2008-02-16 19:21       ` Christoph Lameter
2008-02-16 19:21       ` [ofa-general] " Christoph Lameter
2008-02-17  3:01       ` Andrea Arcangeli
2008-02-17  3:01         ` Andrea Arcangeli
2008-02-17  3:01         ` [ofa-general] " Andrea Arcangeli
2008-02-17 12:24         ` Robin Holt
2008-02-17 12:24           ` Robin Holt
2008-02-17 12:24           ` Robin Holt
2008-02-17  5:04     ` Doug Maxey
2008-02-17  5:04       ` Doug Maxey
2008-02-17  5:04       ` Doug Maxey
2008-02-18 22:33   ` Roland Dreier
2008-02-18 22:33     ` Roland Dreier
2008-02-18 22:33     ` [ofa-general] " Roland Dreier
2008-02-15  6:49 ` [patch 2/6] mmu_notifier: Callbacks to invalidate address ranges Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-16  3:37   ` Andrew Morton
2008-02-16  3:37     ` Andrew Morton
2008-02-16  3:37     ` [ofa-general] " Andrew Morton
2008-02-16 19:26     ` Christoph Lameter
2008-02-16 19:26       ` Christoph Lameter
2008-02-16 19:26       ` [ofa-general] " Christoph Lameter
2008-02-19  8:54   ` Nick Piggin
2008-02-19  8:54     ` Nick Piggin
2008-02-19  8:54     ` [ofa-general] " Nick Piggin
2008-02-19 13:34     ` Andrea Arcangeli
2008-02-19 13:34       ` Andrea Arcangeli
2008-02-19 13:34       ` Andrea Arcangeli
2008-02-27 22:23       ` Christoph Lameter
2008-02-27 22:23         ` Christoph Lameter
2008-02-27 22:23         ` Christoph Lameter
2008-02-27 23:57         ` Andrea Arcangeli
2008-02-27 23:57           ` Andrea Arcangeli
2008-02-27 23:57           ` Andrea Arcangeli
2008-02-19 23:08   ` Nick Piggin
2008-02-19 23:08     ` Nick Piggin
2008-02-19 23:08     ` [ofa-general] " Nick Piggin
2008-02-20  1:00     ` Andrea Arcangeli
2008-02-20  1:00       ` Andrea Arcangeli
2008-02-20  1:00       ` Andrea Arcangeli
2008-02-20  3:00       ` Robin Holt
2008-02-20  3:00         ` Robin Holt
2008-02-20  3:00         ` Robin Holt
2008-02-20  3:11         ` Nick Piggin
2008-02-20  3:11           ` Nick Piggin
2008-02-20  3:11           ` Nick Piggin
2008-02-20  3:19           ` Robin Holt
2008-02-20  3:19             ` Robin Holt
2008-02-20  3:19             ` [ofa-general] " Robin Holt
2008-02-27 22:39       ` Christoph Lameter
2008-02-27 22:39         ` Christoph Lameter
2008-02-27 22:39         ` Christoph Lameter
2008-02-28  0:38         ` Andrea Arcangeli
2008-02-28  0:38           ` Andrea Arcangeli
2008-02-28  0:38           ` Andrea Arcangeli
2008-02-27 22:35     ` Christoph Lameter
2008-02-27 22:35       ` Christoph Lameter
2008-02-27 22:35       ` [ofa-general] " Christoph Lameter
2008-02-27 22:42       ` Jack Steiner
2008-02-27 22:42         ` Jack Steiner
2008-02-27 22:42         ` [ofa-general] " Jack Steiner
2008-02-28  0:10       ` Christoph Lameter
2008-02-28  0:10         ` Christoph Lameter
2008-02-28  0:10         ` Christoph Lameter
2008-02-28  0:11       ` Andrea Arcangeli
2008-02-28  0:11         ` Andrea Arcangeli
2008-02-28  0:11         ` [ofa-general] " Andrea Arcangeli
2008-02-28  0:14         ` Christoph Lameter
2008-02-28  0:14           ` Christoph Lameter
2008-02-28  0:14           ` Christoph Lameter
2008-02-28  0:52           ` Andrea Arcangeli
2008-02-28  0:52             ` Andrea Arcangeli
2008-02-28  0:52             ` [ofa-general] " Andrea Arcangeli
2008-02-28  1:03             ` Christoph Lameter
2008-02-28  1:03               ` Christoph Lameter
2008-02-28  1:03               ` Christoph Lameter
2008-02-28  1:10               ` Andrea Arcangeli
2008-02-28  1:10                 ` Andrea Arcangeli
2008-02-28  1:10                 ` Andrea Arcangeli
2008-02-28 18:43                 ` Christoph Lameter
2008-02-28 18:43                   ` Christoph Lameter
2008-02-28 18:43                   ` [ofa-general] " Christoph Lameter
2008-02-29  0:55                   ` Andrea Arcangeli
2008-02-29  0:55                     ` Andrea Arcangeli
2008-02-29  0:55                     ` Andrea Arcangeli
2008-02-29  0:59                     ` Christoph Lameter
2008-02-29  0:59                       ` Christoph Lameter
2008-02-29  0:59                       ` [ofa-general] " Christoph Lameter
2008-02-29 13:13                       ` Andrea Arcangeli
2008-02-29 13:13                         ` Andrea Arcangeli
2008-02-29 13:13                         ` Andrea Arcangeli
2008-02-29 19:55                         ` Christoph Lameter
2008-02-29 19:55                           ` Christoph Lameter
2008-02-29 19:55                           ` [ofa-general] " Christoph Lameter
2008-02-29 20:17                           ` Andrea Arcangeli
2008-02-29 20:17                             ` Andrea Arcangeli
2008-02-29 20:17                             ` Andrea Arcangeli
2008-02-29 21:03                             ` Christoph Lameter
2008-02-29 21:03                               ` Christoph Lameter
2008-02-29 21:03                               ` [ofa-general] " Christoph Lameter
2008-02-29 21:23                               ` Andrea Arcangeli
2008-02-29 21:23                                 ` Andrea Arcangeli
2008-02-29 21:23                                 ` Andrea Arcangeli
2008-02-29 21:29                                 ` Christoph Lameter
2008-02-29 21:29                                   ` Christoph Lameter
2008-02-29 21:29                                   ` Christoph Lameter
2008-02-29 21:34                                 ` Christoph Lameter
2008-02-29 21:34                                   ` Christoph Lameter
2008-02-29 21:34                                   ` Christoph Lameter
2008-02-29 21:48                                   ` Andrea Arcangeli
2008-02-29 21:48                                     ` Andrea Arcangeli
2008-02-29 21:48                                     ` [ofa-general] " Andrea Arcangeli
2008-02-29 22:12                                     ` Christoph Lameter
2008-02-29 22:12                                       ` Christoph Lameter
2008-02-29 22:12                                       ` Christoph Lameter
2008-02-29 22:41                                       ` Andrea Arcangeli
2008-02-29 22:41                                         ` Andrea Arcangeli
2008-02-29 22:41                                         ` [ofa-general] " Andrea Arcangeli
2008-02-28 10:53             ` Robin Holt
2008-02-28 10:53               ` Robin Holt
2008-02-28 10:53               ` [ofa-general] " Robin Holt
2008-03-03  5:11       ` Nick Piggin
2008-03-03  5:11         ` Nick Piggin
2008-03-03  5:11         ` Nick Piggin
2008-03-03 19:28         ` Christoph Lameter
2008-03-03 19:28           ` Christoph Lameter
2008-03-03 19:28           ` [ofa-general] " Christoph Lameter
2008-03-03 19:50           ` Nick Piggin
2008-03-03 19:50             ` Nick Piggin
2008-03-04 18:58             ` Christoph Lameter
2008-03-04 18:58               ` Christoph Lameter
2008-03-04 18:58               ` Christoph Lameter
2008-03-05  0:52               ` Nick Piggin
2008-03-05  0:52                 ` Nick Piggin
2008-02-15  6:49 ` [patch 3/6] mmu_notifier: invalidate_page callbacks Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-16  3:37   ` Andrew Morton
2008-02-16  3:37     ` Andrew Morton
2008-02-16  3:37     ` [ofa-general] " Andrew Morton
2008-02-16 11:07     ` Andrea Arcangeli
2008-02-16 11:07       ` Andrea Arcangeli
2008-02-16 11:07       ` Andrea Arcangeli
2008-02-16 19:22     ` Christoph Lameter
2008-02-16 19:22       ` Christoph Lameter
2008-02-16 19:22       ` [ofa-general] " Christoph Lameter
2008-02-16 19:54       ` Avi Kivity [this message]
2008-02-16 19:54         ` Avi Kivity
2008-02-16 19:54         ` [ofa-general] " Avi Kivity
2008-02-19  8:46       ` Nick Piggin
2008-02-19  8:46         ` Nick Piggin
2008-02-19  8:46         ` [ofa-general] " Nick Piggin
2008-02-19 13:30         ` Andrea Arcangeli
2008-02-19 13:30           ` Andrea Arcangeli
2008-02-19 13:30           ` [ofa-general] " Andrea Arcangeli
2008-02-18  1:51     ` Nick Piggin
2008-02-18  1:51       ` Nick Piggin
2008-02-18  1:51       ` Nick Piggin
2008-02-15  6:49 ` [patch 4/6] mmu_notifier: Skeleton driver for a simple mmu_notifier Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-15  6:49 ` [patch 5/6] mmu_notifier: Support for drivers with revers maps (f.e. for XPmem) Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-16  3:37   ` Andrew Morton
2008-02-16  3:37     ` Andrew Morton
2008-02-16  3:37     ` [ofa-general] " Andrew Morton
2008-02-16 19:28     ` Christoph Lameter
2008-02-16 19:28       ` Christoph Lameter
2008-02-16 19:28       ` [ofa-general] " Christoph Lameter
2008-02-19 23:55   ` Nick Piggin
2008-02-19 23:55     ` Nick Piggin
2008-02-19 23:55     ` [ofa-general] " Nick Piggin
2008-02-20  3:12     ` Robin Holt
2008-02-20  3:12       ` Robin Holt
2008-02-20  3:12       ` [ofa-general] " Robin Holt
2008-02-20  3:51       ` Nick Piggin
2008-02-20  3:51         ` Nick Piggin
2008-02-20  3:51         ` [ofa-general] " Nick Piggin
2008-02-20  9:00         ` Robin Holt
2008-02-20  9:00           ` Robin Holt
2008-02-20  9:00           ` [ofa-general] " Robin Holt
2008-02-20  9:05           ` Robin Holt
2008-02-20  9:05             ` Robin Holt
2008-02-20  9:05             ` Robin Holt
2008-02-21  4:20           ` Nick Piggin
2008-02-21  4:20             ` Nick Piggin
2008-02-21 10:58             ` Robin Holt
2008-02-21 10:58               ` Robin Holt
2008-02-21 10:58               ` Robin Holt
2008-02-26  6:11               ` Nick Piggin
2008-02-26  6:11                 ` Nick Piggin
2008-02-26  6:11                 ` Nick Piggin
2008-02-26  7:21                 ` [ofa-general] " Gleb Natapov
2008-02-26  7:21                   ` Gleb Natapov
2008-02-26  7:21                   ` Gleb Natapov
2008-02-26  8:52                   ` Nick Piggin
2008-02-26  8:52                     ` Nick Piggin
2008-02-26  8:52                     ` Nick Piggin
2008-02-26  9:38                     ` Gleb Natapov
2008-02-26  9:38                       ` Gleb Natapov
2008-02-26  9:38                       ` Gleb Natapov
2008-02-26  9:52                       ` KOSAKI Motohiro
2008-02-26  9:52                         ` KOSAKI Motohiro
2008-02-26  9:52                         ` KOSAKI Motohiro
2008-02-26 12:28                     ` Robin Holt
2008-02-26 12:28                       ` Robin Holt
2008-02-26 12:28                       ` Robin Holt
2008-02-26 12:29                 ` Robin Holt
2008-02-26 12:29                   ` Robin Holt
2008-02-26 12:29                   ` [ofa-general] " Robin Holt
2008-02-27 22:43     ` Christoph Lameter
2008-02-27 22:43       ` Christoph Lameter
2008-02-27 22:43       ` [ofa-general] " Christoph Lameter
2008-02-28  0:42       ` Andrea Arcangeli
2008-02-28  0:42         ` Andrea Arcangeli
2008-02-28  0:42         ` [ofa-general] " Andrea Arcangeli
2008-02-28  1:01         ` Christoph Lameter
2008-02-28  1:01           ` Christoph Lameter
2008-02-28  1:01           ` Christoph Lameter
2008-02-15  6:49 ` [patch 6/6] mmu_rmap_notifier: Skeleton for complex driver that uses its own rmaps Christoph Lameter
2008-02-15  6:49   ` Christoph Lameter
2008-02-16 10:48 ` [PATCH] KVM swapping with MMU Notifiers V7 Andrea Arcangeli
2008-02-16 10:48   ` Andrea Arcangeli
2008-02-16 10:48   ` Andrea Arcangeli
2008-02-16 11:08   ` Andrew Morton
2008-02-16 11:08     ` Andrew Morton
2008-02-16 11:08     ` [ofa-general] " Andrew Morton
2008-02-18 12:17     ` Andrea Arcangeli
2008-02-18 12:17       ` Andrea Arcangeli
2008-02-16 11:51   ` Robin Holt
2008-02-16 11:51     ` Robin Holt
2008-02-16 11:51     ` [ofa-general] " Robin Holt
2008-02-18 12:35     ` Andrea Arcangeli
2008-02-18 12:35       ` Andrea Arcangeli
2008-02-18 12:35       ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2008-02-08 22:06 [patch 0/6] MMU Notifiers V6 Christoph Lameter
2008-02-08 22:06 ` [patch 3/6] mmu_notifier: invalidate_page callbacks Christoph Lameter
2008-02-08 22:06   ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47B73F81.7090907@qumranet.com \
    --to=avi@qumranet.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@qumranet.com \
    --cc=clameter@sgi.com \
    --cc=daniel.blueman@quadrics.com \
    --cc=general@lists.openfabrics.org \
    --cc=holt@sgi.com \
    --cc=izike@qumranet.com \
    --cc=kanojsarcar@yahoo.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rdreier@cisco.com \
    --cc=steiner@sgi.com \
    --cc=swise@opengridcomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.