Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1922767ybb; Fri, 29 Mar 2019 14:16:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcb4lSbXaYCcivUhViRKDO29I3PyvTITMccaCGjF5VkLCV6tRzECGIoVVWot+xgpPc+428 X-Received: by 2002:a62:fb10:: with SMTP id x16mr49470282pfm.5.1553894198679; Fri, 29 Mar 2019 14:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553894198; cv=none; d=google.com; s=arc-20160816; b=trwYyYQ8nfyguW7vF2O/JHCcfM+GOr9kQHC8kUB3gWSIDiOlyTPs1zhwCbVs95w11O 3TTFsxEOEjvJPzb4fACBKHrh0i9F2TsHnzbVoBCiXKWreeXeJ4yf9EO5sLrKrvj3tAKb fwqyJLS9zKCDvvCftQ8o8HQl3SByt/ukMmDzSrP2KPbe3Ew+vwAPuUBSUZc+1kWgPWVo wX4zS0SQ7BF3222h+Q2knoixYDsq6T/ufObqZnG3G37eerMTbUl1zEptY5dHXMfhHFT2 OA60AS0jnC+DgLoIVDKdgakLDJY28pp1R/GbW77yuJk8ANzXUxgOOLYdOsS6qs/yJbwu Wlfw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Po/nzgdtzi8v6Fo6duX4gx/DPJSZpnrMuV/kmJ0V3mE=; b=Q0jJ9rCtIE/uGFZGbnJsoUSYbsElyYtaSVog9ak4GzDKg4kn0Me6veUx3U7VEsCPR9 N4xT0i/b0wUGS6mAfRRduwZWwFujEAP27OISfjjHNQCDS/py9okKVD+JCfeg3qbxCyVd zUksMdlWXtOrJwhvJBR0ciT+297mTKPJWK2ZafJTLxKH+DwTpcbcvXehrUvPR0/3NFfn ehowtl5njzPNeVDDGVXYtXDbNDYVFEH+ikIpYjadG8cw6Y39CmFZL2yP+D9wy6rWE9Dg kJEquh6uwX09+cdNJYRTcAbgDPkyrVF551K6+RYMP9Zj9fXISOQ/r0PFNzmHMc0rajED 6WcA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si2792240pgr.382.2019.03.29.14.16.23; Fri, 29 Mar 2019 14:16:38 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730283AbfC2VPc (ORCPT + 99 others); Fri, 29 Mar 2019 17:15:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40766 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729858AbfC2VPc (ORCPT ); Fri, 29 Mar 2019 17:15:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B51280E7A; Fri, 29 Mar 2019 21:15:32 +0000 (UTC) Received: from redhat.com (ovpn-125-57.rdu2.redhat.com [10.10.125.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87C3F5C22E; Fri, 29 Mar 2019 21:15:31 +0000 (UTC) Date: Fri, 29 Mar 2019 17:15:29 -0400 From: Jerome Glisse To: John Hubbard Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ralph Campbell , Andrew Morton , Dan Williams Subject: Re: [PATCH v2 01/11] mm/hmm: select mmu notifier when selecting HMM Message-ID: <20190329211529.GA6124@redhat.com> References: <20190325144011.10560-1-jglisse@redhat.com> <20190325144011.10560-2-jglisse@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 29 Mar 2019 21:15:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 28, 2019 at 01:33:42PM -0700, John Hubbard wrote: > On 3/25/19 7:40 AM, jglisse@redhat.com wrote: > > From: J?r?me Glisse > > > > To avoid random config build issue, select mmu notifier when HMM is > > selected. In any cases when HMM get selected it will be by users that > > will also wants the mmu notifier. > > > > Signed-off-by: J?r?me Glisse > > Acked-by: Balbir Singh > > Cc: Ralph Campbell > > Cc: Andrew Morton > > Cc: John Hubbard > > Cc: Dan Williams > > --- > > mm/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/mm/Kconfig b/mm/Kconfig > > index 25c71eb8a7db..0d2944278d80 100644 > > --- a/mm/Kconfig > > +++ b/mm/Kconfig > > @@ -694,6 +694,7 @@ config DEV_PAGEMAP_OPS > > > > config HMM > > bool > > + select MMU_NOTIFIER > > select MIGRATE_VMA_HELPER > > > > config HMM_MIRROR > > > > Yes, this is a good move, given that MMU notifiers are completely, > indispensably part of the HMM design and implementation. > > The alternative would also work, but it's not quite as good. I'm > listing it in order to forestall any debate: > > config HMM > bool > + depends on MMU_NOTIFIER > select MIGRATE_VMA_HELPER > > ...and "depends on" versus "select" is always a subtle question. But in > this case, I'd say that if someone wants HMM, there's no advantage in > making them know that they must first ensure MMU_NOTIFIER is enabled. > After poking around a bit I don't see any obvious downsides either. You can not depend on MMU_NOTIFIER it is one of the kernel config option that is not selectable. So any config that need MMU_NOTIFIER must select it. > > However, given that you're making this change, in order to avoid odd > redundancy, you should also do this: > > diff --git a/mm/Kconfig b/mm/Kconfig > index 0d2944278d80..2e6d24d783f7 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -700,7 +700,6 @@ config HMM > config HMM_MIRROR > bool "HMM mirror CPU page table into a device page table" > depends on ARCH_HAS_HMM > - select MMU_NOTIFIER > select HMM > help > Select HMM_MIRROR if you want to mirror range of the CPU page table of a Because it is a select option no harm can come from that hence i do not remove but i can remove it. Cheers, J?r?me