Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm in uvm_pglistalloc_contig_aggressive(), avoid lookin...



details:   https://anonhg.NetBSD.org/src/rev/5f62f3353e0f
branches:  trunk
changeset: 960680:5f62f3353e0f
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Mar 26 09:35:18 2021 +0000

description:
in uvm_pglistalloc_contig_aggressive(), avoid looking forward past
the end of the target range of the physseg.
fixes PR 56074.

diffstat:

 sys/uvm/uvm_pglist.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 1b3b0e29b7bf -r 5f62f3353e0f sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c      Fri Mar 26 08:21:32 2021 +0000
+++ b/sys/uvm/uvm_pglist.c      Fri Mar 26 09:35:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pglist.c,v 1.87 2021/03/24 06:37:27 skrll Exp $    */
+/*     $NetBSD: uvm_pglist.c,v 1.88 2021/03/26 09:35:18 chs Exp $      */
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.87 2021/03/24 06:37:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.88 2021/03/26 09:35:18 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -401,6 +401,9 @@
                 * Look forward for any remaining pages.
                 */
 
+               if (spa + ptoa(num) > rhi) {
+                       continue;
+               }
                for (; run < num; run++) {
                        pg = PHYS_TO_VM_PAGE(spa + ptoa(run));
                        if ((pg->flags & PG_PGLCA) == 0) {



Home | Main Index | Thread Index | Old Index