From patchwork Mon Sep 9 20:41:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11138551 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 019691395 for ; Mon, 9 Sep 2019 20:42:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BB76B21A4A for ; Mon, 9 Sep 2019 20:42:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB76B21A4A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C17EE6B0003; Mon, 9 Sep 2019 16:42:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BC7AE6B0006; Mon, 9 Sep 2019 16:42:10 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B03FA6B0007; Mon, 9 Sep 2019 16:42:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 88E9F6B0003 for ; Mon, 9 Sep 2019 16:42:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 33D0B180AD7C3 for ; Mon, 9 Sep 2019 20:42:10 +0000 (UTC) X-FDA: 75916554420.21.men71_6a2b4db52982a X-Spam-Summary: 2,0,0,2c0cc247aebe5119,d41d8cd98f00b204,arnd@arndb.de,:akpm@linux-foundation.org::linux-rdma@vger.kernel.org:arnd@arndb.de:jgg@mellanox.com:bmt@zurich.ibm.com:willy@infradead.org:mhocko@suse.com:kirill.shutemov@linux.intel.com:linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1311:1314:1345:1431:1437:1515:1534:1541:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2902:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3871:3874:4321:4385:5007:6261:10004:11026:11658:11914:12043:12160:12296:12297:12438:12555:12679:12895:13069:13311:13357:13870:13894:14096:14181:14384:14394:14721:21080:21433:21451:21627:21939:30054,0,RBL:217.72.192.75:@arndb.de:.lbl8.mailshell.net-62.14.6.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: men71_6a2b4db52982a X-Filterd-Recvd-Size: 3445 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Sep 2019 20:42:09 +0000 (UTC) Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MQ5aw-1hlTmW3fuq-00M5vK; Mon, 09 Sep 2019 22:42:05 +0200 From: Arnd Bergmann To: Andrew Morton Cc: linux-mm@kvack.org, linux-rdma@vger.kernel.org, Arnd Bergmann , Jason Gunthorpe , Bernard Metzler , "Matthew Wilcox (Oracle)" , Michal Hocko , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org Subject: [PATCH] mm: add dummy can_do_mlock() helper Date: Mon, 9 Sep 2019 22:41:40 +0200 Message-Id: <20190909204201.931830-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID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ODwbd8l6mKxbuKiv/SZ0e RO3slh3ultmVdWp3eD8T31Z2dLgLVAY5FuUz5UqLV9e7exCahI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Fixes: 2251334dcac9 ("rdma/siw: application buffer management") Suggested-by: Jason Gunthorpe Signed-off-by: Arnd Bergmann Acked-by: Michal Hocko --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 66f296181bcc..cc292273e6ba 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1424,7 +1424,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 *);