[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202412210700.fAOJ9ocm-lkp@intel.com>
Date: Sat, 21 Dec 2024 08:05:56 +0800
From: kernel test robot <lkp@...el.com>
To: Yajun Deng <yajun.deng@...ux.dev>, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
horms@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Yajun Deng <yajun.deng@...ux.dev>
Subject: Re: [PATCH net-next] sock: make SKB_FRAG_PAGE_ORDER equal to
PAGE_ALLOC_COSTLY_ORDER
Hi Yajun,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Yajun-Deng/sock-make-SKB_FRAG_PAGE_ORDER-equal-to-PAGE_ALLOC_COSTLY_ORDER/20241217-185748
base: net-next/main
patch link: https://lore.kernel.org/r/20241217105659.2215649-1-yajun.deng%40linux.dev
patch subject: [PATCH net-next] sock: make SKB_FRAG_PAGE_ORDER equal to PAGE_ALLOC_COSTLY_ORDER
config: openrisc-randconfig-r122-20241220 (https://download.01.org/0day-ci/archive/20241221/202412210700.fAOJ9ocm-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241221/202412210700.fAOJ9ocm-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412210700.fAOJ9ocm-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
net/core/sock.c:2496:9: sparse: sparse: context imbalance in 'sk_clone_lock' - wrong count at exit
net/core/sock.c:2500:6: sparse: sparse: context imbalance in 'sk_free_unlock_clone' - unexpected unlock
>> net/core/sock.c:3044:49: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
vim +3044 net/core/sock.c
5640f7685831e08 Eric Dumazet 2012-09-23 3013
400dfd3ae899849 Eric Dumazet 2013-10-17 3014 /**
400dfd3ae899849 Eric Dumazet 2013-10-17 3015 * skb_page_frag_refill - check that a page_frag contains enough room
400dfd3ae899849 Eric Dumazet 2013-10-17 3016 * @sz: minimum size of the fragment we want to get
400dfd3ae899849 Eric Dumazet 2013-10-17 3017 * @pfrag: pointer to page_frag
82d5e2b8b466d5b Eric Dumazet 2014-09-08 3018 * @gfp: priority for memory allocation
400dfd3ae899849 Eric Dumazet 2013-10-17 3019 *
400dfd3ae899849 Eric Dumazet 2013-10-17 3020 * Note: While this allocator tries to use high order pages, there is
400dfd3ae899849 Eric Dumazet 2013-10-17 3021 * no guarantee that allocations succeed. Therefore, @sz MUST be
400dfd3ae899849 Eric Dumazet 2013-10-17 3022 * less or equal than PAGE_SIZE.
400dfd3ae899849 Eric Dumazet 2013-10-17 3023 */
d9b2938aabf757d Eric Dumazet 2014-08-27 3024 bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t gfp)
5640f7685831e08 Eric Dumazet 2012-09-23 3025 {
5640f7685831e08 Eric Dumazet 2012-09-23 3026 if (pfrag->page) {
fe896d1878949ea Joonsoo Kim 2016-03-17 3027 if (page_ref_count(pfrag->page) == 1) {
5640f7685831e08 Eric Dumazet 2012-09-23 3028 pfrag->offset = 0;
5640f7685831e08 Eric Dumazet 2012-09-23 3029 return true;
5640f7685831e08 Eric Dumazet 2012-09-23 3030 }
400dfd3ae899849 Eric Dumazet 2013-10-17 3031 if (pfrag->offset + sz <= pfrag->size)
5640f7685831e08 Eric Dumazet 2012-09-23 3032 return true;
5640f7685831e08 Eric Dumazet 2012-09-23 3033 put_page(pfrag->page);
5640f7685831e08 Eric Dumazet 2012-09-23 3034 }
5640f7685831e08 Eric Dumazet 2012-09-23 3035
5640f7685831e08 Eric Dumazet 2012-09-23 3036 pfrag->offset = 0;
af87ed7a96a9372 Yajun Deng 2024-12-17 3037 if (!static_branch_unlikely(&net_high_order_alloc_disable_key)) {
d0164adc89f6bb3 Mel Gorman 2015-11-06 3038 /* Avoid direct reclaim but allow kswapd to wake */
d0164adc89f6bb3 Mel Gorman 2015-11-06 3039 pfrag->page = alloc_pages((gfp & ~__GFP_DIRECT_RECLAIM) |
d0164adc89f6bb3 Mel Gorman 2015-11-06 3040 __GFP_COMP | __GFP_NOWARN |
d0164adc89f6bb3 Mel Gorman 2015-11-06 3041 __GFP_NORETRY,
d9b2938aabf757d Eric Dumazet 2014-08-27 3042 SKB_FRAG_PAGE_ORDER);
d9b2938aabf757d Eric Dumazet 2014-08-27 3043 if (likely(pfrag->page)) {
d9b2938aabf757d Eric Dumazet 2014-08-27 @3044 pfrag->size = PAGE_SIZE << SKB_FRAG_PAGE_ORDER;
d9b2938aabf757d Eric Dumazet 2014-08-27 3045 return true;
d9b2938aabf757d Eric Dumazet 2014-08-27 3046 }
d9b2938aabf757d Eric Dumazet 2014-08-27 3047 }
d9b2938aabf757d Eric Dumazet 2014-08-27 3048 pfrag->page = alloc_page(gfp);
d9b2938aabf757d Eric Dumazet 2014-08-27 3049 if (likely(pfrag->page)) {
d9b2938aabf757d Eric Dumazet 2014-08-27 3050 pfrag->size = PAGE_SIZE;
5640f7685831e08 Eric Dumazet 2012-09-23 3051 return true;
5640f7685831e08 Eric Dumazet 2012-09-23 3052 }
400dfd3ae899849 Eric Dumazet 2013-10-17 3053 return false;
400dfd3ae899849 Eric Dumazet 2013-10-17 3054 }
400dfd3ae899849 Eric Dumazet 2013-10-17 3055 EXPORT_SYMBOL(skb_page_frag_refill);
400dfd3ae899849 Eric Dumazet 2013-10-17 3056
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists