From patchwork Thu Aug 24 23:08:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 110965 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp132027qge; Thu, 24 Aug 2017 16:09:08 -0700 (PDT) X-Received: by 10.84.232.77 with SMTP id f13mr8616339pln.173.1503616148771; Thu, 24 Aug 2017 16:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503616148; cv=none; d=google.com; s=arc-20160816; b=bw2RGcRtJURdjUp+zPtVD1o+jvDqCYpcrEhqJ6jGAnwMnyZklRwwmElFMAMm7ezRC+ hcorebG1zPeMm5d6HPXJWv91HPKSoSCZzHw/yaRARnMzNHd4KcEwsGra2E5XGvuW2Gqu PnLa+Ss3rpbaiysRaMNq/zPwnsXled61hUeLX2XNfh4cNI27eE92zcJu0eubAFyGEiS0 HZvR1xfNxPVjnKrgFNe2CklvUmIAb84/RupPdWma6cK5WKZgp/u4h2pWEb+3D+m/XjIX +RDgUzzH6dIvG+5d+MhuwnJgn1+slu1OqPLUk4pLwICknChP4p6DLnVAclPHC1SRmCam n7SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sbFQUe2tZQ9G+rgEeIe3rQDdH6+CBPzijA2eEHMwJOE=; b=lWuGumJPiwYeTHHkT7SAzJ3yAcGRNvu9/KjWPXf+ATa9afd6fdWynxGAlhv5+t4X2z WjIEXMEzrwt+a5kZHuq7A/9NdOV98LvM7g0L+sxTy3kGD9d5ZORgR4Agzm+Sf9NS3RyU 0UWe0Em2xLIJdYkhFr78UOXyOap9wZFitveLOlzehj54SFXQmQoWbtkd+fVoTRdmGw34 hPIUBzJWpmUz9Qq84wM9n+3iVGfpAU6DiM5kl3JH/fJRxw33mw3/fa66cPqHBRABiADy gllZTJ6rARXUcgYV0vkM/++IDgTpGeyrckJQQ81IdoWDb9bK0FjZQTfD4ir4W89clqTH jISQ== 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 b65si1198657pfl.255.2017.08.24.16.09.08; Thu, 24 Aug 2017 16:09:08 -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 S1754147AbdHXXJG (ORCPT + 26 others); Thu, 24 Aug 2017 19:09:06 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50996 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753998AbdHXXJF (ORCPT ); Thu, 24 Aug 2017 19:09:05 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M5fZo-1dMran1KZM-00xcS5; Fri, 25 Aug 2017 01:08:53 +0200 From: Arnd Bergmann To: =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= Cc: Arnd Bergmann , Andrew Morton , Stephen Rothwell , Subhash Gutti , Evgeny Baskakov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: HMM always needs MMU_NOTIFIER Date: Fri, 25 Aug 2017 01:08:23 +0200 Message-Id: <20170824230850.1810408-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:iPjr7S/UxN9MELpK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precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building a kernel with HMM enabled but without MMU_NOTIFIER, we run into a build error: mm/hmm.c:66:22: error: field 'mmu_notifier' has incomplete type struct mmu_notifier mmu_notifier; If I read this right, the dependency is correct, but the #ifdef annotations in the mm/hmm.c are not. This changes them in a way to make it all build cleanly. Fixes: e4e0061ea15c ("mm/device-public-memory: device memory cache coherent with CPU") Signed-off-by: Arnd Bergmann --- I did not try very hard to understand what the code is supposed to do, please check if this makes sense beyond fixing the build before applying. --- mm/hmm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/mm/hmm.c b/mm/hmm.c index 4a179a16ab10..b9e9f14e7454 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -41,11 +41,16 @@ */ DEFINE_STATIC_KEY_FALSE(device_private_key); EXPORT_SYMBOL(device_private_key); -static const struct mmu_notifier_ops hmm_mmu_notifier_ops; #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */ +void hmm_mm_destroy(struct mm_struct *mm) +{ + kfree(mm->hmm); +} + +#if IS_ENABLED(CONFIG_HMM_MIRROR) +static const struct mmu_notifier_ops hmm_mmu_notifier_ops; -#ifdef CONFIG_HMM /* * struct hmm - HMM per mm struct * @@ -124,13 +129,6 @@ static struct hmm *hmm_register(struct mm_struct *mm) return mm->hmm; } -void hmm_mm_destroy(struct mm_struct *mm) -{ - kfree(mm->hmm); -} -#endif /* CONFIG_HMM */ - -#if IS_ENABLED(CONFIG_HMM_MIRROR) static void hmm_invalidate_range(struct hmm *hmm, enum hmm_update_type action, unsigned long start,