public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ptep_test_and_clear_young() i386 vs. x86_64
@ 2007-09-21 19:14 Slava Abramov
  2007-09-21 19:42 ` Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: Slava Abramov @ 2007-09-21 19:14 UTC (permalink / raw)
  To: linux-kernel

Hi All!

Is there any special reason why ptep_test_and_clear_young()
implementation for x86_64 does not call pte_update()?

Compare the following:

include/asm-x86_64/pgtable.h:

static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, 
unsigned long addr, pte_t *ptep)
{
        if (!pte_young(*ptep))
               return 0;
        return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte);

}

include/asm-i386/pgtable.h:

#define ptep_test_and_clear_young(vma, addr, ptep) ({                   \
        int __ret = 0;                                                  \
        if (pte_young(*(ptep)))                                         \
                __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,          \
                                                &(ptep)->pte_low);       \
        if (__ret)                                                      \
                pte_update((vma)->vm_mm, addr, ptep);                   
     \
        __ret;                                                          \

})


Slava


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ptep_test_and_clear_young() i386 vs. x86_64
  2007-09-21 19:14 ptep_test_and_clear_young() i386 vs. x86_64 Slava Abramov
@ 2007-09-21 19:42 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2007-09-21 19:42 UTC (permalink / raw)
  To: Slava Abramov; +Cc: linux-kernel

On Fri, 21 Sep 2007, Slava Abramov wrote:
> 
> Is there any special reason why ptep_test_and_clear_young()
> implementation for x86_64 does not call pte_update()?

Because the i386 pte_update is there for CONFIG_PARAVIRT (and
a no-op without it), and CONFIG_PARAVIRT is so far peculiar to
i386: x86_64 doesn't even define a pte_update to call there.

Hugh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-21 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21 19:14 ptep_test_and_clear_young() i386 vs. x86_64 Slava Abramov
2007-09-21 19:42 ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox