Re: [PATCH 0/5] mm improvements

Nikita Danilov
2004-02-05T15:46:52Z

Nick Piggin writes:
>
>
> Nikita Danilov wrote:
>
> >Nick Piggin writes:
> > >
> > >
> > > Nick Piggin wrote:
> > >
> > > >
> > > > + pte_dirty = page_pte_is_dirty(page, pte_paddr);
> > > > + if (pte_dirty != 0)
> > > > + ret = pte_dirty;
> > > >
> > > >
> > > > Won't this leave ret in a random state? Should it be ret++?
> > > >
> > >
> > > ... must be past my bedtime.
> > >
> >
> >Well, @ret handling is kind of obscure in this function, right.
> >
> >
>
> Yeah... I think it actually could be:
>
> pte_dirty = page_pte_is_dirty(page, pte_paddr);
> if (pte_dirty < 0) {
> ret = pte_dirty;
> goto out;
> }
> ret += pte_dirty; /* if (pte_dirty) ret++; */
>

You mean so as to return number of dirty pte's, rather than just +1?
This may be useful.

> ...
>
> out:
> return ret;
>
> Right?
>

Nikita.