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: 173422 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4874268ilq; Mon, 9 Sep 2019 13:43:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmp3T3N+hH6RCeqdeNjevrkr9+ffbpx8oADI/9r20ApqMuL5fwCHZLMr//btSmiax6Bs/t X-Received: by 2002:a17:906:7621:: with SMTP id c1mr5456597ejn.39.1568061787268; Mon, 09 Sep 2019 13:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568061787; cv=none; d=google.com; s=arc-20160816; b=UqgOzK7uGvzWdFdprv5HHQsNA0zdn7ClxSuv4GWnAu4DLGoS2OPkJTvDNenvVehObP PBiEOV59p0NVLGj/JK/2QvDK1QfTeXqtOVcp41E70em/4jQMk6y/EHG+MNy/YbdBh3hU 9wkHrW7dQ8Pq2I5t3mSap7cpfZZkFp/+GS5AtYstGB5zbACfROJdlcf9eyP1OmHNJYgM sUHMhE6Ff4LqE6WpPp3rJQQUVmEiKCZ1zrLKuRVOr4vKE/bYFbMoyFIQkMqyo1LC6/MI 8naqPEqcuuYa5mvDyKWYI9Lb+SdZXQHV1YoHhzcFORk87adblNExfWuJMqZB1InpJUtk 9wUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KTR1gEksziOd+qWlvorhQ2xVA7/vEiow9AQLQBa/MnA=; b=ir6vjV68ESUdAL+FEE8bni75duck/dpboYd6ems4FqTarRT6ahxWpIiUKc92MQ/+5d 7WuIV+nghoBXevG9cnpMC+F3oFj1zoiWtOoEEHomRS2cd5SVFsIkmOBr4oPM/OReE0hr LSINq5kojr/dN5fYEmY3YWSQU2I2LM8qLkZ7hv+x9Zelu49r/Jqbmz5rhC6yQbZNpZu/ YbBcY1Q1ozwrAL7olpCABy4Ik2ZZerz9PwEmsUsv8wAyXFUYaQvJmJThwl1ZslVpWVOd lgC0E3SjkdtjAfccPtjBQevlRAUzbiRyn5V0njo9lLcbbQGo6J9fwxedcMqTK1z1EANn ieeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o56si10046961edc.349.2019.09.09.13.43.07; Mon, 09 Sep 2019 13:43:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391716AbfIIUnG (ORCPT + 28 others); Mon, 9 Sep 2019 16:43:06 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:42355 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728204AbfIIUnF (ORCPT ); Mon, 9 Sep 2019 16:43:05 -0400 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: V03:K1:NMgxzMZvNg4wYSfExpvmPgKHwnZ0vKKpKYsDNKfr1gaPuEOGj13 9spfXcxohF5+owmMJ9nammIJCCQiu7DMpfXvuT2coJGiGarzO6vb/d3lF1fiLXjkdyRuL7M tOCQm7mRyhjjH61yIGaillDR5bdbqL0qWLgzJzWUMrVI0NVSW5RZF6brCLUjDNp06qKNCG5 AiUHc8vd8nnf6RnUW6KSg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:e9wc4PuIlN8=:VQHamnwdDmOvm/t4sXsE4K rFPAvU6xvFooY2/BKW+q0CLtqQf4ht8iY6czqafmpju4onzJuZ7IQSatMoHAJYgqmI2TB+ZCM B8L0UDhX5J8JjL9khFaDkn/txs8rMFW6Mn/8sLWKz7PtYrHt+4BFO4b08zwzMm3xa1itXbzeX hYaBO7eNdiw92POSkthjxYpJwGeL596Z0fRcjczrM1pkOU9cIKkrI4Db+Ut2schd8k4n8NBRm IJGnm0qpCFT3T4Y7dwaJNSV3G06nxWpuex2MpCyKLycwLNnQdEmreptjIvQ3lapztT0TPCdJG f3Z2vt45S6MzHt9ueOqep8VNzKJoCFBei6oo6a5bASDfldb2rFnjdV1IndtVa8/qDiBdePISs uH2nwA2yI7tNl50aNnVQyEvoYqyFMIcIxdHzNHCveSz6kqZlpKllRJGH2MJIF/RP0OV8ldsTh 6KiRzEGwHm+QakSYpHSXlsNJkywC2R/kni9Me5LPxdG1h+jFXIar+YWb1Zx5JNmjvohRHzWYY Dgpe3/RHod2rQ0l3dgqXd1P0OWKb4EhuNbeWxILBuD73L2pu1Eh2Hs1YpRxmv+i1dmaslP83p koFevhO1UWPRbckA4ZxUkZOHLLWJtUilwTgKgtdCnllLQPjnFHsfQ4yv7mZzwpO5XziAZSWDz lg29yZOQyABLlNLZxpohs4FYc/FuKdHlS9jDFuh/425QhrYxkTWZpdZ/+iKxY2wpRcTDFRndL CnezSza2f0Np3nj3lo/SPBgwR3zs4sn2A/AkHDkoOIuw/OGkv7mPODwbd8l6mKxbuKiv/SZ0e RO3slh3ultmVdWp3eD8T31Z2dLgLVAY5FuUz5UqLV9e7exCahI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.0 Acked-by: Michal Hocko 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 *);