diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-08-04 21:05:28 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-07 23:05:53 +0300 |
commit | ff4e538c8c3e675a15e1e49509c55951832e0451 (patch) | |
tree | 99b0cd0097309667febae25692668cdf4891f68e /net/core/page_pool.c | |
parent | 5b899c33b3b852b9559b724cfee67801324a0886 (diff) | |
download | linux-ff4e538c8c3e675a15e1e49509c55951832e0451.tar.xz |
page_pool: add a lockdep check for recycling in hardirq
Page pool use in hardirq is prohibited, add debug checks
to catch misuses. IIRC we previously discussed using
DEBUG_NET_WARN_ON_ONCE() for this, but there were concerns
that people will have DEBUG_NET enabled in perf testing.
I don't think anyone enables lockdep in perf testing,
so use lockdep to avoid pushback and arguing :)
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://lore.kernel.org/r/20230804180529.2483231-6-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/page_pool.c')
-rw-r--r-- | net/core/page_pool.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 03ad74d25959..77cb75e63aca 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -587,6 +587,8 @@ static __always_inline struct page * __page_pool_put_page(struct page_pool *pool, struct page *page, unsigned int dma_sync_size, bool allow_direct) { + lockdep_assert_no_hardirq(); + /* This allocator is optimized for the XDP mode that uses * one-frame-per-page, but have fallbacks that act like the * regular page allocator APIs. |