linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Michael Ellerman <mpe@ellerman.id.au>, Peter Xu <peterx@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	James Houghton <jthoughton@google.com>,
	stable@vger.kernel.org, Oscar Salvador <osalvador@suse.de>,
	Muchun Song <muchun.song@linux.dev>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v3] mm/hugetlb: fix hugetlb vs. core-mm PT locking
Date: Thu, 1 Aug 2024 09:35:19 +0200	[thread overview]
Message-ID: <3898204d-83c7-4eb9-a4bc-90665b505704@redhat.com> (raw)
In-Reply-To: <871q39ov7x.fsf@mail.lhotse>

>> pte_alloc_one() ends up calling pte_fragment_alloc(mm, 0). But there we always
>> end up calling pagetable_alloc(, 0).
>>
>> And fragments are supposed to be <= a single page.
>>
>> Now I'm confused what's wrong here ... am I missing something obvious?
>>
>> CCing some powerpc folks. Is this some pte_t oddity?
> 
> It will be because PTRS_PER_PTE is not a compile time constant :(

Oh, sneaky! Thanks a bunch!

> 
>    $ git grep "define PTRS_PER_PTE" arch/powerpc/include/asm/book3s/64
>    arch/powerpc/include/asm/book3s/64/pgtable.h:#define PTRS_PER_PTE        (1 << PTE_INDEX_SIZE)
>    
>    $ git grep "define PTE_INDEX_SIZE" arch/powerpc/include/asm/book3s/64
>    arch/powerpc/include/asm/book3s/64/pgtable.h:#define PTE_INDEX_SIZE  __pte_index_size
>    
>    $ git grep __pte_index_size arch/powerpc/mm/pgtable_64.c
>    arch/powerpc/mm/pgtable_64.c:unsigned long __pte_index_size;
> 
> Which is because the pseries/powernv (book3s64) kernel supports either
> the HPT or Radix MMU at runtime, and they have different page table
> geometry.
> 
> If you change it to use MAX_PTRS_PER_PTE it should work (that's defined
> for all arches).

Yes, that should fly, thanks again!

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-08-01  7:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 12:21 David Hildenbrand
2024-07-31 14:54 ` Peter Xu
2024-07-31 16:33   ` David Hildenbrand
2024-08-01  2:03     ` Michael Ellerman
2024-08-01  7:35       ` David Hildenbrand [this message]
2024-08-14 17:25     ` Christophe Leroy
2024-08-01  8:50 ` David Hildenbrand
2024-08-01 13:52   ` Peter Xu
2024-08-01 15:35     ` David Hildenbrand
2024-08-01 16:07       ` Peter Xu
2024-08-01 16:24         ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3898204d-83c7-4eb9-a4bc-90665b505704@redhat.com \
    --to=david@redhat.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jthoughton@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mpe@ellerman.id.au \
    --cc=muchun.song@linux.dev \
    --cc=npiggin@gmail.com \
    --cc=osalvador@suse.de \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox