From: Jiri Slaby <jirislaby@gmail.com>
To: "Robert P. J. Day" <rpjday@mindspring.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Replace __get_free_page() + memset(0) with get_zeroed_page() calls.
Date: Wed, 03 Jan 2007 15:18:07 +0059 [thread overview]
Message-ID: <459BBB36.1070907@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0701030845500.5042@localhost.localdomain>
Robert P. J. Day wrote:
> Replace the small number of combinations of __get_free_page() plus a
> call to memset(...,0,PAGE_SIZE) with a single call to
> get_zeroed_page().
>
> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
>
> ---
>
> all of the following simplifications *look* valid, but i'm happy to
> be convinced otherwise.
>
>
> arch/sparc/mm/sun4c.c | 4 +---
> arch/sparc64/kernel/pci_iommu.c | 3 +--
> drivers/s390/net/qeth_eddp.c | 3 +--
> include/asm-m68k/sun3_pgalloc.h | 3 +--
> include/asm-um/pgtable-3level.h | 5 +----
> sound/oss/emu10k1/main.c | 3 +--
> sound/oss/emu10k1/mixer.c | 3 +--
> 7 files changed, 7 insertions(+), 17 deletions(-)
[...]
> index fd82411..b3932e5 100644
> --- a/include/asm-m68k/sun3_pgalloc.h
> +++ b/include/asm-m68k/sun3_pgalloc.h
> @@ -36,12 +36,11 @@ static inline void pte_free(struct page *page)
> static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
> unsigned long address)
> {
> - unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT);
> + unsigned long page = get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
>
> if (!page)
> return NULL;
>
> - memset((void *)page, 0, PAGE_SIZE);
> return (pte_t *) (page);
> }
perhaps simply
return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
> diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
> index ca0c2a9..6f43b58 100644
> --- a/include/asm-um/pgtable-3level.h
> +++ b/include/asm-um/pgtable-3level.h
> @@ -61,10 +61,7 @@ static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
>
> static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
> {
> - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
> -
> - if(pmd)
> - memset(pmd, 0, PAGE_SIZE);
> + pmd_t *pmd = (pmd_t *) get_zeroed_page(GFP_KERNEL);
>
> return pmd;
> }
here too, but this is also good.
regards,
--
http://www.fi.muni.cz/~xslaby/ Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8 22A0 32CC 55C3 39D4 7A7E
next prev parent reply other threads:[~2007-01-03 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 13:51 [PATCH] Replace __get_free_page() + memset(0) with get_zeroed_page() calls Robert P. J. Day
2007-01-03 14:19 ` Jiri Slaby [this message]
2007-01-03 14:55 ` Robert P. J. Day
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=459BBB36.1070907@gmail.com \
--to=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@mindspring.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.