Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1214656 > unrolled thread
| Started by | "Kirill A. Shutemov" <kirill@shutemov.name> |
|---|---|
| First post | 2015-08-27 17:40 +0200 |
| Last post | 2015-08-27 19:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 04/11] ARCv2: mm: THP support "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-08-27 17:40 +0200
Re: [PATCH 04/11] ARCv2: mm: THP support Vineet Gupta <vgupta@synopsys.com> - 2015-08-27 19:00 +0200
| From | "Kirill A. Shutemov" <kirill@shutemov.name> |
|---|---|
| Date | 2015-08-27 17:40 +0200 |
| Subject | Re: [PATCH 04/11] ARCv2: mm: THP support |
| Message-ID | <q27rr-8j-11@gated-at.bofh.it> |
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.
--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Vineet Gupta <vgupta@synopsys.com> |
|---|---|
| Date | 2015-08-27 19:00 +0200 |
| Message-ID | <q28GT-1SK-9@gated-at.bofh.it> |
| In reply to | #1214656 |
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web