[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <871qk6z2c8.fsf@mail.concordia>
Date: Thu, 27 Apr 2023 08:49:11 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
"Sudip Mukherjee (Codethink)" <sudipm.mukherjee@...il.com>
Cc: Thomas Hellström
<thomas.hellstrom@...ux.intel.com>,
Christian Koenig <christian.koenig@....com>,
Huang Rui <ray.huang@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: mainline build failure due to 322458c2bb1a ("drm/ttm: Reduce
the number of used allocation orders for TTM pages")
Linus Torvalds <torvalds@...ux-foundation.org> writes:
> On Wed, Apr 26, 2023 at 10:44 AM Sudip Mukherjee (Codethink)
> <sudipm.mukherjee@...il.com> wrote:
>>
>> drivers/gpu/drm/ttm/ttm_pool.c:73:29: error: variably modified 'global_write_combined' at file scope
>> 73 | static struct ttm_pool_type global_write_combined[TTM_DIM_ORDER];
>> | ^~~~~~~~~~~~~~~~~~~~~
>
> Ugh.
>
> This is because we have
>
> #define TTM_DIM_ORDER (__TTM_DIM_ORDER <= MAX_ORDER ?
> __TTM_DIM_ORDER : MAX_ORDER)
>
> which looks perfectly fine as a constant ("pick the smaller of
> MAX_ORDER and __TTM_DIM_ORDER").
>
> But:
>
> #define __TTM_DIM_ORDER (TTM_MAX_ORDER + 1)
> #define TTM_MAX_ORDER (PMD_SHIFT - PAGE_SHIFT)
>
> which still _looks_ fine, but on 64-bit powerpc, we then have
>
> #define PTE_INDEX_SIZE __pte_index_size
>
> so that __TTM_DIM_ORDER constant isn't actually a constant at all.
..
>
> It's a bit sad how that macro that _looks_ like a constant (and is one
> pretty much everywhere else) isn't actually constant on powerpc, but
> looking around it looks fairly unavoidable.
Yeah, it allows us to build a single kernel that can choose at runtime
whether it uses the HPT or Radix MMU. The page table geometry is
different between the MMUs because they support a different sized huge
page for THP.
cheers
Powered by blists - more mailing lists