tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
head:   823b45b4f154384941d57e124ed726847e293b36
commit: 823b45b4f154384941d57e124ed726847e293b36 [1/1] virtio_balloon: fix 
deadlock on OOM
config: i386-randconfig-x001-201745 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 823b45b4f154384941d57e124ed726847e293b36
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   drivers/virtio/virtio_balloon.c: In function 'fill_balloon':
>> drivers/virtio/virtio_balloon.c:164:3: error: implicit declaration of 
>> function 'balloon_page_push' [-Werror=implicit-function-declaration]
      balloon_page_push(&pages, page);
      ^~~~~~~~~~~~~~~~~
>> drivers/virtio/virtio_balloon.c:174:17: error: implicit declaration of 
>> function 'balloon_page_pop' [-Werror=implicit-function-declaration]
     while ((page = balloon_page_pop(&pages))) {
                    ^~~~~~~~~~~~~~~~
>> drivers/virtio/virtio_balloon.c:174:15: warning: assignment makes pointer 
>> from integer without a cast [-Wint-conversion]
     while ((page = balloon_page_pop(&pages))) {
                  ^
   cc1: some warnings being treated as errors

vim +/balloon_page_push +164 drivers/virtio/virtio_balloon.c

   143  
   144  static unsigned fill_balloon(struct virtio_balloon *vb, size_t num)
   145  {
   146          unsigned num_allocated_pages;
   147          unsigned num_pfns;
   148          struct page *page;
   149          LIST_HEAD(pages);
   150  
   151          for (num_pfns = 0; num_pfns < num;
   152               num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
   153                  struct page *page = balloon_page_alloc();
   154  
   155                  if (!page) {
   156                          dev_info_ratelimited(&vb->vdev->dev,
   157                                               "Out of puff! Can't get %u 
pages\n",
   158                                               
VIRTIO_BALLOON_PAGES_PER_PAGE);
   159                          /* Sleep for at least 1/5 of a second before 
retry. */
   160                          msleep(200);
   161                          break;
   162                  }
   163  
 > 164                  balloon_page_push(&pages, page);
   165          }
   166  
   167          /* We can only do one array worth at a time. */
   168          num = min(num, ARRAY_SIZE(vb->pfns));
   169  
   170          mutex_lock(&vb->balloon_lock);
   171  
   172          vb->num_pfns = 0;
   173  
 > 174          while ((page = balloon_page_pop(&pages))) {
   175                  balloon_page_enqueue(&vb->vb_dev_info, page);
   176  
   177                  vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE;
   178  
   179                  set_page_pfns(vb, vb->pfns + vb->num_pfns, page);
   180                  vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
   181                  if (!virtio_has_feature(vb->vdev,
   182                                          
VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
   183                          adjust_managed_page_count(page, -1);
   184          }
   185  
   186          num_allocated_pages = vb->num_pfns;
   187          /* Did we get any? */
   188          if (vb->num_pfns != 0)
   189                  tell_host(vb, vb->inflate_vq);
   190          mutex_unlock(&vb->balloon_lock);
   191  
   192          return num_allocated_pages;
   193  }
   194  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to