public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	rusty@rustcorp.com.au, jdike@addtoit.com, mingo@elte.hu
Subject: Re: [Patch 2/4] x86 module: merge the rest functions with macros
Date: Tue, 26 May 2009 18:02:57 +0800	[thread overview]
Message-ID: <4A1BBE51.8090208@redhat.com> (raw)
In-Reply-To: <20090526092157.GA25759@infradead.org>

Christoph Hellwig wrote:
> On Tue, May 26, 2009 at 04:35:22AM -0400, Amerigo Wang wrote:
>   
>> +#if defined(CONFIG_UML) || defined(CONFIG_X86_32)
>> +void *module_alloc(unsigned long size)
>> +{
>> +	if (size == 0)
>> +		return NULL;
>> +	return vmalloc_exec(size);
>> +}
>> +#else /*X86_64*/
>> +void *module_alloc(unsigned long size)
>> +{
>> +	struct vm_struct *area;
>> +
>> +	if (!size)
>> +		return NULL;
>> +	size = PAGE_ALIGN(size);
>> +	if (size > MODULES_LEN)
>> +		return NULL;
>> +
>> +	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
>> +	if (!area)
>> +		return NULL;
>> +
>> +	return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
>> +}
>> +#endif
>>     
>
> vmalloc_exec basically expands to the x86-64 version of that code, just
> using VMALLOC_START/VMALLOC_END instead of MODULES_VADDR/MODULES_END.
>
> So instead of having two variants it would be better to use the x86-64
> unconditionally and define MODULES_VADDR/MODULES_END to
> VMALLOC_START/VMALLOC_END to 32bit and uml.
>
> And that part should be a patch of it's own, not mixed with others.
>   

Thanks, it is a good idea!

But... vmalloc_exec() also sets __GFP_HIGHMEM, this is different from 
x86_64.
No? Or __GFP_HIGHMEM is meaningless on x86_64? :-)



  reply	other threads:[~2009-05-26 10:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  8:35 [Patch 0/4] module: merge module_32.c and module_64.c Amerigo Wang
2009-05-26  8:35 ` [Patch 1/4] x86 module: merge the same functions in " Amerigo Wang
2009-05-26  8:35 ` [Patch 2/4] x86 module: merge the rest functions with macros Amerigo Wang
2009-05-26  9:21   ` Christoph Hellwig
2009-05-26 10:02     ` Amerigo Wang [this message]
2009-05-26  8:35 ` [Patch 3/4] uml module: fix uml build process due to this merge Amerigo Wang
2009-05-26  8:35 ` [Patch 4/4] module: trim exception table in module_free() Amerigo Wang
2009-05-27  2:21   ` Rusty Russell
2009-05-27  3:11     ` Amerigo Wang
2009-05-27  5:23       ` Rusty Russell
2009-05-27  5:48         ` Amerigo Wang
2009-05-27  7:46         ` Amerigo Wang
2009-05-28  6:55           ` Rusty Russell
2009-05-31  5:15             ` Amerigo Wang
2009-06-01 12:28               ` Rusty Russell

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=4A1BBE51.8090208@redhat.com \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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