Matthew Dillon wrote:
[ ... ]
>     I would appreciate other VM gurus taking a look at the
>     vm_page_set_validclean() changes.
[ ... ]

Not to appoint myself a guru or anything...

> +#if 1
> +       if ((base & (DEV_BSIZE - 1)) || (size & (DEV_BSIZE - 1))) {
> +           int adj;
> +
> +           adj = DEV_BSIZE - (base & (DEV_BSIZE - 1));
> +           base += adj;
> +           if (size < adj)
> +               size = 0;
> +           else
> +               size = (size - adj) & ~(DEV_BSIZE - 1);
> +           pagebits = vm_page_bits(base, size);
> +       }
> +#endif

This seems wrong.

Specifically, it seems to only get the first block, in the case that
(integer math: / is "div"):

        ((size - adj)/DEV_BSIZE) > 1

How about:

                else {
                        /*
                         * Drop partial trailing blocks from the size
                         * calculation to maintain correct dirty bits;
                         * note that 'size' might still span more than
                         * one block, though.
                         */
                        int n_size;     /* probably not int? */

                        n_size = (size - adj) / DEV_BSIZE;
                        size = (size - adj) & ~(DEV_BSIZE - 1);
                        size += n_size * DEV_BSIZE;
                        
                }

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to