Source-Changes archive

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

Re: CVS commit: src/sys/uvm



hi,

> Module Name:  src
> Committed By: pk
> Date:         Thu Aug 28 13:12:21 UTC 2003
> 
> Modified Files:
>       src/sys/uvm: uvm_anon.c uvm_aobj.c uvm_km.c uvm_pager.c uvm_pdaemon.c
>           uvm_swap.c
> 
> Log Message:
> When retiring a swap device with marked bad blocks on it we should update
> the `# swap page in use' and `# swap page only' counters.  However, at the
> time of swap device removal we can no longer figure out how many of the
> bad swap pages are actually also `swap only' pages.
> 
> So, on swap I/O errors arrange things to not include the bad swap pages in
> the `swpgonly' counter as follows: uvm_swap_markbad() decrements `swpgonly'
> by the number of bad pages, and the various VM object deallocation routines
> do not decrement `swpgonly' for swap slots marked as SWSLOT_BAD.
> 
> 
> To generate a diff of this commit:

> cvs rdiff -r1.60 -r1.61 src/sys/uvm/uvm_pager.c

KASSERT can result into no-op.
i think that the following is your intention.

YAMAMOTO Takashi

Index: uvm_pager.c
===================================================================
--- uvm_pager.c (revision 297)
+++ uvm_pager.c (working copy)
@@ -326,9 +326,11 @@ uvm_aio_aiodone(bp)
 
                        if (swap) {
                                if (pg->uobject != NULL) {
-                                       KASSERT(uao_set_swslot(pg->uobject,
-                                               pg->offset >> PAGE_SHIFT,
-                                               slot) == swslot + i);
+                                       int oldslot;
+
+                                       oldslot = uao_set_swslot(pg->uobject,
+                                           pg->offset >> PAGE_SHIFT, slot);
+                                       KASSERT(oldslot == swslot + i);
                                } else {
                                        KASSERT(pg->uanon->an_swslot ==
                                                swslot + i);



Home | Main Index | Thread Index | Old Index