From: toshi.kani@hpe.com (Kani, Toshi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table
Date: Thu, 8 Mar 2018 15:56:30 +0000 [thread overview]
Message-ID: <1520527285.2693.56.camel@hpe.com> (raw)
In-Reply-To: <20180308040016.GB9082@bombadil.infradead.org>
On Wed, 2018-03-07 at 20:00 -0800, Matthew Wilcox wrote:
> On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote:
> > +/**
> > + * pud_free_pmd_page - clear pud entry and free pmd page
> > + *
> > + * Returns 1 on success and 0 on failure (pud not cleared).
> > + */
> > +int pud_free_pmd_page(pud_t *pud)
> > +{
> > + return pud_none(*pud);
> > +}
>
> Wouldn't it be clearer if you returned 'bool' instead of 'int' here?
I thought about it and decided to use 'int' since all other pud/pmd/pte
interfaces, such as pud_none() above, use 'int'.
> Also you didn't document the pud parameter, nor use the approved form
> for documenting the return type, nor the calling context. So I would
> have written it out like this:
>
> /**
> * pud_free_pmd_page - Clear pud entry and free pmd page.
> * @pud: Pointer to a PUD.
> *
> * Context: Caller should hold mmap_sem write-locked.
> * Return: %true if clearing the entry succeeded.
> */
Will do.
Thanks!
-Toshi
next prev parent reply other threads:[~2018-03-08 15:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 18:32 [PATCH 0/2] fix memory leak / panic in ioremap huge pages Toshi Kani
2018-03-07 18:32 ` [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table Toshi Kani
2018-03-07 22:54 ` Andrew Morton
2018-03-07 23:02 ` Kani, Toshi
2018-03-07 22:55 ` Andrew Morton
2018-03-08 4:00 ` Matthew Wilcox
2018-03-08 15:56 ` Kani, Toshi [this message]
2018-03-08 22:07 ` Matthew Wilcox
2018-03-08 23:27 ` Kani, Toshi
2018-03-08 8:08 ` Ingo Molnar
2018-03-08 18:04 ` Will Deacon
2018-03-08 19:30 ` Kani, Toshi
2018-03-07 18:32 ` [PATCH 2/2] x86/mm: implement free pmd/pte page interfaces Toshi Kani
2018-03-07 23:01 ` Andrew Morton
2018-03-07 23:22 ` Kani, Toshi
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=1520527285.2693.56.camel@hpe.com \
--to=toshi.kani@hpe.com \
--cc=linux-arm-kernel@lists.infradead.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).