Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7013230ybi; Thu, 1 Aug 2019 01:54:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkxvkBBDadE3KPGribA7XhFaWsN6+YiTl+Mb0lD5pSuOkKo9g6tgbh8klbfllPCZfw2mz3 X-Received: by 2002:a17:902:8546:: with SMTP id d6mr121736595plo.207.1564649661255; Thu, 01 Aug 2019 01:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564649661; cv=none; d=google.com; s=arc-20160816; b=aGYhz1K9Y+FQ/XmopyciQdDm87om9B6KjLCXgOuAzs5MEQaiOokvYhPvhYLPsYQ0MH EkiMPMZWBJ+olypavRM5H7ZDEoMvxZXdmrcGq7jYyPg513h3XL0cU6nMcbL0NziqTTTI updwOQMkB0tNNSMxtfiqidESeOjzRPJNoHQiGA7VxtIA6pSwW/ZHpW7ujq+VED2Y0voM xwfwitD4e98BiidPAtU1lRr69hcdtwLitl2VWx68EDRhi8zg7TCpwKB5Juc5/yiTOmh6 W5vew0w6vqK0VN/DyVFH10/9+/w8HUWEYywbhsXKmp3QMC5/psTSUqtfTwycJLJce7LP w+1A== 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=/S2h88IKiOej42Ja9Iot5OrAIsAOaPUWxITxWpZwYj8=; b=xyDe/s+m/4+FPEjmzloBhZoAzeVg2Igg3ORErQGilwusLmG7fCH4PUer1Cx/en/1vM 0YR+EaBKNSvikmqiZCCpDU5dbR44JiTVry+73UQ7WHDIvlzOQoDZzFqMy2I8TmuYa0l4 CGupNEBbuGg9JfpmYKWnMKo9yuAf1e8kiawxQ+htHXsyiRFcqGh3/lF1a8iFPO64zu62 AMCpNM4zQDdunM+BpNDtXBYXDed1guutwhURUnEhgzWh6Q2wZ0WiHLM0A3hRcKuXZQyH kakCYFBhJWFlBZJ0/8S26VJGA/TrncD6s4jl3Rs14FYL9u+H+3baZ36jSP3z3Oas9R14 wQlA== 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 a21si35681353pfl.167.2019.08.01.01.54.05; Thu, 01 Aug 2019 01:54:21 -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 S1730475AbfHAHBz (ORCPT + 99 others); Thu, 1 Aug 2019 03:01:55 -0400 Received: from verein.lst.de ([213.95.11.211]:40859 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726794AbfHAHBz (ORCPT ); Thu, 1 Aug 2019 03:01:55 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8C39E68AFE; Thu, 1 Aug 2019 09:01:51 +0200 (CEST) Date: Thu, 1 Aug 2019 09:01:51 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , =?iso-8859-1?B?Suly9G1l?= Glisse , Ben Skeggs , Felix Kuehling , Ralph Campbell , "linux-mm@kvack.org" , "nouveau@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 11/13] mm: cleanup the hmm_vma_handle_pmd stub Message-ID: <20190801070151.GB15404@lst.de> References: <20190730055203.28467-1-hch@lst.de> <20190730055203.28467-12-hch@lst.de> <20190730175309.GN24038@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190730175309.GN24038@mellanox.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 05:53:14PM +0000, Jason Gunthorpe wrote: > > - /* If THP is not enabled then we should never reach this > > This old comment says we should never get here > > > +} > > +#else /* CONFIG_TRANSPARENT_HUGEPAGE */ > > +static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, > > + unsigned long end, uint64_t *pfns, pmd_t pmd) > > +{ > > return -EINVAL; > > So could we just do > #define hmm_vma_handle_pmd NULL > > ? > > At the very least this seems like a WARN_ON too? Despite the name of the function hmm_vma_handle_pmd is not a callback for the pagewalk, but actually called from hmm_vma_handle_pmd. What we could try is just and empty non-inline prototype without an actual implementation, which means if the compiler doesn't optimize the calls away we'll get a link error.