From: Yunsheng Lin <linyunsheng@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <edumazet@google.com>,
<pabeni@redhat.com>, <peterz@infradead.org>, <mingo@redhat.com>,
<will@kernel.org>, <longman@redhat.com>, <boqun.feng@gmail.com>,
<hawk@kernel.org>, <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH net-next] page_pool: add a lockdep check for recycling in hardirq
Date: Fri, 21 Jul 2023 19:53:30 +0800 [thread overview]
Message-ID: <382d00e5-87af-6a6b-17e2-6640fdd01db5@huawei.com> (raw)
In-Reply-To: <20230720173752.2038136-1-kuba@kernel.org>
On 2023/7/21 1:37, Jakub Kicinski wrote:
...
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index a3e12a61d456..3ac760fcdc22 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -536,6 +536,8 @@ static void page_pool_return_page(struct page_pool *pool, struct page *page)
> static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
> {
> int ret;
> +
> + lockdep_assert_no_hardirq();
Is there any reason not to put it in page_pool_put_defragged_page() to
catch the case with allow_direct being true when page_pool_recycle_in_ring()
may not be called?
> /* BH protection not needed if current is softirq */
> if (in_softirq())
> ret = ptr_ring_produce(&pool->ring, page);
> @@ -642,6 +644,8 @@ void page_pool_put_page_bulk(struct page_pool *pool, void **data,
> int i, bulk_len = 0;
> bool in_softirq;
>
> + lockdep_assert_no_hardirq();
> +
> for (i = 0; i < count; i++) {
> struct page *page = virt_to_head_page(data[i]);
>
>
next prev parent reply other threads:[~2023-07-21 11:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 17:37 [PATCH net-next] page_pool: add a lockdep check for recycling in hardirq Jakub Kicinski
2023-07-21 11:53 ` Yunsheng Lin [this message]
2023-07-21 15:02 ` Jakub Kicinski
2023-07-21 15:48 ` Alexander Lobakin
2023-07-21 16:05 ` Jakub Kicinski
2023-07-21 16:33 ` Alexander Lobakin
2023-07-22 1:45 ` Jakub Kicinski
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=382d00e5-87af-6a6b-17e2-6640fdd01db5@huawei.com \
--to=linyunsheng@huawei.com \
--cc=boqun.feng@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).