From: Venkatesh Srinivas Date: Wed, 25 Aug 2010 03:31:07 +0000 (-0700) Subject: vm: Idlezero changes X-Git-Tag: v2.9.0~408 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/8787825a65f14bcf19955bf9fd4fe5bcfc25865e vm: Idlezero changes * Restore yield to idlezero loop; we lwkt_yield() every 64-bytes rather than every page now. * Unmark as MPSAFE; we are not MPSAFE, we hold the MP lock. When the page queues are safe to access with the vm token alone, we can revert to a prior edition of this code, which was mpsafe. --- diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index ae5ff93d97..2d286e6e48 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -1,6 +1,4 @@ /* - * (MPSAFE) - * * Copyright (c) 1994 John Dyson * Copyright (c) 2001 Matt Dillon * Copyright (c) 2010 The DragonFly Project @@ -62,7 +60,7 @@ #define ZIDLE_HI(v) ((v) * 4 / 5) /* Number of bytes to zero between reschedule checks */ -#define IDLEZERO_RUN (32) +#define IDLEZERO_RUN (64) /* Maximum number of pages per second to zero */ #define NPAGES_RUN (20000) @@ -204,8 +202,7 @@ vm_pagezero(void __unused *arg) break; case STATE_ZERO_PAGE: /* - * Zero-out the page, stop immediately if a - * resched has been requested. + * Zero-out the page */ while (i < PAGE_SIZE) { if (idlezero_nocache == 1) @@ -213,9 +210,9 @@ vm_pagezero(void __unused *arg) else bzero(&pg[i], IDLEZERO_RUN); i += IDLEZERO_RUN; + lwkt_yield(); } - if (i == PAGE_SIZE) - state = STATE_RELEASE_PAGE; + state = STATE_RELEASE_PAGE; break; case STATE_RELEASE_PAGE: lwbuf_free(buf);