Author: kib
Date: Tue Feb 13 15:44:35 2018
New Revision: 329216

  linuxkpi: Do not leak pages on put.
  When the owner of the wire reference releases the last reference, it
  might be that the page was already attempted to be freed (but free
  cannot be performed at that time due to wire).  Check that the page
  was removed from the object as the indicator of the free attempt and
  finish the free operation if so.
  Reported and tested by:       Slava Shwartsman
  Reviewed by:  hselasky
  Sponsored by: Mellanox Technologies
  MFC after:    1 week


Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h
--- head/sys/compat/linuxkpi/common/include/linux/mm.h  Tue Feb 13 15:36:28 
2018        (r329215)
+++ head/sys/compat/linuxkpi/common/include/linux/mm.h  Tue Feb 13 15:44:35 
2018        (r329216)
@@ -243,7 +243,8 @@ static inline void
 put_page(struct vm_page *page)
-       vm_page_unwire(page, PQ_ACTIVE);
+       if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL)
+               vm_page_free(page);
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to