lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120809214430.GJ10459@redhat.com>
Date:	Thu, 9 Aug 2012 23:44:30 +0200
From:	Andrea Arcangeli <aarcange@...hat.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	mingo@...nel.org, riel@...hat.com, oleg@...hat.com, pjt@...gle.com,
	akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
	tglx@...utronix.de, Lee.Schermerhorn@...com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/19] mm, mpol: Use special PROT_NONE to migrate pages

On Tue, Jul 31, 2012 at 09:12:14PM +0200, Peter Zijlstra wrote:
> +#ifdef CONFIG_NUMA
>  	/*
> -	 * Do fancy stuff...
> +	 * For NUMA systems we use the special PROT_NONE maps to drive
> +	 * lazy page migration, see MPOL_MF_LAZY and related.
>  	 */
> +	page = vm_normal_page(vma, address, entry);
> +	if (!page)
> +		goto do_fixup_locked;
> +
> +	get_page(page);
> +	pte_unmap_unlock(ptep, ptl);
> +
> +	node = mpol_misplaced(page, vma, address);
> +	if (node == -1)
> +		goto do_fixup;
>  
>  	/*
> +	 * Page migration will install a new pte with vma->vm_page_prot,
> +	 * otherwise fall-through to the fixup. Next time,.. perhaps.
> +	 */
> +	if (!migrate_misplaced_page(mm, page, node)) {
> +		put_page(page);
> +		return 0;
> +	}
> +
> +do_fixup:
> +	/*
>  	 * OK, nothing to do,.. change the protection back to what it
>  	 * ought to be.
>  	 */
> @@ -3467,6 +3493,9 @@ static int do_prot_none(struct mm_struct
>  	if (unlikely(!pte_same(*ptep, entry)))
>  		goto unlock;
>  
> +do_fixup_locked:
> +#endif /* CONFIG_NUMA */
> +

Do fancy stuff would better of be in a separate file instead of mixing
it with the numa hinting page fault entry points in memory.c. My
"fancy stuff" happens in mm/autonuma.c. memory.c calls it.

>  	flush_cache_page(vma, address, pte_pfn(entry));
>  
>  	ptep_modify_prot_start(mm, address, ptep);
> @@ -3476,8 +3505,9 @@ static int do_prot_none(struct mm_struct
>  	update_mmu_cache(vma, address, ptep);
>  unlock:
>  	pte_unmap_unlock(ptep, ptl);
> -out:
> -	return ret;
> +	if (page)
> +		put_page(page);
> +	return 0;
>  }
>  
>  /*
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ