RE: sendfile and page usage statistics

From: Jan Mikkelsen <janm_at_transactionware.com>
Date: Wed, 10 Oct 2007 16:28:36 +1000
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
Received on Wed Oct 10 2007 - 04:55:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC