Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5470003ybe; Tue, 10 Sep 2019 04:18:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGGbPv2bYGYD7MdqvKsc1dQ0n3rlNPdtpjthtNPi4EGQbvzSIhap0LkGEc0hVpC4xXCWPP X-Received: by 2002:a50:d552:: with SMTP id f18mr30337610edj.36.1568114333671; Tue, 10 Sep 2019 04:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568114333; cv=none; d=google.com; s=arc-20160816; b=yyVrxmmUfZtrVEz7sL/7mE1EHJUUA3NtNtykW9i9EKINr/gy1ChjONxtWdv7SxWW1Y hZT2Uou8JJm/2CNpIcxCOlSPwmn5IkpdW5r8vLHnne3dVWQ+J6FIiv60H3IZhAG7eNDW tBbJ1ULL7Nfgq41e+djKvHCMBlp9Lf+hYlICZkMPzr1x3snX5AwQt+TvO4Bn6ZKuhhjm Vlup8Q7L6ly+C68RGPo1spJS8t3zSM98copNVtD07xqKJcxH+7+AQWobLxvjYKmhjH/e gMJRdMmHfZynBZ6A1hbHruJFvv10rmpO+xOpDx2s1Psfv+UiBJ7+HD3K97ye7mm9Mdwg WAzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VZQ8sjGX451dc9o5eBp4RvBqkRbJnoGkvVNSJB8JDug=; b=BtQHCtghhOPK/xHJp/KCG0FbR9skvYKCRRia7/Xq1+/IM1G5qymkFNZkofIjZSFzcQ /siSrfkd+E5WtWxlEtkAL3IF2oEUSxX3QYXpoBOwJtE91kbkNlzBVOe7XvhFIO6hduaQ JB+Wkl3oV5vMZ4hxHhN4x/aoAiaWdrSGr/7FjHSqQl+kB4gbyBzIb+LTC2tNtTImfTYW h1lsKRPVHfuppor7K2RzCFqlhsrVRgpuh2czNr533HmwkSv1h4FmLZDE5BHjObSYOWPx r0fI3/AsmO5910pJIX3dZiD/+qVKU5XLYyrxNqwZwpVEo/u+RVo/OIAREzuHmVkKJFqe Ukig== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si8721822ejf.69.2019.09.10.04.18.07; Tue, 10 Sep 2019 04:18:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406574AbfIJHKd (ORCPT + 99 others); Tue, 10 Sep 2019 03:10:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:39702 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2406564AbfIJHKd (ORCPT ); Tue, 10 Sep 2019 03:10:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 523C0AFF5; Tue, 10 Sep 2019 07:10:31 +0000 (UTC) Date: Tue, 10 Sep 2019 09:10:30 +0200 From: Michal Hocko To: Arnd Bergmann Cc: Andrew Morton , linux-mm@kvack.org, linux-rdma@vger.kernel.org, Jason Gunthorpe , Bernard Metzler , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: add dummy can_do_mlock() helper Message-ID: <20190910071030.GG2063@dhcp22.suse.cz> References: <20190909204201.931830-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190909204201.931830-1-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09-09-19 22:41:40, Arnd Bergmann wrote: > 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 Makes sense Acked-by: Michal Hocko but IB on nonMMU? Whut? Is there any HW that actually supports this? Just wondering... > --- > 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 *); > > -- > 2.20.0 > -- Michal Hocko SUSE Labs