Re: [RFC patch 7/7] thp, s390: architecture backend for thp on System z

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]