Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 1998 12:38:11 -0400 (EDT)
From:      zhihuizhang <bf20761@binghamton.edu>
To:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   default_pager_convert_to_swap()
Message-ID:  <Pine.SOL.L3.93.980709122643.24556A-100000@bingsun1>

next in thread | raw e-mail | index | archive | help

This maybe trivial.  But default_pager_convert_to_swap() calls
swap_pager_swp_alloc() with a flag M_KERNEL which is never checked
directly. malloc() and kern_malloc() do check M_WAITOK and M_NOWAIT, but
in DIFFERENT ways: & and ==.  So you can not tell whether M_KERNEL is
effectively M_WAITOK or M_NOWAIT.  Besides,
default_pager_convert_to_swap() has no return value, will not call panic()
if it fails. So who knows if it does fail? Or we do not care about the
results?  For example, vm_map_insert()  calls
default_pager_convert_to_swapq() which in turn calls
default_pager_convert_to_swap() (no "q" here), but vm_map_insert() does
not check for possible failure in the conversion. 

BTW, I am reading stable-FreeBSD.  Maybe current-FreeBSD has already
corrected these.  Maybe I am simply wrong.

-------------------------------------------------

Zhihui Zhang

Department of Computer Science
State University of New York at Binghamton

Web Site: http://cs.binghamton.edu/~zzhang

-------------------------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.980709122643.24556A-100000>