From owner-freebsd-current Thu Nov 23 12:35:35 2000 Delivered-To: freebsd-current@freebsd.org Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by hub.freebsd.org (Postfix) with ESMTP id 20A4C37B4C5; Thu, 23 Nov 2000 12:35:32 -0800 (PST) Received: (from alc@localhost) by cs.rice.edu (8.9.0/8.9.0) id OAA00297; Thu, 23 Nov 2000 14:35:30 -0600 (CST) Date: Thu, 23 Nov 2000 14:35:30 -0600 From: Alan Cox To: Mike Smith , Mikulas Patocka Cc: current@freebsd.org Subject: Re: page coloring Message-ID: <20001123143530.E21300@cs.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5us Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi. > > Isn't the page coloring algoritm in _vm_page_list_find totally bogus? > No, it's not. The comment is, however, misplaced. It describes the behavior of an inline function in vm_page.h, and not the function it precedes. > It skips queue pq[index & PQ_L2_MASK]. > That's correct. The inline function vm_page_list_find() in vm_page.h has already failed to allocate a page of the desired color, index, and so _vm_page_list_find() is called to allocate a page of ANY other color it can find. Rather than choose a random page, the odd-looking loop in _vm_page_list_find() tries to find a page whose color is unlikely to equal the neighboring pages in the vm object if colored allocation for them succeeded. Alan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message