Skip to contentSkip to conversation

balloon: fix page list locking

DISCUSSION Dan Carpenter 1 participant 1 message Jan 12, 2016 Memory management

lore
Share & tools
lore
#0 lore raw

Hello Michael S. Tsirkin,

The patch 0b5ffdb4f7c6: "balloon: fix page list locking" from Jan 1, 2016, leads to the following static checker warning:

	mm/balloon_compaction.c:116 balloon_page_dequeue()
	error: double unlock 'spin_lock:&b_dev_info->pages_lock'

mm/balloon_compaction.c

   101                          spin_lock_irqsave(&b_dev_info->pages_lock, flags);
   102                          balloon_page_delete(page);
   103                          __count_vm_event(BALLOON_DEFLATE);
   104                          spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Unlock.

   105                          unlock_page(page);
   106                          put_page(page);
   107                          dequeued_page = true;
   108                          break;
   109                  }
   110                  put_page(page);
   111                  spin_lock_irqsave(&b_dev_info->pages_lock, flags);
   112          }
   113  
   114          /* re-add remaining entries */
   115          list_splice(&processed, &b_dev_info->pages);
   116          spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Second unlock.

   117  
   118          if (!dequeued_page) {

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>