mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Andi Kleen <ak@muc.de>
Cc: linux-kernel@vger.kernel.org, <torvalds@transmeta.com>
Subject: Re: [PATCH] Put modules into linear mapping
Date: Fri, 27 Sep 2002 16:43:43 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0209271618360.8911-100000@serv> (raw)
In-Reply-To: <20020927140930.GA12610@averell>

Hi,

On Fri, 27 Sep 2002, Andi Kleen wrote:

> --- linux-2.5.38-work/include/asm-i386/module.h-MODULE	2002-09-25 00:59:28.000000000 +0200
> +++ linux-2.5.38-work/include/asm-i386/module.h	2002-09-27 15:30:35.000000000 +0200
> +/*
> + * Try to allocate in the linear large page mapping first to conserve
> + * TLB entries.
> + */
> +static inline void *module_map(unsigned long size)
> +{
> +	void *p = alloc_exact(size);
> +	if (!p)
> +		p = vmalloc(size);
> +	return p;
> +}

Why is i386 only? This is generic code and other archs will benefit from
it as well (or at least it won't hurt).

$ grep module_map include/asm-*/*.h
include/asm-alpha/module.h:#define module_map(x)                vmalloc(x)
include/asm-arm/module.h:#define module_map(x)          vmalloc(x)
include/asm-cris/module.h:#define module_map(x)         vmalloc(x)
include/asm-i386/module.h:#define module_map(x)         vmalloc(x)
include/asm-ia64/module.h:#define module_map(x)         vmalloc(x)
include/asm-m68k/module.h:#define module_map(x)         vmalloc(x)
include/asm-mips/module.h:#define module_map(x)         vmalloc(x)
include/asm-mips64/module.h:#define module_map(x)               vmalloc(x)
include/asm-parisc/pgtable.h:#define module_map vmalloc
include/asm-ppc/module.h:#define module_map(x)          vmalloc(x)
include/asm-ppc64/module.h:#define module_map(x)                vmalloc(x)
include/asm-s390/module.h:#define module_map(x)         vmalloc(x)
include/asm-s390x/module.h:#define module_map(x)                vmalloc(x)
include/asm-sh/module.h:#define module_map(x)           vmalloc(x)
include/asm-sparc/module.h:#define module_map(x)                vmalloc(x)
include/asm-sparc64/module.h:extern void * module_map (unsigned long size);
include/asm-x86_64/module.h:extern void *module_map(unsigned long);

The x86_64 version is currently broken, as it uses vmalloc_area_pages
which doesn't exist anymore, but it did the same as vmalloc. The sparc64
version also looks like vmalloc reimplementation.

> +
> +void *alloc_exact(unsigned int size)
> +{
> +	struct page *p, *w;
> +	int order = get_order(size);
> +
> +	p = alloc_pages(GFP_KERNEL, order);

Wouldn't it be better to add a gfp argument?

bye, Roman


  reply	other threads:[~2002-09-27 14:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-27 14:09 Andi Kleen
2002-09-27 14:43 ` Roman Zippel [this message]
2002-09-27 15:05 ` Christoph Hellwig
2002-09-28 13:47 ` Keith Owens
     [not found] <20020927140930.GA12610@averell.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0209271618360.8911-100000@serv.suse.lists.linux.kernel>
2002-09-27 15:36   ` Andi Kleen
2002-09-27 15:55     ` Roman Zippel
2002-09-27 16:14       ` Andi Kleen
2002-09-27 16:52         ` Roman Zippel
2002-09-27 16:59           ` Andi Kleen
2002-09-27 17:09             ` Roman Zippel

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=Pine.LNX.4.44.0209271618360.8911-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®