From owner-svn-src-all@freebsd.org Mon May 23 16:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8209DB478DC; Mon, 23 May 2016 16:59:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 397E91715; Mon, 23 May 2016 16:59:06 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4NGx5lN001177; Mon, 23 May 2016 16:59:05 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4NGx5jU001176; Mon, 23 May 2016 16:59:05 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605231659.u4NGx5jU001176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 23 May 2016 16:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300522 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 16:59:06 -0000 Author: alc Date: Mon May 23 16:59:05 2016 New Revision: 300522 URL: https://svnweb.freebsd.org/changeset/base/300522 Log: Correct an error in a comment: One of the conditions for page allocation is actually the opposite of that stated in the comment. Remove an unnecessary assignment. Use an assertion to document the fact that no assignment is needed. Rewrite another comment to clarify that the page is not completely valid. Reviewed by: kib Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon May 23 16:49:26 2016 (r300521) +++ head/sys/vm/vm_fault.c Mon May 23 16:59:05 2016 (r300522) @@ -496,11 +496,13 @@ fast_failed: goto readrest; break; } + KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m)); /* - * Page is not resident. If this is the search termination - * or the pager might contain the page, allocate a new page. - * Default objects are zero-fill, there is no real pager. + * Page is not resident. If the pager might contain the page + * or this is the beginning of the search, allocate a new + * page. (Default objects are zero-fill, so there is no real + * pager for them.) */ if (fs.object->type != OBJT_DEFAULT || fs.object == fs.first_object) { @@ -517,7 +519,6 @@ fast_failed: * there, and allocation can fail, causing * restart and new reading of the p_flag. */ - fs.m = NULL; if (!vm_page_count_severe() || P_KILLED(curproc)) { #if VM_NRESERVLEVEL > 0 vm_object_color(fs.object, atop(vaddr) - @@ -541,14 +542,12 @@ fast_failed: readrest: /* - * We have found a valid page or we have allocated a new page. - * The page thus may not be valid or may not be entirely - * valid. + * We have either allocated a new page or found an existing + * page that is only partially valid. * * Attempt to fault-in the page if there is a chance that the * pager has it, and potentially fault in additional pages - * at the same time. For default objects simply provide - * zero-filled pages. + * at the same time. */ if (fs.object->type != OBJT_DEFAULT) { int rv;