lkml.org 
[lkml]   [2018]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Proof-of-concept: better(?) page-table manipulation API
On Mon, May 07, 2018 at 12:23:46PM +0000, Matthew Wilcox wrote:
> On Mon, May 07, 2018 at 02:31:25PM +0300, Kirill A. Shutemov wrote:
> > > Also, what does lvl == 0 mean? Is it the top or the bottom? I think a
> > > comment would be helpful.
> >
> > It is bottom. But it should be up to architecture to decide.
>
> That's not true because ...
>
> > > > +static inline void ptp_walk(ptp_t *ptp, unsigned long addr)
> > > > +{
> > > > + ptp->ptr = (unsigned long *)ptp_page_vaddr(ptp);
> > > > + ptp->ptr += __pt_index(addr, --ptp->lvl);
> > > > +}
> > >
> > > Can you add a comment that says what this function does?
> >
> > Okay, I will.
> >
> > > Why does it not change the level?
> >
> > It does. --ptp->lvl.
>
> ... you've hardcoded that walking down decrements the level by 1.
>
> I don't see that as a defect; it's just part of the API that needs
> documenting.

You assume that the function is a generic one. This may or may not be
true.

This is subject for refinement anyway.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2018-05-07 15:11    [W:0.107 / U:2.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site