* [PATCH AUTOSEL 5.3 42/49] mm: add dummy can_do_mlock() helper
[not found] <20190929173053.8400-1-sashal@kernel.org>
@ 2019-09-29 17:30 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2019-09-29 17:30 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Arnd Bergmann, Jason Gunthorpe, Michal Hocko, Bernard Metzler,
Matthew Wilcox (Oracle),
Kirill A. Shutemov, Andrew Morton, Linus Torvalds, Sasha Levin,
linux-mm
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit 710ec38b0f633ab3e2581f07a73442d809e28ab0 ]
On kernels without CONFIG_MMU, we get a link error for the siw driver:
drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get':
siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock'
This is probably not the only driver that needs the function and could
otherwise build correctly without CONFIG_MMU, so add a dummy variant that
always returns false.
Link: http://lkml.kernel.org/r/20190909204201.931830-1-arnd@arndb.de
Fixes: 2251334dcac9 ("rdma/siw: application buffer management")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/mm.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0334ca97c584d..fe4552e1c40b4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1405,7 +1405,11 @@ extern void pagefault_out_of_memory(void);
extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);
+#ifdef CONFIG_MMU
extern bool can_do_mlock(void);
+#else
+static inline bool can_do_mlock(void) { return false; }
+#endif
extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *);
--
2.20.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-29 17:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190929173053.8400-1-sashal@kernel.org>
2019-09-29 17:30 ` [PATCH AUTOSEL 5.3 42/49] mm: add dummy can_do_mlock() helper Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox