mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add necessary spl protection for swapper. The problem was located by
Alfred while testing his SPLASSERT stuff. This is not a complete fix,
more protections are probably needed.
This commit is contained in:
parent
7c58e473f5
commit
25db2c5417
3 changed files with 19 additions and 3 deletions
|
|
@ -702,8 +702,6 @@ swap_pager_copy(srcobject, dstobject, offset, destroysource)
|
|||
* distance. We do not try to restrict it to the swap device stripe
|
||||
* (that is handled in getpages/putpages). It probably isn't worth
|
||||
* doing here.
|
||||
*
|
||||
* This routine must be called at splvm().
|
||||
*/
|
||||
|
||||
boolean_t
|
||||
|
|
@ -714,14 +712,17 @@ swap_pager_haspage(object, pindex, before, after)
|
|||
int *after;
|
||||
{
|
||||
daddr_t blk0;
|
||||
int s;
|
||||
|
||||
/*
|
||||
* do we have good backing store at the requested index ?
|
||||
*/
|
||||
|
||||
s = splvm();
|
||||
blk0 = swp_pager_meta_ctl(object, pindex, 0);
|
||||
|
||||
if (blk0 == SWAPBLK_NONE) {
|
||||
splx(s);
|
||||
if (before)
|
||||
*before = 0;
|
||||
if (after)
|
||||
|
|
@ -764,7 +765,7 @@ swap_pager_haspage(object, pindex, before, after)
|
|||
}
|
||||
*after = (i - 1);
|
||||
}
|
||||
|
||||
splx(s);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1151,6 +1151,7 @@ vm_pageout_page_stats()
|
|||
int pcount,tpcount; /* Number of pages to check */
|
||||
static int fullintervalcount = 0;
|
||||
int page_shortage;
|
||||
int s0;
|
||||
|
||||
page_shortage =
|
||||
(cnt.v_inactive_target + cnt.v_cache_max + cnt.v_free_min) -
|
||||
|
|
@ -1159,6 +1160,8 @@ vm_pageout_page_stats()
|
|||
if (page_shortage <= 0)
|
||||
return;
|
||||
|
||||
s0 = splvm();
|
||||
|
||||
pcount = cnt.v_active_count;
|
||||
fullintervalcount += vm_pageout_stats_interval;
|
||||
if (fullintervalcount < vm_pageout_full_stats_interval) {
|
||||
|
|
@ -1227,6 +1230,7 @@ vm_pageout_page_stats()
|
|||
|
||||
m = next;
|
||||
}
|
||||
splx(s0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -146,6 +146,17 @@ vm_pager_put_pages(
|
|||
(object, m, count, flags, rtvals);
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_pager_haspage
|
||||
*
|
||||
* Check to see if an object's pager has the requested page. The
|
||||
* object's pager will also set before and after to give the caller
|
||||
* some idea of the number of pages before and after the requested
|
||||
* page can be I/O'd efficiently.
|
||||
*
|
||||
* This routine does not have to be called at any particular spl.
|
||||
*/
|
||||
|
||||
static __inline boolean_t
|
||||
vm_pager_has_page(
|
||||
vm_object_t object,
|
||||
|
|
|
|||
Loading…
Reference in a new issue