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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 17 Dec 2016 08:53:25 +0100
From:   Sam Ravnborg <sam@...nborg.org>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     sparclinux@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        "David S . Miller" <davem@...emloft.net>,
        Bob Picco <bob.picco@...cle.com>,
        Nitin Gupta <nitin.m.gupta@...cle.com>,
        Vijay Kumar <vijay.ac.kumar@...cle.com>,
        Julian Calaby <julian.calaby@...il.com>,
        Adam Buchbinder <adam.buchbinder@...il.com>,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Michal Hocko <mhocko@...e.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 06/14] sparc64: general shared context tsb creation
 and support

Hi Mike

> --- a/arch/sparc/mm/hugetlbpage.c
> +++ b/arch/sparc/mm/hugetlbpage.c
> @@ -162,8 +162,14 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  {
>  	pte_t orig;
>  
> -	if (!pte_present(*ptep) && pte_present(entry))
> -		mm->context.hugetlb_pte_count++;
> +	if (!pte_present(*ptep) && pte_present(entry)) {
> +#if defined(CONFIG_SHARED_MMU_CTX)
> +		if (pte_val(entry) | _PAGE_SHR_CTX_4V)
> +			mm->context.shared_hugetlb_pte_count++;
> +		else
> +#endif
> +			mm->context.hugetlb_pte_count++;
> +	}

This kind of conditional code it just too ugly to survive...
Could a static inline be used to help you here?
The compiler will inline it so there should not be any run-time cost

>  
>  	mm_rss -= saved_thp_pte_count * (HPAGE_SIZE / PAGE_SIZE);
>  #endif
> @@ -544,8 +576,10 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>  	 * us, so we need to zero out the TSB pointer or else tsb_grow()
>  	 * will be confused and think there is an older TSB to free up.
>  	 */
> -	for (i = 0; i < MM_NUM_TSBS; i++)
> +	for (i = 0; i < MM_NUM_TSBS; i++) {
>  		mm->context.tsb_block[i].tsb = NULL;
> +		mm->context.tsb_descr[i].tsb_base = 0UL;
> +	}
This change seems un-related to the rest?

	Sam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ