Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2018 15:44:36 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329216 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201802131544.w1DFiaJ7039912@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Feb 13 15:44:35 2018
New Revision: 329216
URL: https://svnweb.freebsd.org/changeset/base/329216

Log:
  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

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_lock(page);
-	vm_page_unwire(page, PQ_ACTIVE);
+	if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL)
+		vm_page_free(page);
 	vm_page_unlock(page);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802131544.w1DFiaJ7039912>