Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Slight code re-structure and wrap a long line. Inte...
details: https://anonhg.NetBSD.org/src/rev/b5d323bd28da
branches: trunk
changeset: 1029074:b5d323bd28da
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Dec 20 22:40:46 2021 +0000
description:
Slight code re-structure and wrap a long line. Interestingly this gives
the same binary before and after.
diffstat:
sys/uvm/uvm_pglist.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diffs (67 lines):
diff -r 4373445ae6ec -r b5d323bd28da sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c Mon Dec 20 20:34:58 2021 +0000
+++ b/sys/uvm/uvm_pglist.c Mon Dec 20 22:40:46 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pglist.c,v 1.88 2021/03/26 09:35:18 chs Exp $ */
+/* $NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll 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.88 2021/03/26 09:35:18 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -125,18 +125,19 @@
low = atop(low);
high = atop(high);
- alignment = atop(alignment);
/*
* Make sure that physseg falls within with range to be allocated from.
*/
- if (high <= uvm_physseg_get_avail_start(psi) || low >= uvm_physseg_get_avail_end(psi))
+ if (high <= uvm_physseg_get_avail_start(psi) ||
+ low >= uvm_physseg_get_avail_end(psi))
return 0;
/*
* We start our search at the just after where the last allocation
* succeeded.
*/
+ alignment = atop(alignment);
candidate = roundup2(uimax(low, uvm_physseg_get_avail_start(psi) +
uvm_physseg_get_start_hint(psi)), alignment);
limit = uimin(high, uvm_physseg_get_avail_end(psi));
@@ -527,12 +528,6 @@
low = atop(low);
high = atop(high);
- todo = num;
- candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
- uvm_physseg_get_start_hint(psi));
- limit = uimin(high, uvm_physseg_get_avail_end(psi));
- pg = uvm_physseg_get_pg(psi, candidate - uvm_physseg_get_start(psi));
- second_pass = false;
/*
* Make sure that physseg falls within with range to be allocated from.
@@ -541,6 +536,13 @@
low >= uvm_physseg_get_avail_end(psi))
return 0;
+ todo = num;
+ candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
+ uvm_physseg_get_start_hint(psi));
+ limit = uimin(high, uvm_physseg_get_avail_end(psi));
+ pg = uvm_physseg_get_pg(psi, candidate - uvm_physseg_get_start(psi));
+ second_pass = false;
+
again:
for (;; candidate++, pg++) {
if (candidate >= limit) {
Home |
Main Index |
Thread Index |
Old Index