From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D35D1C433DB for ; Thu, 18 Feb 2021 20:41:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DD2164E4B for ; Thu, 18 Feb 2021 20:41:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DD2164E4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 908946B0006; Thu, 18 Feb 2021 15:41:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E0A36B006C; Thu, 18 Feb 2021 15:41:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F6ED6B006E; Thu, 18 Feb 2021 15:41:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 6A51B6B0006 for ; Thu, 18 Feb 2021 15:41:09 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 256A918095572 for ; Thu, 18 Feb 2021 20:41:09 +0000 (UTC) X-FDA: 77832558258.01.6C21F5E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 8AB45E00010D for ; Thu, 18 Feb 2021 20:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613680868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yKbZPfRfjBxv5rHh9BbhUmOccS2Zox4zMDSygTP6AuE=; b=hGFJT1NMNrO7VmVs5FIARrCDjZFboJ38dCcETDnH7Qd+LiHl3p4uFjaVicSeDjI0BQJ+H8 I0VE7T95r5bNLffNZ4F+y9jLjot154r5xukA5CYxDnXbz3FkyLVf3gV5OLNJVsmileaHPa kbdWj1Vy6BeCArPa7zB3cGWOu2OpRFw= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-FhwtgoS7NXmKlJkHev3z9g-1; Thu, 18 Feb 2021 15:41:05 -0500 X-MC-Unique: FhwtgoS7NXmKlJkHev3z9g-1 Received: by mail-qk1-f198.google.com with SMTP id d66so2096852qke.9 for ; Thu, 18 Feb 2021 12:41:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yKbZPfRfjBxv5rHh9BbhUmOccS2Zox4zMDSygTP6AuE=; b=noTdal2LCbi+7gkUfvDB5dMQxS5SrDIl4/X2d6ZQYOhLBQgO0/GcyimjizAOH8wmeU MaUVdR3VFG6Kl4FPcHqTEeA6H7h2UbMYUh2nq6/MkyhW5svgcf4x5riU36fX/g0QyA0v 68GfCibuLG7BGZQ9nKLzEvFvmzNKoJIJHueTxxm5sLlpTTlY8E5g1VRcTfsWv+szJahY Lei59W83IYkVc9mStma/Al+Fvd+YS9MF+vzsVjQ3xz/IGFxa1kCjwdYmnSLcaf9vguZZ 8XFiDP1kAdEDoLTxlK9w2BcT67BeYUiYWHbrmllShPiuhtWGLKcmmk7ZZyqt92xTbcnG ja5g== X-Gm-Message-State: AOAM530BoXvIM5crpPMFN26KLa1oAsUUgxRY27z2tenZobrUFTFrXW+C PRwFBe2C3rGijQGMIcmBD5f5+rXSYnxWiCcUHa9I5zjLGhq80crCblPHOgDopKyMLEQzU4IMH8h VY7ayxyTPYeU= X-Received: by 2002:a05:6214:883:: with SMTP id cz3mr6171949qvb.43.1613680865181; Thu, 18 Feb 2021 12:41:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF+f1xE9yEhDOJG4UxtT+ns0Y+9xXv8zVq92FiKmu+S7nGjG/TECSJ03cYyFkcPvUaqLTCBQ== X-Received: by 2002:a05:6214:883:: with SMTP id cz3mr6171931qvb.43.1613680865024; Thu, 18 Feb 2021 12:41:05 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id i5sm4083266qtw.3.2021.02.18.12.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 12:41:04 -0800 (PST) Date: Thu, 18 Feb 2021 15:41:03 -0500 From: Peter Xu To: Axel Rasmussen Cc: Linux MM , LKML , Mike Kravetz , Mike Rapoport , Andrea Arcangeli , Matthew Wilcox , "Kirill A . Shutemov" , Andrew Morton Subject: Re: [PATCH v2 4/4] hugetlb/userfaultfd: Unshare all pmds for hugetlbfs when register wp Message-ID: <20210218204103.GF108961@xz-x1> References: <20210217204418.54259-1-peterx@redhat.com> <20210217204619.54761-1-peterx@redhat.com> <20210217204619.54761-3-peterx@redhat.com> <20210218203214.GD108961@xz-x1> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8AB45E00010D X-Stat-Signature: unhdz31md6tmcpfad6qw471fqhy3p1ty Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613680866-731734 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 18, 2021 at 12:34:55PM -0800, Axel Rasmussen wrote: > On Thu, Feb 18, 2021 at 12:32 PM Peter Xu wrote: > > > > On Thu, Feb 18, 2021 at 10:32:00AM -0800, Axel Rasmussen wrote: > > > > @@ -1448,6 +1449,9 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx, > > > > vma->vm_flags = new_flags; > > > > vma->vm_userfaultfd_ctx.ctx = ctx; > > > > > > > > + if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma)) > > > > + hugetlb_unshare_all_pmds(vma); > > > > > > This line yields the following error, if building with: > > > # CONFIG_CMA is not set > > > > > > ./fs/userfaultfd.c:1459: undefined reference to `hugetlb_unshare_all_pmds' > > > > Ouch.. Axel, you mean CONFIG_HUGETLBFS rather than CONFIG_CMA, am I right? > > Surprisingly no, there's a "#ifdef CONFIG_CMA" line ~100 lines above > where hugetlb_unshare_all_pmds is defined in hugetlb.c which causes > this. My guess is that putting the function inside that block was > accidental and it can just be moved. Right, thanks for catching that, I actually need to fix both. Thanks, -- Peter Xu