All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Cc: Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 1/5] mm/vmalloc: remove map_kernel_range
Date: Fri, 02 Apr 2021 01:56:30 +1000	[thread overview]
Message-ID: <1617292497.o1uhq5ipxp.astroid@bobo.none> (raw)
In-Reply-To: <20210322021806.892164-2-npiggin@gmail.com>

Excerpts from Nicholas Piggin's message of March 22, 2021 12:18 pm:
> This is a shim around vmap_pages_range, get rid of it.
> 
> Move the main API comment from the _noflush variant to the normal
> variant, and make _noflush internal to mm/.
> 

This requires a fix for nommu builds.
---

Fix "mm/vmalloc: remove map_kernel_range"

Fixes: "percpu.c:undefined reference to `vmap_pages_range_noflush'" on
riscv nommu builds.

Previous code had a strange NOMMU implementation of
map_kernel_range_noflush that came in with commit b554cb426a955
("NOMMU: support SMP dynamic percpu_alloc") which would return
success if the size was <= PAGE_SIZE, but that has no way of working
on NOMMU because the page can not be mapped to the new start address
even if there is only one of them. So change this code to always
return failure.

NOMMU probably needs to take a closer look at what it does with
percpu-vm.c and carve out a special case there if necessary rather
than pretend vmap works.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 mm/internal.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mm/internal.h b/mm/internal.h
index 6d3fd85ab866..ac5d1abfb739 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -621,7 +621,16 @@ struct migration_target_control {
 /*
  * mm/vmalloc.c
  */
+#ifdef CONFIG_MMU
 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
                 pgprot_t prot, struct page **pages, unsigned int page_shift);
+#else
+static inline
+int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
+                pgprot_t prot, struct page **pages, unsigned int page_shift)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif	/* __MM_INTERNAL_H */
-- 
2.23.0



       reply	other threads:[~2021-04-01 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210322021806.892164-1-npiggin@gmail.com>
     [not found] ` <20210322021806.892164-2-npiggin@gmail.com>
2021-04-01 15:56   ` Nicholas Piggin [this message]
     [not found] ` <20210322021806.892164-5-npiggin@gmail.com>
2021-04-01 15:58   ` [PATCH v2 4/5] mm/vmalloc: remove unmap_kernel_range Nicholas Piggin

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=1617292497.o1uhq5ipxp.astroid@bobo.none \
    --to=npiggin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.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 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.