Date: Thu, 7 May 2009 10:37:22 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r191878 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb vm Message-ID: <200905071037.n47AbM9M053188@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu May 7 10:37:22 2009 New Revision: 191878 URL: http://svn.freebsd.org/changeset/base/191878 Log: MFC r191439: Do not call vm_page_lookup() from the ddb routine, namely from "show vmopag" implementation. Iterate over memq to calculate the runs. Make the code slightly more style-compliant. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/vm/vm_object.c Modified: stable/7/sys/vm/vm_object.c ============================================================================== --- stable/7/sys/vm/vm_object.c Thu May 7 10:01:05 2009 (r191877) +++ stable/7/sys/vm/vm_object.c Thu May 7 10:37:22 2009 (r191878) @@ -2197,16 +2197,13 @@ vm_object_print( DB_SHOW_COMMAND(vmopag, vm_object_print_pages) { vm_object_t object; - int nl = 0; - int c; + vm_pindex_t fidx; + vm_paddr_t pa; + vm_page_t m, prev_m; + int rcount, nl, c; + nl = 0; TAILQ_FOREACH(object, &vm_object_list, object_list) { - vm_pindex_t idx, fidx; - vm_pindex_t osize; - vm_paddr_t pa = -1; - int rcount; - vm_page_t m; - db_printf("new object: %p\n", (void *)object); if (nl > 18) { c = cngetc(); @@ -2217,12 +2214,12 @@ DB_SHOW_COMMAND(vmopag, vm_object_print_ nl++; rcount = 0; fidx = 0; - osize = object->size; - if (osize > 128) - osize = 128; - for (idx = 0; idx < osize; idx++) { - m = vm_page_lookup(object, idx); - if (m == NULL) { + pa = -1; + TAILQ_FOREACH(m, &object->memq, listq) { + if (m->pindex > 128) + break; + if ((prev_m = TAILQ_PREV(m, pglist, listq)) != NULL && + prev_m->pindex + 1 != m->pindex) { if (rcount) { db_printf(" index(%ld)run(%d)pa(0x%lx)\n", (long)fidx, rcount, (long)pa); @@ -2235,10 +2232,7 @@ DB_SHOW_COMMAND(vmopag, vm_object_print_ nl++; rcount = 0; } - continue; - } - - + } if (rcount && (VM_PAGE_TO_PHYS(m) == pa + rcount * PAGE_SIZE)) { ++rcount; @@ -2255,7 +2249,7 @@ DB_SHOW_COMMAND(vmopag, vm_object_print_ } nl++; } - fidx = idx; + fidx = m->pindex; pa = VM_PAGE_TO_PHYS(m); rcount = 1; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905071037.n47AbM9M053188>