mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
Make the conversion from the default pager to swap pager more robust
in the face of low memory conditions.
This commit is contained in:
parent
c51bd6784e
commit
a9d4727439
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15887
@ -28,7 +28,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: default_pager.c,v 1.5 1995/12/14 09:54:46 phk Exp $
|
||||
* $Id: default_pager.c,v 1.6 1996/01/19 03:59:36 dyson Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -125,10 +125,12 @@ default_pager_putpages(object, m, c, sync, rtvals)
|
||||
object->type = OBJT_SWAP;
|
||||
|
||||
if (swap_pager_swp_alloc(object, M_KERNEL) != 0) {
|
||||
object->type = OBJT_DEFAULT;
|
||||
for (i = 0; i < c; i++)
|
||||
rtvals[i] = VM_PAGER_FAIL;
|
||||
return VM_PAGER_FAIL;
|
||||
if (swap_pager_swp_alloc(object, M_NOWAIT) != 0) {
|
||||
object->type = OBJT_DEFAULT;
|
||||
for (i = 0; i < c; i++)
|
||||
rtvals[i] = VM_PAGER_FAIL;
|
||||
return VM_PAGER_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return swap_pager_putpages(object, m, c, sync, rtvals);
|
||||
|
Loading…
Reference in New Issue
Block a user