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
| ||
|
Date: Thu, 27 Aug 2015 22:26:44 +0530 From: Vineet Gupta <vgupta@...opsys.com> To: "Kirill A. Shutemov" <kirill@...temov.name> Cc: Andrew Morton <akpm@...ux-foundation.org>, "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>, "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Mel Gorman <mgorman@...e.de>, Matthew Wilcox <matthew.r.wilcox@...el.com>, Minchan Kim <minchan@...nel.org>, linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org, linux-mm@...ck.org, arc-linux-dev@...opsys.com Subject: Re: [PATCH 04/11] ARCv2: mm: THP support On Thursday 27 August 2015 09:02 PM, Kirill A. Shutemov wrote: > On Thu, Aug 27, 2015 at 02:33:07PM +0530, Vineet Gupta wrote: >> > +pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) >> > +{ >> > + struct list_head *lh; >> > + pgtable_t pgtable; >> > + pte_t *ptep; >> > + >> > + assert_spin_locked(&mm->page_table_lock); >> > + >> > + pgtable = pmd_huge_pte(mm, pmdp); >> > + lh = (struct list_head *) pgtable; >> > + if (list_empty(lh)) >> > + pmd_huge_pte(mm, pmdp) = (pgtable_t) NULL; >> > + else { >> > + pmd_huge_pte(mm, pmdp) = (pgtable_t) lh->next; >> > + list_del(lh); >> > + } > Side question: why pgtable_t is unsigned long on ARC and not struct page * > or pte_t *, like on other archs? We could avoid these casts. This goes back how I did this for ARC long back to avoid page_address() calls in general case. e.g. pte_alloc_one(), pmd_populate(), pte_free()... all needed to convert struct page to unsigned long. It was micro-optimization of sorts, but served us well. I could perhaps see try making it pte *, that will certainly remove a bunch of other casts as well. -Vineet -- 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