From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
Andy Lutomirski <luto@amacapital.net>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
X86 ML <x86@kernel.org>, Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: Proof-of-concept: better(?) page-table manipulation API
Date: Mon, 7 May 2018 16:10:59 +0300 [thread overview]
Message-ID: <20180507131059.3cdpfd4dcnwznhyw@black.fi.intel.com> (raw)
In-Reply-To: <20180507122346.GE18116@bombadil.infradead.org>
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
next prev parent reply other threads:[~2018-05-07 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 15:43 Proof-of-concept: better(?) page-table manipulation API Kirill A. Shutemov
2018-05-04 21:12 ` Matthew Wilcox
2018-05-04 21:49 ` Kirill A. Shutemov
2018-05-07 4:51 ` Andy Lutomirski
2018-05-07 11:31 ` Kirill A. Shutemov
2018-05-07 12:23 ` Matthew Wilcox
2018-05-07 13:10 ` Kirill A. Shutemov [this message]
2018-05-08 21:04 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180507131059.3cdpfd4dcnwznhyw@black.fi.intel.com \
--to=kirill.shutemov@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=mhocko@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).