lkml.org 
[lkml]   [2012]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 7/7] thp, s390: architecture backend for thp on System z
On Thu, Aug 23, 2012 at 07:17:40PM +0200, Gerald Schaefer wrote:
> +#define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
> +static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
> + unsigned long address,
> + pmd_t *pmdp)
> +{
> + int rc = 0;
> + int counter = PTRS_PER_PTE;
> + unsigned long pmd_addr = pmd_val(*pmdp) & HPAGE_MASK;
> +
> + asm volatile(
> + "0: rrbe 0,%2\n"
> + " la %2,0(%3,%2)\n"
> + " brc 12,1f\n"
> + " lhi %0,1\n"
> + "1: brct %1,0b\n"
> + : "+d" (rc), "+d" (counter), "+a" (pmd_addr)
> + : "a" (4096UL): "cc" );
> + return rc;
> +}

Just a small side note: given that rrbe is very expensive you probably
should extend this function so it makes use of the rrbm instruction
if available.



\
 
 \ /
  Last update: 2012-08-24 10:41    [W:2.030 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site