linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE
@ 2025-04-11 10:51 Chen Linxuan
       [not found] ` <20250411105459.90782-1-chenlinxuan@uniontech.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Linxuan @ 2025-04-11 10:51 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter,
	Chengchang Tang, Junxian Huang, Leon Romanovsky, Keith Busch,
	Jens Axboe, Christoph Hellwig, Sagi Grimberg, Yishai Hadas,
	Shameer Kolothum, Kevin Tian, Alex Williamson, Andrew Morton,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Chen Linxuan
  Cc: linux-kbuild, linux-kernel, linux-integrity, intel-gfx,
	dri-devel, linux-rdma, linux-nvme, kvm, virtualization, linux-mm,
	llvm

This series introduces a new kernel configuration option NO_AUTO_INLINE,
which can be used to disable the automatic inlining of functions.

This will allow the function tracer to trace more functions
because it only traces functions that the compiler has not inlined.

Previous discussions can be found here:
Link: https://lore.kernel.org/all/20181028130945.23581-3-changbin.du@gmail.com/

Chen Linxuan (2):
  drm/i915/pxp: fix undefined reference to
    `intel_pxp_gsccs_is_ready_for_sessions'
  RDMA/hns: initialize db in update_srq_db()

Winston Wen (5):
  nvme: add __always_inline for nvme_pci_npages_prp
  mm: add __always_inline for page_contains_unaccepted
  vfio/virtio: add __always_inline for virtiovf_get_device_config_size
  tpm: add __always_inline for tpm_is_hwrng_enabled
  lib/Kconfig.debug: introduce CONFIG_NO_AUTO_INLINE

 Makefile                                   |  6 ++++++
 drivers/char/tpm/tpm-chip.c                |  2 +-
 drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h |  8 ++++++--
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c |  2 +-
 drivers/nvme/host/pci.c                    |  2 +-
 drivers/vfio/pci/virtio/legacy_io.c        |  2 +-
 lib/Kconfig.debug                          | 15 +++++++++++++++
 mm/page_alloc.c                            |  2 +-
 8 files changed, 32 insertions(+), 7 deletions(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH 2/7] mm: add __always_inline for page_contains_unaccepted
       [not found] ` <20250411105459.90782-1-chenlinxuan@uniontech.com>
@ 2025-04-11 10:54   ` Chen Linxuan
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Linxuan @ 2025-04-11 10:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Winston Wen, Chen Linxuan, linux-mm, linux-kernel

From: Winston Wen <wentao@uniontech.com>

On x86_64 with gcc version 13.3.0, I compile mm/page_alloc.c with:

  make defconfig
  make KCFLAGS="-fno-inline-small-functions -fno-inline-functions-called-once" \
    mm/page_alloc.o

Then I get a compile error:

    CALL    scripts/checksyscalls.sh
    DESCEND objtool
    INSTALL libsubcmd_headers
    CC      mm/page_alloc.o
  In file included from <command-line>:
  mm/page_alloc.c: In function '__free_unaccepted.isra':
  ././include/linux/compiler_types.h:557:45: error: call to '__compiletime_assert_1013' declared with attribute error: BUILD_BUG failed
    557 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |                                             ^
  ././include/linux/compiler_types.h:538:25: note: in definition of macro '__compiletime_assert'
    538 |                         prefix ## suffix();                             \
        |                         ^~~~~~
  ././include/linux/compiler_types.h:557:9: note: in expansion of macro '_compiletime_assert'
    557 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |         ^~~~~~~~~~~~~~~~~~~
  ./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
     39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
        |                                     ^~~~~~~~~~~~~~~~~~
  ./include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
        |                     ^~~~~~~~~~~~~~~~
  mm/page_alloc.c:7301:9: note: in expansion of macro 'BUILD_BUG'
   7301 |         BUILD_BUG();
        |         ^~~~~~~~~

Signed-off-by: Winston Wen <wentao@uniontech.com>
Co-Developed-by: Chen Linxuan <chenlinxuan@uniontech.com>
Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fd6b865cb1ab..7c0934c818dd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7286,7 +7286,7 @@ static bool __free_unaccepted(struct page *page)
 
 #else
 
-static bool page_contains_unaccepted(struct page *page, unsigned int order)
+static __always_inline bool page_contains_unaccepted(struct page *page, unsigned int order)
 {
 	return false;
 }
-- 
2.48.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE
  2025-04-16  4:48 ` Christoph Hellwig
@ 2025-04-16 10:09   ` Chen Linxuan
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Linxuan @ 2025-04-16 10:09 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Chen Linxuan, Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Chengchang Tang, Junxian Huang, Leon Romanovsky,
	Keith Busch, Jens Axboe, Sagi Grimberg, Yishai Hadas,
	Shameer Kolothum, Kevin Tian, Alex Williamson, Andrew Morton,
	Nick Desaulniers, Bill Wendling, Justin Stitt, linux-kbuild,
	linux-kernel, linux-integrity, intel-gfx, dri-devel, linux-rdma,
	linux-nvme, kvm, virtualization, linux-mm, llvm

Sorry for the mistake, v2 has been send:

https://lore.kernel.org/all/20250416-noautoinline-v2-0-e69a2717530f@uniontech.com/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE
  2025-04-11 10:52 [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE Chen Linxuan
@ 2025-04-16  4:48 ` Christoph Hellwig
  2025-04-16 10:09   ` Chen Linxuan
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-04-16  4:48 UTC (permalink / raw)
  To: Chen Linxuan
  Cc: Masahiro Yamada, Nathan Chancellor, Nicolas Schier, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter,
	Chengchang Tang, Junxian Huang, Leon Romanovsky, Keith Busch,
	Jens Axboe, Christoph Hellwig, Sagi Grimberg, Yishai Hadas,
	Shameer Kolothum, Kevin Tian, Alex Williamson, Andrew Morton,
	Nick Desaulniers, Bill Wendling, Justin Stitt, linux-kbuild,
	linux-kernel, linux-integrity, intel-gfx, dri-devel, linux-rdma,
	linux-nvme, kvm, virtualization, linux-mm, llvm

Your series did the grve mistake of sending various patches only
to some recipients making it unreviewable.

But doing less and more explicitly inlining in general seems very
questionable.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE
@ 2025-04-11 10:52 Chen Linxuan
  2025-04-16  4:48 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Linxuan @ 2025-04-11 10:52 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier, Peter Huewe,
	Jarkko Sakkinen, Jason Gunthorpe, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter,
	Chengchang Tang, Junxian Huang, Leon Romanovsky, Keith Busch,
	Jens Axboe, Christoph Hellwig, Sagi Grimberg, Yishai Hadas,
	Shameer Kolothum, Kevin Tian, Alex Williamson, Andrew Morton,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Chen Linxuan
  Cc: linux-kbuild, linux-kernel, linux-integrity, intel-gfx,
	dri-devel, linux-rdma, linux-nvme, kvm, virtualization, linux-mm,
	llvm

This series introduces a new kernel configuration option NO_AUTO_INLINE,
which can be used to disable the automatic inlining of functions.

This will allow the function tracer to trace more functions
because it only traces functions that the compiler has not inlined.

Previous discussions can be found here:
Link: https://lore.kernel.org/all/20181028130945.23581-3-changbin.du@gmail.com/

Chen Linxuan (2):
  drm/i915/pxp: fix undefined reference to
    `intel_pxp_gsccs_is_ready_for_sessions'
  RDMA/hns: initialize db in update_srq_db()

Winston Wen (5):
  nvme: add __always_inline for nvme_pci_npages_prp
  mm: add __always_inline for page_contains_unaccepted
  vfio/virtio: add __always_inline for virtiovf_get_device_config_size
  tpm: add __always_inline for tpm_is_hwrng_enabled
  lib/Kconfig.debug: introduce CONFIG_NO_AUTO_INLINE

 Makefile                                   |  6 ++++++
 drivers/char/tpm/tpm-chip.c                |  2 +-
 drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h |  8 ++++++--
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c |  2 +-
 drivers/nvme/host/pci.c                    |  2 +-
 drivers/vfio/pci/virtio/legacy_io.c        |  2 +-
 lib/Kconfig.debug                          | 15 +++++++++++++++
 mm/page_alloc.c                            |  2 +-
 8 files changed, 32 insertions(+), 7 deletions(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-16 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11 10:51 [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE Chen Linxuan
     [not found] ` <20250411105459.90782-1-chenlinxuan@uniontech.com>
2025-04-11 10:54   ` [RFC PATCH 2/7] mm: add __always_inline for page_contains_unaccepted Chen Linxuan
2025-04-11 10:52 [RFC PATCH 0/7] kernel-hacking: introduce CONFIG_NO_AUTO_INLINE Chen Linxuan
2025-04-16  4:48 ` Christoph Hellwig
2025-04-16 10:09   ` Chen Linxuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox