[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_C722D2FCAA87D408E78D8E452E17C6F3B906@qq.com>
Date: Sun, 8 Dec 2024 21:50:06 +0800
From: Junjie Fu <fujunjie1@...com>
To: SeongJae Park <sj@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, willy@...radead.org,
Michal Hocko <mhocko@...e.com>, akpm@...ux-foundation.org,
gourry@...rry.net, fujunjie1@...com
Subject: Re: [PATCH] mempolicy.h: Remove unnecessary header file inclusions
On December 8, 2024 at 3:53, SeongJae Park wrote:
> I noticed kunit UM build errors as below on mm-unstable, and git bisect points
> this patch.
>
> $ ./tools/testing/kunit/kunit.py run --kunitconfig ./mm/damon/tests/
> [...]
> fs/aio.c:525:71: error: ‘FGP_CREAT’ undeclared (first use in this function); did you mean ‘IPC_CREAT’?
> 525 | FGP_LOCK | FGP_ACCESSED | FGP_CREAT,
> | ^~~~~~~~~
> | IPC_CREAT
> fs/aio.c:532:17: error: implicit declaration of function ‘folio_end_read’; did you mean ‘folio_test_head’? [-Werror=implicit-function-declaration]
> 532 | folio_end_read(folio, true);
> | ^~~~~~~~~~~~~~
> | folio_test_head
> [...]
>
> I also confirmed including pagemap.h on fs/aio.c as below fixes the issue. I
> would like to hear you or others opinions though, since I'm not familiar with
> the inclusion routes of the file.
Including unnecessary header files in a .h file is not a good practice.
It can lead to troublesome dependency issues in the future. However,
based on the testing on your side, this change might cause some other
compilation issues, as indicated in your patch. I think all these issues
should be resolvable by including the pagemap.h in the .c files instead.
Powered by blists - more mailing lists