public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: <uclinux-dev@uclinux.org>, David Howells <dhowells@redhat.com>,
	Paul Mundt <lethal@linux-sh.org>,
	<uclinux-dist-devel@blackfin.uclinux.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NOMMU: support SMP dynamic percpu_alloc
Date: Wed, 23 Mar 2011 23:30:42 +1000	[thread overview]
Message-ID: <4D89F602.5060000@snapgear.com> (raw)
In-Reply-To: <1300826506-23192-1-git-send-email-vapier@gentoo.org>

On 23/03/11 06:41, Mike Frysinger wrote:
> From: Graf Yang<graf.yang@analog.com>
>
> The percpu code requires more functions to be implemented in the mm core
> which nommu currently does not provide.  So add inline implementations
> since these are largely meaningless on nommu systems.
>
> Signed-off-by: Graf Yang<graf.yang@analog.com>
> Signed-off-by: Mike Frysinger<vapier@gentoo.org>

Acked-by: Greg Ungerer <gerg@uclinux.org>


> ---
>   include/linux/vmalloc.h |   32 ++++++++++++++++++++++++++++++++
>   1 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
> index 81f8622..01bbeb4 100644
> --- a/include/linux/vmalloc.h
> +++ b/include/linux/vmalloc.h
> @@ -98,10 +98,27 @@ extern struct vm_struct *remove_vm_area(const void *addr);
>
>   extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
>   			struct page ***pages);
> +#ifdef CONFIG_MMU
>   extern int map_kernel_range_noflush(unsigned long start, unsigned long size,
>   				    pgprot_t prot, struct page **pages);
>   extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size);
>   extern void unmap_kernel_range(unsigned long addr, unsigned long size);
> +#else
> +static inline int
> +map_kernel_range_noflush(unsigned long start, unsigned long size,
> +			pgprot_t prot, struct page **pages)
> +{
> +	return size>>  PAGE_SHIFT;
> +}
> +static inline void
> +unmap_kernel_range_noflush(unsigned long addr, unsigned long size)
> +{
> +}
> +static inline void
> +unmap_kernel_range(unsigned long addr, unsigned long size)
> +{
> +}
> +#endif
>
>   /* Allocate/destroy a 'vmalloc' VM area. */
>   extern struct vm_struct *alloc_vm_area(size_t size);
> @@ -119,11 +136,26 @@ extern struct vm_struct *vmlist;
>   extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
>
>   #ifdef CONFIG_SMP
> +# ifdef CONFIG_MMU
>   struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
>   				     const size_t *sizes, int nr_vms,
>   				     size_t align);
>
>   void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
> +# else
> +static inline struct vm_struct **
> +pcpu_get_vm_areas(const unsigned long *offsets,
> +		const size_t *sizes, int nr_vms,
> +		size_t align)
> +{
> +	return NULL;
> +}
> +
> +static inline void
> +pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
> +{
> +}
> +# endif
>   #endif
>
>   #endif /* _LINUX_VMALLOC_H */


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

  parent reply	other threads:[~2011-03-23 13:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 20:41 [PATCH] NOMMU: support SMP dynamic percpu_alloc Mike Frysinger
2011-03-23 12:37 ` Paul Mundt
2011-03-23 23:09   ` [uclinux-dist-devel] " Mike Frysinger
2011-03-24  0:06     ` David Howells
2011-03-24  0:13       ` Mike Frysinger
2011-03-24  0:20         ` David Howells
2011-03-23 13:30 ` Greg Ungerer [this message]
2011-03-24  0:20 ` David Howells
2011-03-24  0:31   ` Mike Frysinger
2011-03-24  9:40     ` David Howells

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=4D89F602.5060000@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=dhowells@redhat.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uclinux-dev@uclinux.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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