From owner-freebsd-hackers Thu Jul 9 09:38:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA08665 for freebsd-hackers-outgoing; Thu, 9 Jul 1998 09:38:20 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun1 (bingsun1.cc.binghamton.edu [128.226.1.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA08656 for ; Thu, 9 Jul 1998 09:38:18 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun1 (SMI-8.6/8.6.9) with SMTP id MAA25245 for ; Thu, 9 Jul 1998 12:38:12 -0400 Date: Thu, 9 Jul 1998 12:38:11 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun1 To: hackers Subject: default_pager_convert_to_swap() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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