* [mel:mm-bulk-rebase-v5r2 12/13] net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast
@ 2021-03-13 15:24 kernel test robot
2021-03-13 15:35 ` Chuck Lever III
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-03-13 15:24 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4550 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git mm-bulk-rebase-v5r2
head: 5ce1d4eb5aa31146052f4499ca77642afb31165b
commit: fa305fb67e08257558495fdfce8b5863f48c0115 [12/13] SUNRPC: Refresh rq_pages using a bulk page allocator
config: i386-randconfig-a001-20210313 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git/commit/?id=fa305fb67e08257558495fdfce8b5863f48c0115
git remote add mel https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git
git fetch --no-tags mel mm-bulk-rebase-v5r2
git checkout fa305fb67e08257558495fdfce8b5863f48c0115
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
net/sunrpc/svc_xprt.c: In function 'svc_alloc_arg':
>> net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast [-Wint-conversion]
666 | needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
| ^~~~~~
| |
| long unsigned int
In file included from include/linux/slab.h:15,
from net/sunrpc/svc_xprt.c:12:
include/linux/gfp.h:527:71: note: expected 'struct list_head *' but argument is of type 'long unsigned int'
527 | alloc_pages_bulk(gfp_t gfp, unsigned long nr_pages, struct list_head *list)
| ~~~~~~~~~~~~~~~~~~^~~~
net/sunrpc/svc_xprt.c:666:13: error: too many arguments to function 'alloc_pages_bulk'
666 | needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
| ^~~~~~~~~~~~~~~~
In file included from include/linux/slab.h:15,
from net/sunrpc/svc_xprt.c:12:
include/linux/gfp.h:527:1: note: declared here
527 | alloc_pages_bulk(gfp_t gfp, unsigned long nr_pages, struct list_head *list)
| ^~~~~~~~~~~~~~~~
vim +/alloc_pages_bulk +666 net/sunrpc/svc_xprt.c
641
642 static int svc_alloc_arg(struct svc_rqst *rqstp)
643 {
644 struct svc_serv *serv = rqstp->rq_server;
645 unsigned long needed;
646 struct xdr_buf *arg;
647 struct page *page;
648 LIST_HEAD(list);
649 int pages;
650 int i;
651
652 pages = (serv->sv_max_mesg + 2 * PAGE_SIZE) >> PAGE_SHIFT;
653 if (pages > RPCSVC_MAXPAGES) {
654 pr_warn_once("svc: warning: pages=%u > RPCSVC_MAXPAGES=%lu\n",
655 pages, RPCSVC_MAXPAGES);
656 /* use as many pages as possible */
657 pages = RPCSVC_MAXPAGES;
658 }
659
660 for (needed = 0, i = 0; i < pages ; i++) {
661 if (!rqstp->rq_pages[i])
662 needed++;
663 }
664 i = 0;
665 while (needed) {
> 666 needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
667 for (; i < pages; i++) {
668 if (rqstp->rq_pages[i])
669 continue;
670 page = list_first_entry_or_null(&list, struct page, lru);
671 if (likely(page)) {
672 list_del(&page->lru);
673 rqstp->rq_pages[i] = page;
674 continue;
675 }
676 set_current_state(TASK_INTERRUPTIBLE);
677 if (signalled() || kthread_should_stop()) {
678 set_current_state(TASK_RUNNING);
679 return -EINTR;
680 }
681 schedule_timeout(msecs_to_jiffies(500));
682 break;
683 }
684 }
685 rqstp->rq_page_end = &rqstp->rq_pages[pages];
686 rqstp->rq_pages[pages] = NULL; /* this might be seen in nfsd_splice_actor() */
687
688 /* Make arg->head point to first page and arg->pages point to rest */
689 arg = &rqstp->rq_arg;
690 arg->head[0].iov_base = page_address(rqstp->rq_pages[0]);
691 arg->head[0].iov_len = PAGE_SIZE;
692 arg->pages = rqstp->rq_pages + 1;
693 arg->page_base = 0;
694 /* save at least one page for response */
695 arg->page_len = (pages-2)*PAGE_SIZE;
696 arg->len = (pages-1)*PAGE_SIZE;
697 arg->tail[0].iov_len = 0;
698 return 0;
699 }
700
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34309 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [mel:mm-bulk-rebase-v5r2 12/13] net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast
2021-03-13 15:24 [mel:mm-bulk-rebase-v5r2 12/13] net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast kernel test robot
@ 2021-03-13 15:35 ` Chuck Lever III
2021-03-14 12:53 ` Mel Gorman
0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever III @ 2021-03-13 15:35 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4926 bytes --]
I built this against an old version of the alloc_pages_bulk() API,
I guess. Looks like a simple fix, just drop the "0" argument.
> On Mar 13, 2021, at 10:24 AM, kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git mm-bulk-rebase-v5r2
> head: 5ce1d4eb5aa31146052f4499ca77642afb31165b
> commit: fa305fb67e08257558495fdfce8b5863f48c0115 [12/13] SUNRPC: Refresh rq_pages using a bulk page allocator
> config: i386-randconfig-a001-20210313 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
> # https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git/commit/?id=fa305fb67e08257558495fdfce8b5863f48c0115
> git remote add mel https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git
> git fetch --no-tags mel mm-bulk-rebase-v5r2
> git checkout fa305fb67e08257558495fdfce8b5863f48c0115
> # save the attached .config to linux build tree
> make W=1 ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> net/sunrpc/svc_xprt.c: In function 'svc_alloc_arg':
>>> net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast [-Wint-conversion]
> 666 | needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
> | ^~~~~~
> | |
> | long unsigned int
> In file included from include/linux/slab.h:15,
> from net/sunrpc/svc_xprt.c:12:
> include/linux/gfp.h:527:71: note: expected 'struct list_head *' but argument is of type 'long unsigned int'
> 527 | alloc_pages_bulk(gfp_t gfp, unsigned long nr_pages, struct list_head *list)
> | ~~~~~~~~~~~~~~~~~~^~~~
> net/sunrpc/svc_xprt.c:666:13: error: too many arguments to function 'alloc_pages_bulk'
> 666 | needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
> | ^~~~~~~~~~~~~~~~
> In file included from include/linux/slab.h:15,
> from net/sunrpc/svc_xprt.c:12:
> include/linux/gfp.h:527:1: note: declared here
> 527 | alloc_pages_bulk(gfp_t gfp, unsigned long nr_pages, struct list_head *list)
> | ^~~~~~~~~~~~~~~~
>
>
> vim +/alloc_pages_bulk +666 net/sunrpc/svc_xprt.c
>
> 641
> 642 static int svc_alloc_arg(struct svc_rqst *rqstp)
> 643 {
> 644 struct svc_serv *serv = rqstp->rq_server;
> 645 unsigned long needed;
> 646 struct xdr_buf *arg;
> 647 struct page *page;
> 648 LIST_HEAD(list);
> 649 int pages;
> 650 int i;
> 651
> 652 pages = (serv->sv_max_mesg + 2 * PAGE_SIZE) >> PAGE_SHIFT;
> 653 if (pages > RPCSVC_MAXPAGES) {
> 654 pr_warn_once("svc: warning: pages=%u > RPCSVC_MAXPAGES=%lu\n",
> 655 pages, RPCSVC_MAXPAGES);
> 656 /* use as many pages as possible */
> 657 pages = RPCSVC_MAXPAGES;
> 658 }
> 659
> 660 for (needed = 0, i = 0; i < pages ; i++) {
> 661 if (!rqstp->rq_pages[i])
> 662 needed++;
> 663 }
> 664 i = 0;
> 665 while (needed) {
>> 666 needed -= alloc_pages_bulk(GFP_KERNEL, 0, needed, &list);
> 667 for (; i < pages; i++) {
> 668 if (rqstp->rq_pages[i])
> 669 continue;
> 670 page = list_first_entry_or_null(&list, struct page, lru);
> 671 if (likely(page)) {
> 672 list_del(&page->lru);
> 673 rqstp->rq_pages[i] = page;
> 674 continue;
> 675 }
> 676 set_current_state(TASK_INTERRUPTIBLE);
> 677 if (signalled() || kthread_should_stop()) {
> 678 set_current_state(TASK_RUNNING);
> 679 return -EINTR;
> 680 }
> 681 schedule_timeout(msecs_to_jiffies(500));
> 682 break;
> 683 }
> 684 }
> 685 rqstp->rq_page_end = &rqstp->rq_pages[pages];
> 686 rqstp->rq_pages[pages] = NULL; /* this might be seen in nfsd_splice_actor() */
> 687
> 688 /* Make arg->head point to first page and arg->pages point to rest */
> 689 arg = &rqstp->rq_arg;
> 690 arg->head[0].iov_base = page_address(rqstp->rq_pages[0]);
> 691 arg->head[0].iov_len = PAGE_SIZE;
> 692 arg->pages = rqstp->rq_pages + 1;
> 693 arg->page_base = 0;
> 694 /* save at least one page for response */
> 695 arg->page_len = (pages-2)*PAGE_SIZE;
> 696 arg->len = (pages-1)*PAGE_SIZE;
> 697 arg->tail[0].iov_len = 0;
> 698 return 0;
> 699 }
> 700
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> <.config.gz>
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [mel:mm-bulk-rebase-v5r2 12/13] net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast
2021-03-13 15:35 ` Chuck Lever III
@ 2021-03-14 12:53 ` Mel Gorman
0 siblings, 0 replies; 3+ messages in thread
From: Mel Gorman @ 2021-03-14 12:53 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
On Sat, Mar 13, 2021 at 03:35:21PM +0000, Chuck Lever III wrote:
> I built this against an old version of the alloc_pages_bulk() API,
> I guess. Looks like a simple fix, just drop the "0" argument.
>
Yeah, I found that when the patch was uploaded to my grid for testing
which happened after the korg push.
--
Mel Gorman
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-14 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-13 15:24 [mel:mm-bulk-rebase-v5r2 12/13] net/sunrpc/svc_xprt.c:666:45: warning: passing argument 3 of 'alloc_pages_bulk' makes pointer from integer without a cast kernel test robot
2021-03-13 15:35 ` Chuck Lever III
2021-03-14 12:53 ` Mel Gorman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.