From owner-freebsd-current@FreeBSD.ORG Wed Oct 10 06:55:22 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E81216A418 for ; Wed, 10 Oct 2007 06:55:22 +0000 (UTC) (envelope-from janm@transactionware.com) Received: from mail.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.freebsd.org (Postfix) with SMTP id 4CAA213C44B for ; Wed, 10 Oct 2007 06:55:21 +0000 (UTC) (envelope-from janm@transactionware.com) Received: (qmail 84394 invoked from network); 10 Oct 2007 06:27:31 -0000 Received: from midgard.transactionware.com (192.168.1.55) by dm.transactionware.com with SMTP; 10 Oct 2007 06:27:31 -0000 Received: (qmail 45512 invoked by uid 907); 10 Oct 2007 06:28:37 -0000 Received: from [192.168.1.51] (HELO janmxp) (192.168.1.51) by midgard.transactionware.com (qpsmtpd/0.32) with ESMTP; Wed, 10 Oct 2007 16:28:37 +1000 From: "Jan Mikkelsen" To: "'Igor Sysoev'" , References: <20071009125001.GC5758@rambler-co.ru> <20071010055748.GA18931@rambler-co.ru> <20071010060605.GB18931@rambler-co.ru> In-Reply-To: <20071010060605.GB18931@rambler-co.ru> Date: Wed, 10 Oct 2007 16:28:36 +1000 Organization: Transactionware Message-ID: <001b01c80b06$ca1c9800$5e55c800$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcgLA8p8pAf2uSC0R0S3UW95XAfPowAAqWOA Content-Language: en-au X-Mailman-Approved-At: Wed, 10 Oct 2007 11:25:16 +0000 Cc: Subject: RE: sendfile and page usage statistics X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2007 06:55:22 -0000 Hi, Igor Sysoev wrote: > As I understand the following patch against uipc_syscalls.c > should fix the bug to some extent: > > if (pg->valid && vm_page_is_valid(pg, > pgoff, xfsize)) > + vm_page_flag_set(pg, > PG_REFERENCED); > VM_OBJECT_UNLOCK(obj); > else if (m != NULL) > Without knowing anything at all about the surrounding code, I suspect this patch is missing some braces. The change should probably look like this: if (pg->valid && vm_page_is_valid(pg, pgoff, xfsize)) { vm_page_flag_set(pg, PG_REFERENCED); VM_OBJECT_UNLOCK(obj); } else if (m != NULL) I don't think you'll get the behaviour you expect with your change. Regards, Jan Mikkelsen