* [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
@ 2026-03-07 20:40 Jakub Kicinski
2026-03-08 0:10 ` Eric Dumazet
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Jakub Kicinski @ 2026-03-07 20:40 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski,
hawk, ilias.apalodimas
While testing other changes in vng I noticed that
nl_netdev.page_pool_check flakes. This never happens in real CI.
Turns out vng may boot and get to that test in less than a second.
page_pool_detached() records the detach time in seconds, so if
vng is fast enough detach time is set to 0. Other code treats
0 as "not detached". detach_time is only used to report the state
to the user, so it's not a huge deal in practice but let's fix it.
Store the raw ktime_t (nanoseconds) instead. A nanosecond value
of 0 is practically impossible.
Fixes: 69cb4952b6f6 ("net: page_pool: report when page pool was destroyed")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: hawk@kernel.org
CC: ilias.apalodimas@linaro.org
---
include/net/page_pool/types.h | 2 +-
net/core/page_pool_user.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
index 0d453484a585..cdd95477af7a 100644
--- a/include/net/page_pool/types.h
+++ b/include/net/page_pool/types.h
@@ -247,7 +247,7 @@ struct page_pool {
/* User-facing fields, protected by page_pools_lock */
struct {
struct hlist_node list;
- u64 detach_time;
+ ktime_t detach_time;
u32 id;
} user;
};
diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
index c82a95beceff..fb4ca27358cd 100644
--- a/net/core/page_pool_user.c
+++ b/net/core/page_pool_user.c
@@ -245,7 +245,7 @@ page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
goto err_cancel;
if (pool->user.detach_time &&
nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
- pool->user.detach_time))
+ ktime_to_seconds(pool->user.detach_time)))
goto err_cancel;
if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
@@ -337,7 +337,7 @@ int page_pool_list(struct page_pool *pool)
void page_pool_detached(struct page_pool *pool)
{
mutex_lock(&page_pools_lock);
- pool->user.detach_time = ktime_get_boottime_seconds();
+ pool->user.detach_time = ktime_get_boottime();
netdev_nl_page_pool_event(pool, NETDEV_CMD_PAGE_POOL_CHANGE_NTF);
mutex_unlock(&page_pools_lock);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
@ 2026-03-08 0:10 ` Eric Dumazet
2026-03-08 16:21 ` Jakub Kicinski
2026-03-08 4:54 ` kernel test robot
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2026-03-08 0:10 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, pabeni, andrew+netdev, horms, hawk,
ilias.apalodimas
On Sat, Mar 7, 2026 at 9:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> While testing other changes in vng I noticed that
> nl_netdev.page_pool_check flakes. This never happens in real CI.
>
> Turns out vng may boot and get to that test in less than a second.
> page_pool_detached() records the detach time in seconds, so if
> vng is fast enough detach time is set to 0. Other code treats
> 0 as "not detached". detach_time is only used to report the state
> to the user, so it's not a huge deal in practice but let's fix it.
> Store the raw ktime_t (nanoseconds) instead. A nanosecond value
> of 0 is practically impossible.
>
> Fixes: 69cb4952b6f6 ("net: page_pool: report when page pool was destroyed")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: hawk@kernel.org
> CC: ilias.apalodimas@linaro.org
> ---
> include/net/page_pool/types.h | 2 +-
> net/core/page_pool_user.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> index 0d453484a585..cdd95477af7a 100644
> --- a/include/net/page_pool/types.h
> +++ b/include/net/page_pool/types.h
> @@ -247,7 +247,7 @@ struct page_pool {
> /* User-facing fields, protected by page_pools_lock */
> struct {
> struct hlist_node list;
> - u64 detach_time;
> + ktime_t detach_time;
> u32 id;
> } user;
> };
> diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
> index c82a95beceff..fb4ca27358cd 100644
> --- a/net/core/page_pool_user.c
> +++ b/net/core/page_pool_user.c
> @@ -245,7 +245,7 @@ page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
> goto err_cancel;
It is a bit unclear if we always hold page_pools_lock at this point.
If not, a READ_ONCE(pool->user.detach_time) here would be needed,
and a corresponding WRITE_ONCE() in page_pool_detached()
> if (pool->user.detach_time &&
> nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> - pool->user.detach_time))
> + ktime_to_seconds(pool->user.detach_time)))
> goto err_cancel;
>
> if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
> @@ -337,7 +337,7 @@ int page_pool_list(struct page_pool *pool)
> void page_pool_detached(struct page_pool *pool)
> {
> mutex_lock(&page_pools_lock);
> - pool->user.detach_time = ktime_get_boottime_seconds();
> + pool->user.detach_time = ktime_get_boottime();
> netdev_nl_page_pool_event(pool, NETDEV_CMD_PAGE_POOL_CHANGE_NTF);
> mutex_unlock(&page_pools_lock);
> }
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
2026-03-08 0:10 ` Eric Dumazet
@ 2026-03-08 4:54 ` kernel test robot
2026-03-08 5:05 ` kernel test robot
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-03-08 4:54 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: oe-kbuild-all, netdev, edumazet, pabeni, andrew+netdev, horms,
Jakub Kicinski, hawk, ilias.apalodimas
Hi Jakub,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/page_pool-store-detach_time-as-ktime_t-to-avoid-false-negatives/20260308-044057
base: net/main
patch link: https://lore.kernel.org/r/20260307204022.1897614-1-kuba%40kernel.org
patch subject: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
config: mips-decstation_defconfig (https://download.01.org/0day-ci/archive/20260308/202603081213.0a8noL8L-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260308/202603081213.0a8noL8L-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603081213.0a8noL8L-lkp@intel.com/
All errors (new ones prefixed by >>):
net/core/page_pool_user.c: In function 'page_pool_nl_fill':
>> net/core/page_pool_user.c:248:26: error: implicit declaration of function 'ktime_to_seconds'; did you mean 'ktime_get_seconds'? [-Wimplicit-function-declaration]
248 | ktime_to_seconds(pool->user.detach_time)))
| ^~~~~~~~~~~~~~~~
| ktime_get_seconds
vim +248 net/core/page_pool_user.c
214
215 static int
216 page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
217 const struct genl_info *info)
218 {
219 size_t inflight, refsz;
220 unsigned int napi_id;
221 void *hdr;
222
223 hdr = genlmsg_iput(rsp, info);
224 if (!hdr)
225 return -EMSGSIZE;
226
227 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id))
228 goto err_cancel;
229
230 if (pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
231 nla_put_u32(rsp, NETDEV_A_PAGE_POOL_IFINDEX,
232 pool->slow.netdev->ifindex))
233 goto err_cancel;
234
235 napi_id = pool->p.napi ? READ_ONCE(pool->p.napi->napi_id) : 0;
236 if (napi_id_valid(napi_id) &&
237 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_NAPI_ID, napi_id))
238 goto err_cancel;
239
240 inflight = page_pool_inflight(pool, false);
241 refsz = PAGE_SIZE << pool->p.order;
242 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT, inflight) ||
243 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
244 inflight * refsz))
245 goto err_cancel;
246 if (pool->user.detach_time &&
247 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> 248 ktime_to_seconds(pool->user.detach_time)))
249 goto err_cancel;
250
251 if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
252 goto err_cancel;
253
254 genlmsg_end(rsp, hdr);
255
256 return 0;
257 err_cancel:
258 genlmsg_cancel(rsp, hdr);
259 return -EMSGSIZE;
260 }
261
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
2026-03-08 0:10 ` Eric Dumazet
2026-03-08 4:54 ` kernel test robot
@ 2026-03-08 5:05 ` kernel test robot
2026-03-08 5:06 ` kernel test robot
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-03-08 5:05 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: llvm, oe-kbuild-all, netdev, edumazet, pabeni, andrew+netdev,
horms, Jakub Kicinski, hawk, ilias.apalodimas
Hi Jakub,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/page_pool-store-detach_time-as-ktime_t-to-avoid-false-negatives/20260308-044057
base: net/main
patch link: https://lore.kernel.org/r/20260307204022.1897614-1-kuba%40kernel.org
patch subject: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
config: loongarch-randconfig-001-20260308 (https://download.01.org/0day-ci/archive/20260308/202603081213.mN3LtMM5-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260308/202603081213.mN3LtMM5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603081213.mN3LtMM5-lkp@intel.com/
All errors (new ones prefixed by >>):
>> net/core/page_pool_user.c:248:5: error: call to undeclared function 'ktime_to_seconds'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
248 | ktime_to_seconds(pool->user.detach_time)))
| ^
net/core/page_pool_user.c:248:5: note: did you mean 'ktime_get_seconds'?
include/linux/timekeeping.h:59:17: note: 'ktime_get_seconds' declared here
59 | extern time64_t ktime_get_seconds(void);
| ^
1 error generated.
vim +/ktime_to_seconds +248 net/core/page_pool_user.c
214
215 static int
216 page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
217 const struct genl_info *info)
218 {
219 size_t inflight, refsz;
220 unsigned int napi_id;
221 void *hdr;
222
223 hdr = genlmsg_iput(rsp, info);
224 if (!hdr)
225 return -EMSGSIZE;
226
227 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id))
228 goto err_cancel;
229
230 if (pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
231 nla_put_u32(rsp, NETDEV_A_PAGE_POOL_IFINDEX,
232 pool->slow.netdev->ifindex))
233 goto err_cancel;
234
235 napi_id = pool->p.napi ? READ_ONCE(pool->p.napi->napi_id) : 0;
236 if (napi_id_valid(napi_id) &&
237 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_NAPI_ID, napi_id))
238 goto err_cancel;
239
240 inflight = page_pool_inflight(pool, false);
241 refsz = PAGE_SIZE << pool->p.order;
242 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT, inflight) ||
243 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
244 inflight * refsz))
245 goto err_cancel;
246 if (pool->user.detach_time &&
247 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> 248 ktime_to_seconds(pool->user.detach_time)))
249 goto err_cancel;
250
251 if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
252 goto err_cancel;
253
254 genlmsg_end(rsp, hdr);
255
256 return 0;
257 err_cancel:
258 genlmsg_cancel(rsp, hdr);
259 return -EMSGSIZE;
260 }
261
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
` (2 preceding siblings ...)
2026-03-08 5:05 ` kernel test robot
@ 2026-03-08 5:06 ` kernel test robot
2026-03-08 5:17 ` kernel test robot
2026-03-09 9:42 ` Jesper Dangaard Brouer
5 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-03-08 5:06 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: llvm, oe-kbuild-all, netdev, edumazet, pabeni, andrew+netdev,
horms, Jakub Kicinski, hawk, ilias.apalodimas
Hi Jakub,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/page_pool-store-detach_time-as-ktime_t-to-avoid-false-negatives/20260308-044057
base: net/main
patch link: https://lore.kernel.org/r/20260307204022.1897614-1-kuba%40kernel.org
patch subject: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260308/202603080650.SZhWEYVL-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260308/202603080650.SZhWEYVL-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603080650.SZhWEYVL-lkp@intel.com/
All errors (new ones prefixed by >>):
>> net/core/page_pool_user.c:248:5: error: call to undeclared function 'ktime_to_seconds'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
248 | ktime_to_seconds(pool->user.detach_time)))
| ^
net/core/page_pool_user.c:248:5: note: did you mean 'ktime_get_seconds'?
include/linux/timekeeping.h:59:17: note: 'ktime_get_seconds' declared here
59 | extern time64_t ktime_get_seconds(void);
| ^
1 error generated.
vim +/ktime_to_seconds +248 net/core/page_pool_user.c
214
215 static int
216 page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
217 const struct genl_info *info)
218 {
219 size_t inflight, refsz;
220 unsigned int napi_id;
221 void *hdr;
222
223 hdr = genlmsg_iput(rsp, info);
224 if (!hdr)
225 return -EMSGSIZE;
226
227 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id))
228 goto err_cancel;
229
230 if (pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
231 nla_put_u32(rsp, NETDEV_A_PAGE_POOL_IFINDEX,
232 pool->slow.netdev->ifindex))
233 goto err_cancel;
234
235 napi_id = pool->p.napi ? READ_ONCE(pool->p.napi->napi_id) : 0;
236 if (napi_id_valid(napi_id) &&
237 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_NAPI_ID, napi_id))
238 goto err_cancel;
239
240 inflight = page_pool_inflight(pool, false);
241 refsz = PAGE_SIZE << pool->p.order;
242 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT, inflight) ||
243 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
244 inflight * refsz))
245 goto err_cancel;
246 if (pool->user.detach_time &&
247 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> 248 ktime_to_seconds(pool->user.detach_time)))
249 goto err_cancel;
250
251 if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
252 goto err_cancel;
253
254 genlmsg_end(rsp, hdr);
255
256 return 0;
257 err_cancel:
258 genlmsg_cancel(rsp, hdr);
259 return -EMSGSIZE;
260 }
261
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
` (3 preceding siblings ...)
2026-03-08 5:06 ` kernel test robot
@ 2026-03-08 5:17 ` kernel test robot
2026-03-09 9:42 ` Jesper Dangaard Brouer
5 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2026-03-08 5:17 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: oe-kbuild-all, netdev, edumazet, pabeni, andrew+netdev, horms,
Jakub Kicinski, hawk, ilias.apalodimas
Hi Jakub,
kernel test robot noticed the following build errors:
[auto build test ERROR on net/main]
url: https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/page_pool-store-detach_time-as-ktime_t-to-avoid-false-negatives/20260308-044057
base: net/main
patch link: https://lore.kernel.org/r/20260307204022.1897614-1-kuba%40kernel.org
patch subject: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260308/202603080604.nGijPf4B-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260308/202603080604.nGijPf4B-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603080604.nGijPf4B-lkp@intel.com/
All errors (new ones prefixed by >>):
net/core/page_pool_user.c: In function 'page_pool_nl_fill':
>> net/core/page_pool_user.c:248:26: error: implicit declaration of function 'ktime_to_seconds'; did you mean 'ktime_get_seconds'? [-Wimplicit-function-declaration]
248 | ktime_to_seconds(pool->user.detach_time)))
| ^~~~~~~~~~~~~~~~
| ktime_get_seconds
vim +248 net/core/page_pool_user.c
214
215 static int
216 page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
217 const struct genl_info *info)
218 {
219 size_t inflight, refsz;
220 unsigned int napi_id;
221 void *hdr;
222
223 hdr = genlmsg_iput(rsp, info);
224 if (!hdr)
225 return -EMSGSIZE;
226
227 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id))
228 goto err_cancel;
229
230 if (pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
231 nla_put_u32(rsp, NETDEV_A_PAGE_POOL_IFINDEX,
232 pool->slow.netdev->ifindex))
233 goto err_cancel;
234
235 napi_id = pool->p.napi ? READ_ONCE(pool->p.napi->napi_id) : 0;
236 if (napi_id_valid(napi_id) &&
237 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_NAPI_ID, napi_id))
238 goto err_cancel;
239
240 inflight = page_pool_inflight(pool, false);
241 refsz = PAGE_SIZE << pool->p.order;
242 if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT, inflight) ||
243 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
244 inflight * refsz))
245 goto err_cancel;
246 if (pool->user.detach_time &&
247 nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> 248 ktime_to_seconds(pool->user.detach_time)))
249 goto err_cancel;
250
251 if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
252 goto err_cancel;
253
254 genlmsg_end(rsp, hdr);
255
256 return 0;
257 err_cancel:
258 genlmsg_cancel(rsp, hdr);
259 return -EMSGSIZE;
260 }
261
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-08 0:10 ` Eric Dumazet
@ 2026-03-08 16:21 ` Jakub Kicinski
0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2026-03-08 16:21 UTC (permalink / raw)
To: Eric Dumazet
Cc: davem, netdev, pabeni, andrew+netdev, horms, hawk,
ilias.apalodimas
On Sun, 8 Mar 2026 01:10:55 +0100 Eric Dumazet wrote:
> > --- a/net/core/page_pool_user.c
> > +++ b/net/core/page_pool_user.c
> > @@ -245,7 +245,7 @@ page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
> > goto err_cancel;
>
> It is a bit unclear if we always hold page_pools_lock at this point.
>
> If not, a READ_ONCE(pool->user.detach_time) here would be needed,
> and a corresponding WRITE_ONCE() in page_pool_detached()
There's a bit of convoluted wrapping to share the code between page
pool access and access to stats, but AFAICT page_pools_lock should
be consistently held by readers and writers.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
` (4 preceding siblings ...)
2026-03-08 5:17 ` kernel test robot
@ 2026-03-09 9:42 ` Jesper Dangaard Brouer
5 siblings, 0 replies; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2026-03-09 9:42 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, ilias.apalodimas
On 07/03/2026 21.40, Jakub Kicinski wrote:
> While testing other changes in vng I noticed that
> nl_netdev.page_pool_check flakes. This never happens in real CI.
>
> Turns out vng may boot and get to that test in less than a second.
> page_pool_detached() records the detach time in seconds, so if
> vng is fast enough detach time is set to 0. Other code treats
> 0 as "not detached". detach_time is only used to report the state
> to the user, so it's not a huge deal in practice but let's fix it.
> Store the raw ktime_t (nanoseconds) instead. A nanosecond value
> of 0 is practically impossible.
>
> Fixes: 69cb4952b6f6 ("net: page_pool: report when page pool was destroyed")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: hawk@kernel.org
LGTM -- after addressing in build errors... likely a missing include?
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> CC: ilias.apalodimas@linaro.org
> ---
> include/net/page_pool/types.h | 2 +-
> net/core/page_pool_user.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> index 0d453484a585..cdd95477af7a 100644
> --- a/include/net/page_pool/types.h
> +++ b/include/net/page_pool/types.h
> @@ -247,7 +247,7 @@ struct page_pool {
> /* User-facing fields, protected by page_pools_lock */
> struct {
> struct hlist_node list;
> - u64 detach_time;
> + ktime_t detach_time;
> u32 id;
> } user;
> };
> diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
> index c82a95beceff..fb4ca27358cd 100644
> --- a/net/core/page_pool_user.c
> +++ b/net/core/page_pool_user.c
> @@ -245,7 +245,7 @@ page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
> goto err_cancel;
> if (pool->user.detach_time &&
> nla_put_uint(rsp, NETDEV_A_PAGE_POOL_DETACH_TIME,
> - pool->user.detach_time))
> + ktime_to_seconds(pool->user.detach_time)))
Hmm.. is this ktime_to_seconds even defined?
A quick look tells me that we could use:
ktime_divns(pool->user.detach_time, NSEC_PER_SEC)
> goto err_cancel;
>
> if (pool->mp_ops && pool->mp_ops->nl_fill(pool->mp_priv, rsp, NULL))
> @@ -337,7 +337,7 @@ int page_pool_list(struct page_pool *pool)
> void page_pool_detached(struct page_pool *pool)
> {
> mutex_lock(&page_pools_lock);
> - pool->user.detach_time = ktime_get_boottime_seconds();
> + pool->user.detach_time = ktime_get_boottime();
> netdev_nl_page_pool_event(pool, NETDEV_CMD_PAGE_POOL_CHANGE_NTF);
> mutex_unlock(&page_pools_lock);
> }
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-09 9:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07 20:40 [PATCH net] page_pool: store detach_time as ktime_t to avoid false-negatives Jakub Kicinski
2026-03-08 0:10 ` Eric Dumazet
2026-03-08 16:21 ` Jakub Kicinski
2026-03-08 4:54 ` kernel test robot
2026-03-08 5:05 ` kernel test robot
2026-03-08 5:06 ` kernel test robot
2026-03-08 5:17 ` kernel test robot
2026-03-09 9:42 ` Jesper Dangaard Brouer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox