linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang@os.amperecomputing.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	willy@infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: madvise: make MADV_NOHUGEPAGE a no-op if !THP
Date: Wed, 14 May 2025 09:54:38 -0700	[thread overview]
Message-ID: <6bee5126-5ff6-480a-8a7c-fe5b20f085c7@os.amperecomputing.com> (raw)
In-Reply-To: <90bfbe27-ba24-4f18-9f94-fb58ecc03586@lucifer.local>



On 5/14/25 8:29 AM, Lorenzo Stoakes wrote:
> On Wed, May 14, 2025 at 08:25:05AM -0700, Yang Shi wrote:
>>
>> On 5/14/25 8:07 AM, Ignacio Moreno Gonzalez wrote:
>>> On 5/14/2025 3:52 PM, Lorenzo Stoakes wrote:
>>>
>>>> I have pinged s390 people on there, but I don't think this is going to make this
>>>> cycle given we will probably need to coordinate with them to fix up this enum
>>>> name (which seems the best solution to me!...)
>>> They answered that it would be ok for them to do a quick fix over the mm tree:
>>>
>>> https://lore.kernel.org/linux-mm/6f8f3780-902b-49d4-a766-ea2e1a8f85ea@linux.ibm.com/
>>>
>>>
>>>>> +#include <uapi/asm/mman.h>
>>>> Also this should be linux/mman.h I believe, sorry for not catching first time round...!
>>>>
>>> Including linux/mman.h leads to a compilation error:
>>>
>>> ../include/linux/huge_mm.h:601:23: error: ‘MADV_NOHUGEPAGE’
>>>
>>> Including uapi/linux/mman.h works, but I am not sure if that is correct.
>> Is this build on x86? I actually tried this on my arm64 build before I
>> suggested uapi/asm/mman.h. But I saw a lot of compilation errors, like:
>>
>> In file included from ./include/linux/memcontrol.h:22,
>>                   from ./include/linux/swap.h:9,
>>                   from ./include/linux/userfaultfd_k.h:18,
>>                   from ./include/linux/hugetlb.h:16,
>>                   from ./arch/arm64/include/asm/mman.h:10,
>>                   from ./include/uapi/linux/mman.h:5,
>>                   from ./include/linux/huge_mm.h:512,
>>                   from ./include/linux/mm.h:1238,
>>                   from ./include/linux/memblock.h:12,
>>                   from ./arch/arm64/include/asm/acpi.h:14,
>>                   from ./include/acpi/acpi_io.h:7,
>>                   from ./include/linux/acpi.h:39,
>>                   from ./include/acpi/apei.h:9,
>>                   from ./include/acpi/ghes.h:5,
>>                   from ./include/linux/arm_sdei.h:8,
>>                   from arch/arm64/kernel/asm-offsets.c:10:
>> ./include/linux/vmstat.h: In function ‘__zone_stat_mod_folio’:
>> ./include/linux/vmstat.h:414:31: error: implicit declaration of function
>> ‘folio_zone’; did you mean ‘folio_zonenum’?
>> [-Wimplicit-function-declaration]
>>    414 |         __mod_zone_page_state(folio_zone(folio), item, nr);
>>        |                               ^~~~~~~~~~
>>        |                               folio_zonenum
>> ./include/linux/vmstat.h:414:31: error: passing argument 1 of
>> ‘__mod_zone_page_state’ makes pointer from integer without a cast
>> [-Wint-conversion]
>>    414 |         __mod_zone_page_state(folio_zone(folio), item, nr);
>>        |                               ^~~~~~~~~~~~~~~~~
>>        |                               |
>>        |                               int
>> ./include/linux/vmstat.h:273:28: note: expected ‘struct zone *’ but argument
>> is of type ‘int’
>>    273 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item,
>> long);
>>        |                            ^~~~~~~~~~~~~
>> ./include/linux/vmstat.h: In function ‘__zone_stat_add_folio’:
>> ./include/linux/vmstat.h:420:56: error: implicit declaration of function
>> ‘folio_nr_pages’; did you mean ‘folio_page’?
>> [-Wimplicit-function-declaration]
>>    420 |         __mod_zone_page_state(folio_zone(folio), item,
>> folio_nr_pages(folio));
>>        | ^~~~~~~~~~~~~~
>>
>>
>> The build used default Fedora kernel config with THP disabled and v6.15-rc6
>> kernel.
> Yeah I suspect this is because of circular dependencies as I mentioned in reply
> to Ignacio :) Sorry I missed you'd suggested it Yang, you were right to do so :)

No problem :)

>
> You can see mm.h -> huge_mm.h there so it does seem to be same thing.

Yeah, it caused some circular dependencies.

>
> C headers are a source of many sighs.
>
>>>



  reply	other threads:[~2025-05-14 16:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 10:20 Ignacio Moreno Gonzalez via B4 Relay
2025-05-08 11:49 ` Lorenzo Stoakes
2025-05-08 15:06 ` David Hildenbrand
2025-05-08 15:32 ` Yang Shi
2025-05-08 19:04 ` Liam R. Howlett
2025-05-09  5:47   ` Ignacio Moreno Gonzalez
2025-05-09 17:24     ` Liam R. Howlett
2025-05-14 13:52 ` Lorenzo Stoakes
2025-05-14 15:07   ` Ignacio Moreno Gonzalez
2025-05-14 15:25     ` Yang Shi
2025-05-14 15:29       ` Lorenzo Stoakes
2025-05-14 16:54         ` Yang Shi [this message]
2025-05-14 15:27     ` Lorenzo Stoakes
2025-05-14 15:59       ` Ignacio Moreno Gonzalez
2025-05-14 22:36         ` Andrew Morton
2025-05-15  5:30           ` Lorenzo Stoakes
2025-05-14 20:15 ` James Houghton
2025-05-15  7:03   ` Ignacio Moreno Gonzalez
2025-05-15 13:03     ` Lorenzo Stoakes
2025-05-15 14:42       ` Ignacio Moreno Gonzalez

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=6bee5126-5ff6-480a-8a7c-fe5b20f085c7@os.amperecomputing.com \
    --to=yang@os.amperecomputing.com \
    --cc=Ignacio.MorenoGonzalez@kuka.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=willy@infradead.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